Closed dack closed 7 years ago
Weird i'll look into it asap !
On Aug 16, 2016 20:51, "Kim Tran" notifications@github.com wrote:
I'm using a database model not created by me so I'm hesitant to change it. I tried with a table where the tablename is not case-sensitive and it works fine.
Modifying from the example:
view.py columns = [] columns.append(ColumnDT('id')) query = db.session.query(Test).filter(Test.id < 100) rowTable = DataTables(request.args, Test, query, columns)
model.py class Test(Base) tablename= 'Test' id = Column(Integer, primary_key=True)
columns
I get this error: ProgrammingError: (psycopg2.ProgrammingError) missing FROM-clause entry for table "test" LINE 3: WHERE "Test".id < 100 ORDER BY Test.id ASC
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Pegase745/sqlalchemy-datatables/issues/59, or mute the thread https://github.com/notifications/unsubscribe-auth/ABmd0atZENhokgneYP9gyEaiDfsbylYFks5qgga8gaJpZM4Jlu0d .
Skimming through the code, I spotted the problem.
https://github.com/Pegase745/sqlalchemy-datatables/blob/master/datatables/__init__.py#L441
Should be changed to:
sort_name = '"%s".%s' % (tablename, sort_name)
would you like to propose a pull request ?
On Wed, Aug 17, 2016 at 1:19 AM, Kim Tran notifications@github.com wrote:
Skimming through the code, I spotted the problem.
https://github.com/Pegase745/sqlalchemy-datatables/blob/ master/datatables/init.py#L441
Should be changed to: sort_name = '"%s".%s' % (tablename, sort_name)
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Pegase745/sqlalchemy-datatables/issues/59#issuecomment-240269047, or mute the thread https://github.com/notifications/unsubscribe-auth/ABmd0c1vJcsPBQoebRyABAGn4LA0dhzNks5qgkV-gaJpZM4Jlu0d .
@Pegase745, think this can be closed as it should be solved now
I'm using a database model not created by me so I'm hesitant to change it. I tried with a table where the tablename is not case-sensitive and it works fine.
Modifying from the example:
view.py
columns = []
columns.append(ColumnDT('id'))
query = db.session.query(Test).filter(Test.id < 100)
rowTable = DataTables(request.args, Test, query, columns)
model.py
class Test(Base)
__tablename__= 'Test'
id = Column(Integer, primary_key=True)
# columns
I get this error: