On 30-Jan-07, at 6:26 PM, Sebastien Armand [Pink] wrote:

> Example with a school and a student class. Each student has a  
> foreign key linking to the school where he studies. Through a form,  
> I get the informations to create the student including the school's  
> id. When I want to create and save the student, am I obliged to  
> first hit the database to get the school object and then pass it to  
> student(school=school_object) or is there a way to just use the ID  
> as it is?

in the database django stores this as school_id - and when you save  
you can use that by specificaly setting school_id on the save instead  
of school where django will automatically get and insert the id

-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/



--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to