Q:

Django: Models' "editable=False" causes "Unknown field error"

I'm writing a Django model which is called "Entry" and has an attribute called "name" which I don't wish the user to be able to change.
According to the docs I would use editable and set it to False: https://docs.djangoproject.com/en/1.9/ref/models/fields/#editable
With this included my code for that model looks like:
from django.db import models

class Entry(models.Model):
    name=models.CharField(max_length=50, editable=False)

This however gives me the error:

django.core.exceptions.FieldError: Unknown field(s) (name) specified for Entry

When I remove editable it works fine though, have I missed something, and how do you disable an attribute being edited? 
I'm using Django 1.9 with Python2.7
Thanks

A:

I managed to fix it not in the model at all, but in the admin.py file
My class EntryAdmin now looks like this:
class EntryAdmin(admin.ModelAdmin):
    exclude = ("name",)

That stops the name appearing in the creation and edit page.  The comma after "name" is required to tell python it's a tuple

