Ticket #15146: patch.diff
File patch.diff, 926 bytes (added by , 14 years ago) |
---|
-
django/db/models/fields/related.py
419 419 420 420 class RelatedManager(superclass): 421 421 def get_query_set(self): 422 db = self._db or router.db_for_read(rel_model, instance=instance) 423 return superclass.get_query_set(self).using(db).filter(**(self.core_filters)) 422 if instance.pk is None: 423 query = superclass.get_empty_query_set(self) 424 else: 425 db = self._db or router.db_for_read(rel_model, instance=instance) 426 query = superclass.get_query_set(self).using(db).filter(**(self.core_filters)) 427 return query 424 428 425 429 def add(self, *objs): 426 430 for obj in objs: