Hi, I have the following problem:

I have a hierarchy of models, each one with a FK pointing to its "father"
class. Something like:

class Model1(models):
   data
   ...

class Model2(models):
   data
   ...
   father = models.ForeignKey(Model1)

class Model3(models):
   data
   ...
   father = models.ForeignKey(Model2)

and so on...

I want to load a file with object data, in the file we have all kinds of
objects (Model1s, Model2s, etc). When I load it, I want to display all the
objects into a form, so the user can modified them before commiting them.
How can I correctly display in the form the "father" property if the father
doesn't exist in the db?, it only exist like an unsaved model. I tried with
something like

objModel1 = Model1(data = ...)

Model2Form( instance = Model2(data = ... , father = objModel1.id)

But the form's select-box for the "father" appears empty.

Thanks

-- 
George Laskowsky Ziguilinsky

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

Reply via email to