Ticket #8213: select_related_list.patch
File select_related_list.patch, 1.4 KB (added by , 16 years ago) |
---|
-
django/contrib/admin/validation.py
93 93 continue 94 94 _check_field_existsw('ordering[%d]' % idx, field) 95 95 96 # list_select_related = False97 96 # save_as = False 98 97 # save_on_top = False 99 for attr in (' list_select_related', 'save_as', 'save_on_top'):98 for attr in ('save_as', 'save_on_top'): 100 99 if not isinstance(getattr(cls, attr), bool): 101 100 raise ImproperlyConfigured("`%s.%s` should be a boolean." 102 101 % (cls.__name__, attr)) -
django/contrib/admin/views/main.py
185 185 # Use select_related() if one of the list_display options is a field 186 186 # with a relationship. 187 187 if self.list_select_related: 188 qs = qs.select_related() 188 if isinstance(self.list_select_related, (list, tuple)): 189 related_tables = self.list_select_related 190 else: 191 related_tables = [] 192 qs = qs.select_related(*related_tables) 189 193 else: 190 194 for field_name in self.list_display: 191 195 try: