Ticket #12628: generic_inlines_save.diff

File generic_inlines_save.diff, 685 bytes (added by Jiri Suchan, 15 years ago)

patch for correct readonly_fields save

  • django/contrib/contenttypes/generic.py

     
    387387            fields = flatten_fieldsets(self.declared_fieldsets)
    388388        else:
    389389            fields = None
     390
     391        readonly_fields = getattr(self, 'readonly_fields', None)
     392        if readonly_fields:
     393            if not self.exclude:
     394                self.exclude = []
     395
     396            self.exclude.extend(readonly_fields)
     397
    390398        defaults = {
    391399            "ct_field": self.ct_field,
    392400            "fk_field": self.ct_fk_field,
Back to Top