On 8/29/05, asrenzo <[EMAIL PROTECTED]> wrote:
> Does anybody know how to execute an hand made sql query ? I've looked
> at django.core.db but I didn't find anything. Am I blind ??

Hey Laurent,

Check out this model example:

http://www.djangoproject.com/documentation/models/custom_methods/

You can execute custom SQL at any point by doing the following:

>>> from django.core.db import db
>>> cursor = db.cursor()
>>> cursor.execute("SELECT foo FROM bar WHERE id = %s", [3])
>>> row = cursor.fetchone()
>>> print row

Adrian
-- 
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org

Reply via email to