On 16/04/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
[...]
> After they are displayed...they can be nuked...but the guy working on
> this piece told me he couldn't get the temp table to stick around long
> enough with the django connection to be able to get the results back
> because I believe he runs several queries...then compiles them all
> into one be result ( not sure on this, as he is writing it, and I
> haven't reviewed his code as of yet ) ... so he started hardcoding
> the db un/password in there and creating a mysqldb connection...which
> I didn't agree with...so thought I'd ask about it on here.
I'm not sure if this has anything to do with your problem but I found
I needed to place a call to transaction.commit_unless_managed() at the
end of any custom code that made changes to the database otherwise
they did seem to "get lost".
The general layout of the code was:
from django.db import connection
from django.db import transaction
def foo(self,someargs):
cursor = connection.cursor()
cursor.execute("""
YOUR CUSTOM SQL HERE
""")
transaction.commit_unless_managed()
--
Phil
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---