I've added a "validate" action to django-admin.py: "django-admin.py validate".

It validates all installed models, according to your INSTALLED_APPS
setting. Currently, it only handles common errors, but we'll be
improving it each time we come across a potential model syntax
problem.

Also, the development server ("django-admin.py runserver")
automatically runs validation each time it starts. Validation errors
don't stop the server from running -- they're just printed to the
terminal.

Specifically, here's what this validates (for now):

* CharFields should have a maxlength attribute.
* The "admin" attribute, if set, should be an instance of meta.Admin.
* Field names in the "ordering" attribute should point to fields that
actually exist.
* Objects that are related inline (edit_inline) should have at least
one field with core=True.

Please let us know (via this mailing list or a ticket in our ticket
system -- whichever's most convenient) If you can think of anything
this should validate. There's *tons* of stuff that it should validate
that it doesn't yet do. I merely wanted to get something out the door
to handle common problems.

Adrian

Reply via email to