i have a model and is registered to the admin and i have used custom field to display in the list
class ReportsAdmin(admin.ModelAdmin):
def investment(self, inst):
return models.OrderDetail.objects.filter(user=inst.user).distinct().count()
list_display = ['investment']
search_fields = ['investment']
i want to search using the investment
field in django admin but always getting Cannot resolve keyword 'investment' into field.
choices are the Model fields.
is there any way by which i can search using the investment
field?