I would like admin to be able to edit a field that normal users would be unable to edit. Examples would be author or subscribers etc.
I tried this: Django admin: How to display a field that is marked as editable=False' in the model?
(the editable part given in an answer)
But the field still fails to appear on the admin page.
For reference here's some info:
#models.py
class MyModel(models.Model):
myfield = models.ManyToManyField(User, blank=True, editable=False)
#admin.py
class MyModelAdminForm(forms.ModelForm):
myfield = models.ManyToManyField(User, blank=True, editable=True)
class Meta(object):
model = MyModel
class MyModelAdmin(admin.ModelAdmin):
form = MyModelAdminForm
admin.site.register(MyModel, MyModelAdmin)
If I change the model to state editable=True then I see the field on my admin page. (as expected)
I'm using Django 1.3, Python 2.6