On Mon, Jul 1, 2019, at 5:20 PM, sector119 wrote:
> For example I have a property 'path' with CTE like this and it wouldn't
> return set of rows, but scalar value as array[] of rows
> would it be possible to load this property as subquery() ?
I don't know from a SQL perspective you'd likely hav
For example I have a property 'path' with CTE like this and it wouldn't
return set of rows, but scalar value as array[] of rows
would it be possible to load this property as subquery() ?
Of course I can include that CTE query in my query(Locality) using
subquery(), but it would be cool if I'll b
I don't know what you mean. is there SQL you know you want or is that the part
you want to figure out?
On Mon, Jul 1, 2019, at 4:21 PM, sector119 wrote:
> Mike, is it possible to load "@property" as subquery? Maybe as
> ARRAY[path_item, path_item, ...]
>
> воскресенье, 30 июня 2019 г., 20:26:4
Mike, is it possible to load "@property" as subquery? Maybe as
ARRAY[path_item, path_item, ...]
воскресенье, 30 июня 2019 г., 20:26:42 UTC+3 пользователь Mike Bayer
написал:
>
>
>
> On Sun, Jun 30, 2019, at 5:37 AM, sector119 wrote:
>
> Nice, thanks a lot, Mike, now it works as expected
>
>
> th
On Sun, Jun 30, 2019, at 5:37 AM, sector119 wrote:
> Nice, thanks a lot, Mike, now it works as expected
that's great. the docs are not good here, there's not enough discussion of
"aliased()" , from_statement() and what they do, also I'm changing some details
of how they do their work for 1.4 i
Nice, thanks a lot, Mike, now it works as expected
@property
def path(self):
session = object_session(self)
def get_locality_path_q(locality_id):
parent_q = session.query(Locality).filter(Locality.id ==
locality_id).cte(recursive=True)
parents = aliased(parent_q)
On Sat, Jun 29, 2019, at 11:24 AM, sector119 wrote:
> Hello,
>
> I have Locality model with 'path' property to get path from 'root' of tree to
> current item, everything works ok, but
> I can't get result as Locality instance list..
> When I use
> *'*object_session(self).query(Locality).from_s
Hello,
I have Locality model with 'path' property to get path from 'root' of tree to
current item, everything works ok, but
I can't get result as Locality instance list..
When I use
*'*object_session(self).query(Locality).from_statement(q).order_by(Locality.id)'
I get
sqlalchemy.exc.Argu