On 12/4/05, Pedro Furtado <[EMAIL PROTECTED]> wrote:
>
> > else:
> > # No POST, so we want a brand new form without any data or
> > errors.
> > errors = new_data = {}
> >
>
> Copy from the admin view:
>
> else:
> # Add default data.
> new_data = manipulator.
Maybe this is relevant for those interested in the thread:
manipulator.flatten_data() is available only on recent SVN version of
Django. It is unfortunately NOT available in Django_0.90.
Cheers,
Emanuele
Thanks a lot! It works perfectly. I think this should go in 'Forms and
Manipulators' docs as soon as possible!
Emanuele
else:# No POST, so we want a brand new form without any data orerrors.
errors = new_data = {}Copy from the admin view: else: # Add default data. new_data = manipulator.flatten_data() # Override the defaults with
request.GET, if it exists. new_data
Dear djangonauts,
I'm playing with formfields and manipulators: wonderful! But I'm
missing one thing: following docs on Forms and Manipulators I'm not
able to put model's default values to fill forms in the proper way.
Consider the last example of "Using the AddManipulator" subsection:
--
5 matches
Mail list logo