Ticket #3581: related-onetoone-kwargs-to-defaults.patch

File related-onetoone-kwargs-to-defaults.patch, 658 bytes (added by Andrew Sutherland <andrew@…>, 18 years ago)

trivial patch to change kwargs to defaults in OneToOneField.formfield

  • django/db/models/fields/related.py

     
    621621    def formfield(self, **kwargs):
    622622        defaults = {'queryset': self.rel.to._default_manager.all(), 'required': not self.blank, 'label': capfirst(self.verbose_name), 'help_text': self.help_text}
    623623        defaults.update(kwargs)
    624         return forms.ModelChoiceField(**kwargs)
     624        return forms.ModelChoiceField(**defaults)
    625625
    626626class ManyToManyField(RelatedField, Field):
    627627    def __init__(self, to, **kwargs):
Back to Top