Additional Fields Problem

Report a typo

Assume that you have the LikeAdmin admin class:

class LikeAdmin(admin.ModelAdmin):
    fields = ('user', 'vote', 'content', 'is_up')
    readonly_fields = ('user', 'vote')

    def is_up(self, obj):
        return obj.vote == 1

What mistake is present in this implementation?

Select one option from the list

Create a free account to access the full topic