Changes between Initial Version and Version 1 of Ticket #13091, comment 22
- Timestamp:
- Mar 25, 2014, 3:44:40 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #13091, comment 22
initial v1 2 2 {{{ 3 3 #!python 4 if form.is_valid(strict_u inique_checks=True):4 if form.is_valid(strict_unique_checks=True): 5 5 obj = form.save() 6 6 }}} 7 The "''strict_uinique_checks''" kwarg will force ''ModelForm'' to perform u inique_together checks using existing instance values if some.fields are omitted in form.7 The "''strict_uinique_checks''" kwarg will force ''ModelForm'' to perform unique_together checks using existing instance values if some.fields are omitted in form. 8 8 9 9 Another option is to add new Meta option like this: … … 12 12 class MyForm(ModelForm): 13 13 class Meta: 14 strict_u inique_checks = True14 strict_unique_checks = True 15 15 }}} 16 Such form will then always fallback to using existing instance values for u inique_together checks when performig validation.16 Such form will then always fallback to using existing instance values for unique_together checks when performig validation.