Ticket #6755: django-admin-nodup_new.patch

File django-admin-nodup_new.patch, 883 bytes (added by Michael Placentra II <someone@…>, 16 years ago)

sloonz's, compatible with newer revisions (currently 7634)

  • django/db/models/base.py

     
    296296        # attributes we have been given to the class we have been given.
    297297        if not raw:
    298298            for parent, field in meta.parents.items():
     299                # At this point, parent's primary key field may be unknown
     300                # (for example, from administration form which doesn't fill
     301                # this field). If so, fill it.
     302                if getattr(self, parent._meta.pk.attname) is None and getattr(self, field.attname) is not None:
     303                    setattr(self, parent._meta.pk.attname, getattr(self, field.attname))
     304
    299305                self.save_base(raw, parent)
    300306                setattr(self, field.attname, self._get_pk_val(parent._meta))
    301307
Back to Top