django-admin model validation mistake
|Reported by:||bluejeansummer||Owned by:||nobody|
|Component:||Core (Management commands)||Version:||1.0|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
In one of my models I have a field that would be logically be called class, but because it is a reserved word, I renamed the field to class_ (notice the trailing underscore). I also set the db_column kwarg to class. I then run ./manage.py sql tracker, and get this error:
Error: One or more models did not validate: tracker.assignment: "class_": Field names cannot end with underscores, because this would lead to ambiguous queryset filters.
However, when I set the model name to klass, the output shows it recognizes the db_column setting. It seems that the validator should check for that setting before emitting an error. Is there a work around I should use for now? I'd rather not spell "class" with a "k".
- Ubuntu 9.04
- Django 1.0.2