My production code is using Python 2.3 and Django 0.96. Yes, I know.
Next release picks up Django 1.0.2 and Python 2.4. Yay.
In the meantime, I have a custom model manager with a method that
executes custom sql. Works fine with PostgreSQL, but when I'm
developing with SQLite I get a traceback.
Traceback (most recent call last):
File "<console>", line 1, in ?
File "/home/msoulier/work/mitel-msl-tug/root/etc/e-smith/web/django/
teleworker/clients/models.py", line 43, in disconnectAll
cursor.execute("""
File "/home/msoulier/work/bin/msl8/lib/python2.3/site-packages/
django/db/backends/util.py", line 12, in execute
return self.cursor.execute(sql, params)
File "/home/msoulier/work/bin/msl8/lib/python2.3/site-packages/
django/db/backends/sqlite3/base.py", line 93, in execute
return Database.Cursor.execute(self, query, params)
Warning: You can only execute one statement at a time.
This is the method in question.
def disconnectAll(self, instanceid, nonlocal=False):
instanceid = int(instanceid)
cursor = connection.cursor()
log.debug("ClientManager.disconnectAll: disconnecting non-
local clients")
instance = TugInstance.objects.get(id=instanceid)
local_tugid = instance.tugid
log.debug("local tugid is %s" % local_tugid)
cursor.execute("""
BEGIN;
UPDATE clients
SET connected = 'false'
WHERE connected = 'true'
AND tugid <> %s;
COMMIT;""", [local_tugid])
Am I doing something wrong here?
Thanks,
Mike
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---