that is a bug and here is a workaround:

from sqlalchemy.sql import column, func, literal_column

# work around [ticket:2537] until SQLAlchemy 0.8
from sqlalchemy.sql import operators
operators._PRECEDENCE['SEPARATOR'] = 0

expr = func.group_concat(column('urlname').op('SEPARATOR')(literal_column('/')))

print expr



On Jul 22, 2012, at 8:30 AM, Sergey Kucheryavski wrote:

> I try to use group_concat with SEPARATOR option as it was proposed in other 
> topic but got a strange issue with using group_concat and op:
> 
> this expression:
> print node.urlname.op('SEPARATOR')('/')
> gives
> node.urlname SEPARATOR :urlname_1
> 
> But this expression
> print func.group_concat(node.urlname.op('SEPARATOR')('/'))
> gives
> group_concat((node.urlname SEPARATOR :urlname_1))
> 
> and these extra brackets in real query cause SQL error. Is there anything I 
> am doing wrong?
> 
> Thanks a lot in advance!
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/sqlalchemy/-/tkZZJh9bBYQJ.
> 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/sqlalchemy?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" 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/sqlalchemy?hl=en.

Reply via email to