On Oct 29, 10:26 am, limas <[EMAIL PROTECTED]> wrote:
> hello
>
> i am new in django.
> i want to insert values into two tables from a single form.
> i think ModelForm didnot work for this.
> Can i use raw sql query to insert into tables. i am using mysql and
> latest subversion of django.
>
> please give me some sugessions.

Why do you want to use raw SQL? What's wrong with using the normal
Django ORM?
eg
if form.is_valid():
    obj1 = Obj1.objects.create(elem1=cleaned_data['elem1'],
elem2=cleaned_data['elem2'])
    obj2 = Obj2.objects.create(elem3=cleaned_data['elem3'],
elem4=cleaned_data['elem4'])
etc.
--
DR.
--~--~---------~--~----~------------~-------~--~----~
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