Saturday, October 25, 2014

Integer Form with Select Widget?

Hi all,

I want to get an Integer value from the user through a forms.Form. I have three unique requirements for it.
  1. The corresponding Widget is Select or SelectMultiple (either one)
  2. The 'choices' field is dynamic, not static or hard-coded -they are adjusted upon each display of the Form based on program logic.
  3. I want the max_value and min_value of IntegerField to also be dynamic - also adjusted based on program logic.

What I have thus far is this:

class deleteUserForm(forms.Form):
   delUserId = forms.CharField(label='delUserId', widget=forms.Select)

How would this work?

Thanks
- Farhan

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3c12eccc-a3b8-4108-83af-8288a2ccd998%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment