On Dec 20, 2:58 pm, mike <[EMAIL PROTECTED]> wrote:
> anyone know how to auto assign a variable to my form field?
>
> IssueEntryForm.base_fields['customer'].widget = widgets.HiddenInput()
> IssueEntryForm.base_fields['customer'].widget = HELP

I'm not sure I understand the question; what exactly do you mean by
"auto assign a variable"?

If you're looking for a way to set the value of a field in an un-bound
form, just do the usual:
  IssueEntryForm.initial['customer'] = "Blah, Inc."

Since there was no visibly editable field, the *bound* form you create
after the HttpRequest.POST submission comes back will have an
unmolested "Blah, Inc." value in
IssueEntryForm.cleaned_data['customer']


(If that's not what you were after, you may want to elaborate.  Your
example code looks like you want to dynamically determine what the
widget for the field will be, but that doesn't match the question you
asked...)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to