Hi,
I'm trying to write a batch insert view that gets data from a

object-template, does some modification to the template (increment some
counters) and displays a form for each new object to be created. (I'm
adding Media files which are selected in a previous view, that why I
iterate over files)
The view looks like this:

manipulator = Media.AddManipulator()

form_list=list()
errors = {}
for file in files:
            #assign new value to template object
            template.media_signature =
incSignature(template.media_signature)
            new_data = template.__dict__
            new_data["filename"] = file
            form = forms.FormWrapper(manipulator, new_data, errors)
            form_list.append(form)

When the loop finishes I end up with a list of identical formWrapper
Objects, which is not what I expected.
If i put in some debugging code to display the current form it shows
that the form  object is created correctly but also changes all the
other form entries already on the list (which seemingly all point to the
same instance of the form object)
Does this have something to do with lazy evaluation and if yes, is there
any way to create the form object right away?
This is probably more a python question than a django-related one....

Any help appreciated,

Sean




--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to