Changeset 6755
- Timestamp:
- 11/29/07 16:07:58 (7 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/queryset-refactor/django/db/models/sql/query.py
r6730 r6755 635 635 return alias 636 636 637 def fill_related_selections(self, opts=None, root_alias=None, cur_depth= 0,637 def fill_related_selections(self, opts=None, root_alias=None, cur_depth=1, 638 638 used=None): 639 639 """ 640 Fill in the information needed for a select_related query. 640 Fill in the information needed for a select_related query. The current 641 "depth" is measured as the number of connections away from the root 642 model (cur_depth == 1 means we are looking at models with direct 643 connections to the root model). 641 644 """ 642 645 if self.max_depth and cur_depth > self.max_depth: django/branches/queryset-refactor/tests/modeltests/select_related/models.py
r6522 r6755 148 148 5 149 149 150 >>> s = Species.objects.all().select_related(depth=1).extra(select={'a': 'select_related_species.id + 10'})[0] 151 >>> s.id + 10 == s.a 152 True 153 150 154 # Reset DEBUG to where we found it. 151 155 >>> settings.DEBUG = False
