Skip to main content
Topic: PyRad sqlalchemy.exc.CompileError (Read 1974 times) previous topic - next topic

PyRad sqlalchemy.exc.CompileError

Hi All,
I think there is an issue in the default setup for SQLAlchemy in PyRad.
The details (shorter) are:
sqlalchemy.exc.CompileError: Can't resolve label reference for ORDER BY / GROUP BY. Textual SQL expression 'cty.cty_id DESC' should be explicitly declared as text('cty.cty_id DESC')
In the table file (cty.py in this case) I added one line and changed another to fix it:
New: from sqlalchemy import text
Modified line in the "def index" function...
was: order = 'cty.cty_id DESC'
fix: order = text('cty.cty_id DESC')

I know that if I regenerate the file this will get overwritten and I know that I can opt not to update this file in the rebuilds, but that means that now I must manually touch this and any other files I make manual changes to.
Is there a setting in the UI will that will do this for me?
PyRad = 1.4
Python = 3.7.2
sqlalchemy = 1.3.3
psycopg2 = 2.8.2

Thanks.


Re: PyRad sqlalchemy.exc.CompileError

Reply #2
Here you go:

Re: PyRad sqlalchemy.exc.CompileError

Reply #3
The import

Re: PyRad sqlalchemy.exc.CompileError

Reply #4
@Craigbert‍ I consulted the devs concerning the error and they said it is advisable not to use the PyRad in production, as it has not gotten to a stable stage.

Re: PyRad sqlalchemy.exc.CompileError

Reply #5
Hi @willvin
Thanks for the reply which raises a few questions for me:
1) If the current version is not stable for production is there one in the past that was considered stable for production?
2) If the current version is not stable for production now and there hasn't been one in the past at what point in the future do they think there will be one in the future?
3) My question was never about production, but about an issue I discovered.  Is there a timeframe for when they do think they will be able to address this issue?
4) If I want to submit a bug I assume I should do that in the Bug forum.  Do I need to do anything to convert this issue to a bug or has it already been submitted to the bug list?
5) Is the bug list viewable?  If so, where can I go to see it?
6) Do licensed users get to vote on bug fix priorities?
7) Any suggested workaround(s) for my issue?

Sorry for the number of questions, but I am just trying to learn more about this till and the people around it.
I like the product and I think it has great potential so I am just trying to understand the context of it.

Thanks. :)

 

Re: PyRad sqlalchemy.exc.CompileError

Reply #6
To repair that, change this file:
Code: [Select]
C:\Program Files (x86)\PyRad Classic\Components\syscodes\pageactionsdetails.xml
find
Code: [Select]
<code id="class_pagename">
  and add in imports this
Code: [Select]
from sqlalchemy import text

Then change all quoted texts to text() in:
Code: [Select]
<code id="orderbystatement">
<code id="groupbystatementwithdefault">
<code id="orderbystatementwithdefault">
<code id="orderbystatementsingle">