Ticket #1054: magic_removal-admin_list_repr_to_str-2.diff
File magic_removal-admin_list_repr_to_str-2.diff, 1.4 KB (added by , 19 years ago) |
---|
-
db/models/options.py
209 209 save_on_top=False, list_select_related=False): 210 210 self.fields = fields 211 211 self.js = js or [] 212 self.list_display = list_display or ['__ repr__']212 self.list_display = list_display or ['__str__'] 213 213 self.list_filter = list_filter or [] 214 214 self.date_hierarchy = date_hierarchy 215 215 self.save_as, self.ordering = save_as, ordering -
contrib/admin/templatetags/admin_list.py
76 76 except models.FieldDoesNotExist: 77 77 # For non-field list_display values, check for the function 78 78 # attribute "short_description". If that doesn't exist, fall 79 # back to the method name. And __ repr__ is a special-case.80 if field_name == '__ repr__':79 # back to the method name. And __str__ is a special-case. 80 if field_name == '__str__': 81 81 header = lookup_opts.verbose_name 82 82 else: 83 83 func = getattr(cl.model, field_name) # Let AttributeErrors propogate.