Re: passing foreign key via post

2007-06-09 Thread Nimrod A. Abing
On 6/10/07, Car <[EMAIL PROTECTED]> wrote: > > > > Why not create it there? That is the moment you have all the data you > > need and all you're doing is calling a constructor. The code you've > > written there is a pretty normal pattern for taking form information and > > putting it into a model.

Re: passing foreign key via post

2007-06-09 Thread Car
> Why not create it there? That is the moment you have all the data you > need and all you're doing is calling a constructor. The code you've > written there is a pretty normal pattern for taking form information and > putting it into a model. Because it forces me to make different view for each

Re: passing foreign key via post

2007-06-09 Thread Malcolm Tredinnick
On Sat, 2007-06-09 at 14:38 +, Car wrote: > Thanks for your answer > > Now I have following snippet: > http://dpaste.com/11938/ > > But, is at a good practice to create Model objects in a view ? Where > code of that kind of operations should be placed? Why not create it there? That is the m

Re: passing foreign key via post

2007-06-09 Thread Car
Thanks for your answer Now I have following snippet: http://dpaste.com/11938/ But, is at a good practice to create Model objects in a view ? Where code of that kind of operations should be placed? --~--~-~--~~~---~--~~ You received this message because you are s

Re: passing foreign key via post

2007-06-09 Thread Malcolm Tredinnick
On Sat, 2007-06-09 at 13:39 +, Car wrote: > Hi, > > I have 1:n Relation, model A which hase foreign key ("type") to B. I'm > passing foreign key to a view via post using the ModelChoiceField. > Problem is its converted into string, so when I try to create in a > view a 'A' record > > like >

passing foreign key via post

2007-06-09 Thread Car
Hi, I have 1:n Relation, model A which hase foreign key ("type") to B. I'm passing foreign key to a view via post using the ModelChoiceField. Problem is its converted into string, so when I try to create in a view a 'A' record like # data = POST dictionary A( address =