models.py
class Event(models.Model):
name = models.CharField(max_length=80, blank=False)
description = models.TextField(blank=True)
date = models.DateField(blank=True, null=True)
locked = models.BooleanField(default=False)
admin.py
class EventAdmin(admin.ModelAdmin):
list_display = ('name', 'date', 'locked')
search_fields = ['name']
ordering = ['date']
admin.site.register(Event, EventAdmin)
Is it possible to change "locked" by clicking on the icons in the admin list ? I've tried to add "list_editable = ['locked']", but then the red/green icons aren't visible.
Thanks for your help :)
Aucun commentaire:
Enregistrer un commentaire