Ticket #7289: modelform_attribute_removal.diff

File modelform_attribute_removal.diff, 690 bytes (added by Daniel Pope <dan@…>, 16 years ago)

Patch to allow get_declared_fields to remove fields from attrs

  • django/newforms/models.py

     
    224224            return super(ModelFormMetaclass, cls).__new__(cls, name, bases,
    225225                    attrs)
    226226
     227        declared_fields = get_declared_fields(bases, attrs, False)
    227228        new_class = type.__new__(cls, name, bases, attrs)
    228         declared_fields = get_declared_fields(bases, attrs, False)
    229229        opts = new_class._meta = ModelFormOptions(getattr(new_class, 'Meta', None))
    230230        if opts.model:
    231231            # If a model is defined, extract form fields from it.
Back to Top