_compile_state() is an expensive call so you'd want to avoid doing that casually, that's why filter_by_zero is there.
On Thu, May 20, 2021, at 4:35 AM, piotr maliński wrote: > Managed to get this working: > https://github.com/riklaunim/flask-jsonapi/commit/6fab64bb0f31e2e3f3e1ed82269fd26464f00aba > > I used *self._compile_state()._joinpoint_zero()* while > *self._filter_by_zero() *also seems to be working.** > > czw., 20 maj 2021 o 01:41 Mike Bayer <mike...@zzzcomputing.com> napisał(a): >> __ >> the _joinpoint_zero() can likely be replaced by _filter_by_zero() : >> https://github.com/sqlalchemy/sqlalchemy/blob/master/lib/sqlalchemy/orm/query.py#L1697 >> >> I had mentioned this to someone on twitter but they never got back to me if >> it worked or not. >> >> >> >> On Wed, May 19, 2021, at 7:19 AM, Piotr wrote: >>> I'm trying to update this Query class mixin - >>> https://github.com/mitsuhiko/sqlalchemy-django-query/blob/master/sqlalchemy_django_query.py >>> to sqlalchemy 1.4. >>> >>> Aside of joinedload_all removed the Query class changes a lot which breaks >>> the: >>> >>> *column = _entity_descriptor(q._joinpoint_zero(), token)* >>> >>> as "*_joinpoint_zero*" is no longer present in that class. I've tried like >>> looping over _raw_columns (simplified below): >>> >>> *column = _entity_descriptor(get_mapper(self._raw_columns[0]), token)* >>> >>> Which works for some cases - like it finds backward relationship but then >>> fails to map a field from child as _raw_columns contain only the parent. >>> >>> How this could be migrated to 1.4? It's a dependency for flask_jsonapi that >>> either way would be hard to remove and replace with some custom parser for >>> filters, ordering and pagination. >>> >>> -- >>> SQLAlchemy - >>> The Python SQL Toolkit and Object Relational Mapper >>> >>> http://www.sqlalchemy.org/ >>> >>> To post example code, please provide an MCVE: Minimal, Complete, and >>> Verifiable Example. See http://stackoverflow.com/help/mcve for a full >>> description. >>> --- >>> You received this message because you are subscribed to the Google Groups >>> "sqlalchemy" group. >>> To unsubscribe from this group and stop receiving emails from it, send an >>> email to sqlalchemy+unsubscr...@googlegroups.com. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/sqlalchemy/4e7248db-86aa-427c-9ded-f16b548bc7f5n%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/sqlalchemy/4e7248db-86aa-427c-9ded-f16b548bc7f5n%40googlegroups.com?utm_medium=email&utm_source=footer>. >> >> >> -- >> SQLAlchemy - >> The Python SQL Toolkit and Object Relational Mapper >> >> http://www.sqlalchemy.org/ >> >> To post example code, please provide an MCVE: Minimal, Complete, and >> Verifiable Example. See http://stackoverflow.com/help/mcve for a full >> description. >> --- >> You received this message because you are subscribed to a topic in the >> Google Groups "sqlalchemy" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/sqlalchemy/OvsP7_vtoMQ/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> sqlalchemy+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/sqlalchemy/77e96721-d406-4c13-ab29-69063924238a%40www.fastmail.com >> >> <https://groups.google.com/d/msgid/sqlalchemy/77e96721-d406-4c13-ab29-69063924238a%40www.fastmail.com?utm_medium=email&utm_source=footer>. > > -- > SQLAlchemy - > The Python SQL Toolkit and Object Relational Mapper > > http://www.sqlalchemy.org/ > > To post example code, please provide an MCVE: Minimal, Complete, and > Verifiable Example. See http://stackoverflow.com/help/mcve for a full > description. > --- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sqlalchemy+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sqlalchemy/CAL_zvkTJKJUgRy82KHFN_0o3EqmmgbwyB6yCbLMpLrBGLTpi9w%40mail.gmail.com > > <https://groups.google.com/d/msgid/sqlalchemy/CAL_zvkTJKJUgRy82KHFN_0o3EqmmgbwyB6yCbLMpLrBGLTpi9w%40mail.gmail.com?utm_medium=email&utm_source=footer>. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/7a308efc-2610-4332-a66a-ffc250c66477%40www.fastmail.com.