Changeset 8872
- Timestamp:
- 09/02/08 14:33:56 (3 months ago)
- Files:
-
- django/trunk/django/forms/models.py (modified) (2 diffs)
- django/trunk/docs/topics/forms/modelforms.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/forms/models.py
r8854 r8872 231 231 # This is an extra field that's not on the ModelForm, ignore it 232 232 continue 233 # MySQL can't handle ... WHERE pk IS NULL, so make sure we don't233 # MySQL can't handle ... WHERE pk IS NULL, so make sure we 234 234 # don't generate queries of that form. 235 235 is_null_pk = f.primary_key and self.cleaned_data[name] is None … … 255 255 qs = qs.exclude(pk=self.instance.pk) 256 256 257 # This cute trick with extra/values is the most effici ant way to257 # This cute trick with extra/values is the most efficient way to 258 258 # tell if a particular query returns any results. 259 259 if qs.extra(select={'a': 1}).values('a').order_by(): django/trunk/docs/topics/forms/modelforms.txt
r8864 r8872 338 338 ----------------------------- 339 339 340 You can over ide the ``clean()`` method on a model form to provide additional341 validation in the same way you can on a normal form. However, by default the340 You can override the ``clean()`` method on a model form to provide additional 341 validation in the same way you can on a normal form. However, by default the 342 342 ``clean()`` method validates the uniqueness of fields that are marked as unique 343 o n the model, and those marked as unque_together, if you would like to overide344 the ``clean()`` method and maintain the default validation you must call the343 or unique_together on the model. Therefore, if you would like to override 344 the ``clean()`` method and maintain the default validation, you must call the 345 345 parent class's ``clean()`` method. 346 346
