views:

180

answers:

2

I've created a model in one of my apps which works fine. However, I needed to add a new field. I did this, and used manage.py reset <appname> to drop the tables and add them again. This process went fine - the new field appears in the database. However, I can't get the field to show up in the admin interface, nor in the custom model form I've created. Because I haven't given it a default value (and don't want to, nor should I need to) I can't use either method to add a row into the database. Any ideas?

Model snippet:

use_balance = models.BooleanField()
A: 

By any chance, did you forget to update your ModelAdmin definitions?

lemonad
I'm not doing anything special there: admin.site.register(Account)
josno
Hmmm, this would have been my first guess, too. As soon as you start specifying fields in the ModelAdmin code you become responsible for keeping it up to date. This is why I prefer to keep the ModelAdmin directly below the models.Model, as opposed to the suggested separate admin.py file.
Peter Rowell
+1  A: 

Have you restarted your server?

Daniel Roseman
Many times! But for some reason, this time it worked. How odd... Thanks!
josno