Changeset 8053
- Timestamp:
- 07/22/08 03:23:20 (5 months ago)
- Files:
-
- django/trunk/django/db/models/sql/query.py (modified) (1 diff)
- django/trunk/tests/regressiontests/queries/models.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/db/models/sql/query.py
r8052 r8053 107 107 """ 108 108 obj_dict = self.__dict__.copy() 109 obj_dict['related_select_fields'] = [] 110 obj_dict['related_select_cols'] = [] 109 111 del obj_dict['connection'] 110 112 return obj_dict django/trunk/tests/regressiontests/queries/models.py
r8052 r8053 786 786 >>> out = pickle.dumps(Item.objects.all()) 787 787 788 We should also be able to pickle things that use select_related(). The only 789 tricky thing here is to ensure that we do the related selections properly after 790 unpickling. 791 >>> qs = Item.objects.select_related() 792 >>> query = qs.query.as_sql()[0] 793 >>> query2 = pickle.loads(pickle.dumps(qs.query)) 794 >>> query2.as_sql()[0] == query 795 True 796 788 797 Bug #7277 789 798 >>> ann1 = Annotation.objects.create(name='a1', tag=t1)
