Kenneth McDonald wrote:
For example, I want foreign keys to show up as popup lists.Also, I'd like to get the date widget in a user form the same as it is in the Admin interface. These are broad questions, so I guess the real question is, "Where do I read how to do this". Haven't found it in the book yet.
Hello,The way to easily tie a model to a form is using modelforms [0]. If you need to override a field type, or a widget type, then you have to define it manually. If you need a popup box-- you'd specify the field with the explicit widget=whatever argument.
The admin interface uses oldforms. It'd be easier to use the widgets for the admin interface on the newforms-admin [1] branch, though I haven't taken the time to look at it at all.
There are plenty of bits of useful information that live in the official documentation, and not in the book. The same goes for the wiki. Sometimes digging will reveal your answer, and sometimes you just have to post to this group. :)
Hopefully this gets you started in the right direction! Jeff Anderson[0] http://www.djangoproject.com/documentation/modelforms/#overriding-the-default-field-types
[1] http://code.djangoproject.com/wiki/NewformsAdminBranch
signature.asc
Description: OpenPGP digital signature

