readonly_fields ommited from admin

33 views
Skip to first unread message

Lukas Lehner

unread,
Mar 1, 2012, 2:21:16 PM3/1/12
to eav-d...@googlegroups.com
Hi all,

When field(s) are marked as readonly in admin, they stop being shown in admin.

Using the grocery_shop example:

admin.py
class FruitAdmin(BaseEntityAdmin):
    form = FruitForm
    readonly_fields = ("title_t",)

models.py
class Fruit(BaseEntity):
    title = models.CharField(max_length=50)
    title_t = models.CharField(max_length=50)

    @classmethod
    def get_schemata_for_model(self):
        return Schema.objects.all()

    def __unicode__(self):
        return self.title

The field "title_t" disappears from admin. When commenting out readonly_fields = ("title_t",) the field is back.
Is it a bug or am I missing something?

Thank you in advance
Lukas
Reply all
Reply to author
Forward
0 new messages