I have the following model administrator. I display the custom field as a list.
class CustomerAdmin(admin.ModelAdmin): list_display = ('first_name', 'last_name', 'email', 'state') search_fields = ('first_name', 'last_name', 'email') list_filter = ('state',) def state(self, obj): address = Address.objects.filter(owner=obj.id) if address: return address.state return None
I tried above, but it gives the error “list_filter [0]” refers to a “state” that does not apply to the field. Therefore, I want the movie records to be recorded by state. So, how can I do this in django 1.5 ?
Vijay source share