Ticket #5309: query.py.diff

File query.py.diff, 1.3 KB (added by David Cramer <dcramer@…>, 17 years ago)
  • django/django/db/models/query.py

     
    262262        if len(obj_list) < 1:
    263263            raise self.model.DoesNotExist, "%s matching query does not exist." % self.model._meta.object_name
    264264        assert len(obj_list) == 1, "get() returned more than one %s -- it returned %s! Lookup parameters were %s" % (self.model._meta.object_name, len(obj_list), kwargs)
    265         obj = obj_list[0]
    266         obj.is_stored = True
    267         return obj
     265        return obj_list[0]
    268266
    269267    def create(self, **kwargs):
    270268        """
     
    272270        and returning the created object.
    273271        """
    274272        obj = self.model(**kwargs)
    275         obj.is_stored = False
    276273        obj.save()
    277274        return obj
    278275
     
    290287            params = dict([(k, v) for k, v in kwargs.items() if '__' not in k])
    291288            params.update(defaults)
    292289            obj = self.model(**params)
    293             obj.is_stored = False
    294290            obj.save()
    295291            return obj, True
    296292
     
    11821178                    setattr(instance, field.attname, None)
    11831179
    11841180            setattr(instance, cls._meta.pk.attname, None)
    1185             instance.is_stored = False
    11861181            dispatcher.send(signal=signals.post_delete, sender=cls, instance=instance)
    11871182
    11881183    transaction.commit_unless_managed()
Back to Top