Ticket #1683: base.py.diff

File base.py.diff, 801 bytes (added by iki, 18 years ago)
  • django/db/models/base.py

     
    105105                else:
    106106                    val = kwargs.pop(f.attname, f.get_default())
    107107                    setattr(self, f.attname, val)
     108            for prop in kwargs.keys():   # keys has to be a copy
     109                try:
     110                    if isinstance(getattr(self.__class__, prop), property):
     111                        setattr(self, prop, kwargs.pop(prop))
     112                except AttributeError: pass
    108113            if kwargs:
    109114                raise TypeError, "'%s' is an invalid keyword argument for this function" % kwargs.keys()[0]
    110115        for i, arg in enumerate(args):
Back to Top