Ticket #10742: 10742_three-valued-list_select_related.diff
File 10742_three-valued-list_select_related.diff, 1.6 KB (added by , 16 years ago) |
---|
-
django/contrib/admin/validation.py
135 135 "callable nor a method on %s" % (cls.__name__, idx, cls.__name__)) 136 136 137 137 138 # list_select_related = False139 138 # save_as = False 140 139 # save_on_top = False 141 for attr in (' list_select_related', 'save_as', 'save_on_top'):140 for attr in ('save_as', 'save_on_top'): 142 141 if not isinstance(getattr(cls, attr), bool): 143 142 raise ImproperlyConfigured("'%s.%s' should be a boolean." 144 143 % (cls.__name__, attr)) 145 144 145 # list_select_related = True, False, None 146 if (not isinstance(cls.list_select_related, bool) and 147 cls.list_select_related is not None): 148 raise ImproperlyConfigured("'%s.list_select_related' should " 149 "be a boolean or None." % cls.__name__) 146 150 151 147 152 # inlines = [] 148 153 if hasattr(cls, 'inlines'): 149 154 check_isseq(cls, 'inlines', cls.inlines) -
django/contrib/admin/views/main.py
200 200 # with a relationship. 201 201 if self.list_select_related: 202 202 qs = qs.select_related() 203 elif self.list_select_related is None: 204 pass 203 205 else: 204 206 for field_name in self.list_display: 205 207 try: