Try:

transaction.commit_unless_managed()

I originally found it in the django scripts code (
http://code.djangoproject.com/browser/django/trunk/django/bin/daily_cleanup.py),
and it forces a commit when you're not under transaction management. I never
found any references to it in the documentation. We had the same issue when
setting up some test data and some crazy views.

-joe

On 3/14/07, omat * gezgin.com <[EMAIL PROTECTED]> wrote:
>
>
> I am trying to run a custom insert sql on postgres db, but the command
> does not seem to commit. I searched through this list and saw that
> there are unresolved discussions like:
>
> http://groups.google.com/group/django-users/browse_thread/thread/65adbdfa9bc92a7b/
>
> Following the examples in the documentation, I build my code like:
>
> from django.db import connection
> cursor = connection.cursor()
> cursor.execute(insert_query)
>
> but this does not do anything.
>
> Any ideas?
>
>
> Thanks,
> oMat
>
>
> >
>

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