I like to set the value/s of a field in a form before displaying it.
A rather silly example (to illustrate the principle) :
class King(models.Model):
name = models.CharField(max_length=250, blank=False)
class KingModelForm ( forms.ModelForm ):
first = forms.CharField( label = 'Foo', required=True)
last = forms.CharField( label = 'Foo', required=True)
I need to split the name field up and allocate it to first & last
before displaying the form for editing.
(When saving the form, these values will be combined, but that
part can be done via the save_form() method.)
Any help with this is appreciated.
Thanks
Derek
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
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.