Ticket #13138: 13138_test.diff

File 13138_test.diff, 625 bytes (added by Karen Tracey, 15 years ago)
  • tests/modeltests/model_forms/models.py

     
    242242>>> wf.is_valid()
    243243True
    244244
     245Overriding blank=False on model field with required=False on form field.
     246
     247>>> class WriterForm2(ModelForm):
     248...    name = forms.CharField(required=False)
     249...
     250...    class Meta:
     251...        model = Writer
     252
     253>>> wf2 = WriterForm2({})
     254>>> wf2.is_valid()
     255True
     256>>> wf2.errors
     257{}
     258
    245259Replacing a field.
    246260
    247261>>> class CategoryForm(ModelForm):
Back to Top