This is kind of a corner case, but I need to update many of the
records in a table on a regular basis. I decided to do this with a
manage command. (This is Django v1.0, btw.) I used something like the
following:
cursor = connection.cursor()
cursor.executemany("UPDATE rf_wxstation SET cache_time = %s, wx_time =
%s, afc = %s WHERE location_id = %s", updateValues)
The problem is the update was never showing up in the database. No
errors during execution.
I tried using transaction.commit(), but that raised an error until I
added:
@transaction.commit_manually
in front of the function. Then it all started working. Not sure why I
have to explicitly manually handle commits, but I'm just glad it
started working. Hope that helps somebody else.
Dave
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---