Latest Version: 0.9.6.2

CreditCardExpires

Checks that credit card expiration date is valid relative to the current date.

You pass in the name of the field that has the credit card expiration month and the field with the credit card expiration year.

>>> ed = CreditCardExpires()
>>> ed.to_python({'ccExpiresMonth': '11', 'ccExpiresYear': '2250'})
{'ccExpiresYear': '2250', 'ccExpiresMonth': '11'}
>>> ed.to_python({'ccExpiresMonth': '10', 'ccExpiresYear': '2005'})
Traceback (most recent call last):
    ...
Invalid: ccExpiresMonth: Invalid Expiration Date<br>
ccExpiresYear: Invalid Expiration Date

Messages

badType:
The input must be a string (not a %(type)s: %(value)r)
empty:
Please enter a value
invalidNumber:
Invalid Expiration Date
noneType:
The input must be a string (not None)
notANumber:
Please enter numbers only for month and year

Attributes

a __singletonmethods__

('to_python', 'from_python')

a __unpackargs__

('cc_expires_month_field', 'cc_expires_year_field')

a accept_python

True

a cc_expires_month_field

'ccExpiresMonth'

a cc_expires_year_field

'ccExpiresYear'

a compound

False

a not_empty

False

a repeating

False

a strip

False

Methods

f __call__(self, *args, **kw) ...

f __classinit__(cls, new_attrs) ...

f __classsourcerepr__(cls, source, binding=None) ...

f __init__(self, *args, **kw) ...

f __initargs__(self, new_attrs) ...

f __sourcerepr__(self, source, binding=None) ...

f validate_partial(self, field_dict, state) ...

f validate_python(self, field_dict, state) ...

See the source for more information.

Top