Re: database library erroneously adding quotes in custom sql

2007-12-27 Thread makebelieve
I figured out a way around it: def benefits_sql(schema): from django.db import connection cursor = connection.cursor() sql = "select * from %s.benefits" %(schema) cursor.execute(sql, []) benefits = cursor.fetchall() return benefits

database library erroneously adding quotes in custom sql

2007-12-27 Thread makebelieve
I'm writing a custom sql method to grab some data from schemas outside of public, but the database library is adding quotes to the schema names which causes an sql error. Any ideas on a way around this? def benefits_sql(schema): from django.db import connection cursor =