The admin interface and newforms have a brilliant helper in the ability to define options. You can use this code:
APPROVAL_CHOICES = ( ('yes', 'Yes'), ('no', 'No'), ('cancelled', 'Cancelled'), ) client_approved = models.CharField(choices=APPROVAL_CHOICES)
to create a drop-down list on the form and force the user to select one of these options.
I'm just wondering if there is a way to define a set of options where several can be selected using checkboxes? (It would also be nice to be able to say that the user can select the maximum number of them.) It seems that this is a function that is probably implemented, I just can not find it in the documentation.
python django
sesh Sep 29 '08 at 6:53 2008-09-29 06:53
source share