Ticket #1054: magic_removal-admin_list_repr_to_str.diff
File magic_removal-admin_list_repr_to_str.diff, 1.4 KB (added by , 19 years ago) |
---|
-
db/models/options.py
217 217 save_on_top=False, list_select_related=False): 218 218 self.fields = fields 219 219 self.js = js or [] 220 self.list_display = list_display or ['__ repr__']220 self.list_display = list_display or ['__str__'] 221 221 self.list_filter = list_filter or [] 222 222 self.date_hierarchy = date_hierarchy 223 223 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.