Changeset 7742
- Timestamp:
- 06/25/08 21:20:45 (5 months ago)
- Files:
-
- django/trunk/django/db/models/query.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/db/models/query.py
r7739 r7742 37 37 Adds an item. 38 38 model is the class of the object being added, 39 pk is the primary key, obj is the object itself, 39 pk is the primary key, obj is the object itself, 40 40 parent_model is the model of the parent object 41 41 that this object was reached through, nullable should … … 78 78 def ordered_keys(self): 79 79 """ 80 Returns the models in the order that they should be 80 Returns the models in the order that they should be 81 81 dealth with i.e. models with no dependencies first. 82 82 """ … … 93 93 if not found: 94 94 raise CyclicDependency("There is a cyclic dependency of items to be processed.") 95 95 96 96 return dealt_with.keys() 97 97 … … 584 584 def _merge_sanity_check(self, other): 585 585 """ 586 Checks that we are merging two comparable queryset classes. 587 """588 i f self.__class__ is not other.__class__:589 raise TypeError("Cannot merge querysets of different types ('%s' and '%s'."590 % (self.__class__.__name__, other.__class__.__name__))586 Checks that we are merging two comparable queryset classes. By default 587 this does nothing, but see the ValuesQuerySet for an example of where 588 it's useful. 589 """ 590 pass 591 591 592 592 class ValuesQuerySet(QuerySet): … … 600 600 601 601 def iterator(self): 602 if (not self.extra_names and 602 if (not self.extra_names and 603 603 len(self.field_names) != len(self.model._meta.fields)): 604 604 self.query.trim_extra_select(self.extra_names) … … 774 774 # if there is a cyclic dependency, we cannot in general delete 775 775 # the objects. However, if an appropriate transaction is set 776 # up, or if the database is lax enough, it will succeed. 776 # up, or if the database is lax enough, it will succeed. 777 777 # So for now, we go ahead and try anway. 778 778 ordered_classes = seen_objs.unordered_keys()
