0

In my model admin, I would like to modify get_list_display.

class PhotoAdmin(admin.ModelAdmin):

      ordering = ['-date']

      def get_list_display(self, request):
           b[0] #<-just to crash it to see if it is getting called

However, it seems to not ever be getting called. What am I doing wrong?

Alexis
  • 23,545
  • 19
  • 104
  • 143
  • 1
    Haven't you modified `changelist_view` too? Also, better use `raise Exception` for hand brake – ilvar Apr 29 '12 at 05:27
  • 3
    What version of Django are you using? `get_list_display` is only available since 1.4 – dan-klasson Apr 29 '12 at 06:52
  • yup. I was using 1.3. I have upgraded to 1.4 and it is being called now! – Alexis Apr 29 '12 at 08:25
  • @dan-klasson you should put it as an answer so I can put it as answered :) – Alexis Aug 10 '12 at 18:51
  • Alexis K: Yes you're right. I am a bit careful in general giving one liners as answers as technically it is against the rules. And moderators can be pretty anal about that. – dan-klasson Aug 12 '12 at 22:03

1 Answers1

1

get_list_display is only available since 1.4, maybe you are using an older version?

dan-klasson
  • 13,734
  • 14
  • 63
  • 101