Changeset 7979 for django/branches/gis/django/core/validators.py
- Timestamp:
- 07/19/08 08:30:47 (6 months ago)
- Files:
-
- django/branches/gis (modified) (1 prop)
- django/branches/gis/django/core/validators.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/gis
- Property svnmerge-integrated changed from /django/trunk:1-7917 to /django/trunk:1-7978
django/branches/gis/django/core/validators.py
r7918 r7979 142 142 # produces much friendlier error messages. 143 143 year, month, day = map(int, date_string.split('-')) 144 # This check is needed because strftime is used when saving the date145 # value to the database, and strftime requires that the year be >=1900.146 if year < 1900:147 raise ValidationError, _('Year must be 1900 or later.')148 144 try: 149 145 date(year, month, day) … … 408 404 Usage: If you create an instance of the IsPowerOf validator: 409 405 v = IsAPowerOf(2) 410 406 411 407 The following calls will succeed: 412 v(4, None) 408 v(4, None) 413 409 v(8, None) 414 410 v(16, None) 415 411 416 412 But this call: 417 413 v(17, None)
