newforms-admin: admin related field options

0 views
Skip to first unread message

David S.

unread,
Jul 15, 2007, 12:15:09 AM7/15/07
to Django users
I am using the newforms-admin branch, which is really great. But I
realized I still have admin specific fields options in my model, e.g.
blank, choices. I am wondering where they really belong.

Thanks,
David S.

Malcolm Tredinnick

unread,
Jul 15, 2007, 10:25:29 PM7/15/07
to django...@googlegroups.com

Those aren't admin-specific, since they are also tied in some ways to
the validation of the data. For example, a field with blank=False
(either explicitly given, or implied as the default) is not valid if you
don't put a value in there before trying to save it. That constraint is
true whether you put data into the field through the admin interface,
through a form or just poking into the attribute in your code somewhere.

Now, it happens that we don't exploit this directly too much at the
moment, since models don't have fully implemented validation. That's
something we're actively working on and will be done before 1.0,
certainly. Semantically, though, blank and choices are data constraints,
not purely admin features, so having them on the model fields is
correct.

The only purely presentation-related wart I can think of that is still
in field attributes is the odd radio_choice option.

Regards,
Malcolm

--
Tolkien is hobbit-forming.
http://www.pointy-stick.com/blog/

Reply all
Reply to author
Forward
0 new messages