Re: [sqlalchemy] Postgres Composite Columns

2017-05-02 Thread Zac Goldstein
Ah ok, sorry. I'll give your code a closer look then. On Tuesday, May 2, 2017 at 6:45:23 PM UTC-7, Mike Bayer wrote: > > Well, I just pasted the example from that email I wrote, it still seems > to work, and "typemap" is just a local variable to that example, nothing > is "deprecated" there

[sqlalchemy] Re: LIMIT the number of children in relationship dynamically

2017-05-02 Thread Isaac Martin
Yep, I ended up doing exactly what you describe. Thanks again! > > -- 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

Re: [sqlalchemy] Postgres Composite Columns

2017-05-02 Thread Zac Goldstein
Thanks for your response Mike. I submitted an issue to the sqlalchemy-utils github around the time I made my SO post. Mostly though I'm interested in finding a way around using 'typemap', which is what's used in every implementation of composite columns I can find. e.g. the code you have

Re: [sqlalchemy] Can I get joined loading on a relationship to work from child to parent?

2017-05-02 Thread mike bayer
On 05/02/2017 02:59 PM, Randy Syring wrote: |Is there any way to get relationship joined loading to work from child back up to the parent?| in this case, since you have eager loaders configured, you can call refresh() on "c" which will unexpire the object since the commit() and also fire

Re: [sqlalchemy] Postgres Composite Columns

2017-05-02 Thread mike bayer
just a note that I'm not sure there are sqlalchemy-utils people here, you might want to try pinging Konsta via https://github.com/kvesteri/sqlalchemy-utils On 05/02/2017 02:10 PM, Zac Goldstein wrote: Hello, I'm having some difficulty implementing postgres composite columns. I've been

[sqlalchemy] Can I get joined loading on a relationship to work from child to parent?

2017-05-02 Thread Randy Syring
Is there any way to get relationship joined loading to work from child back up to the parent? from sqlalchemy import create_engine, Column, Integer, String, ForeignKey from sqlalchemy.orm import relationship, sessionmaker from sqlalchemy.ext.declarative import declarative_base engine =

[sqlalchemy] Postgres Composite Columns

2017-05-02 Thread Zac Goldstein
Hello, I'm having some difficulty implementing postgres composite columns. I've been working off of the sqlalchemy-utils implementation: http://sqlalchemy-utils.readthedocs.io/en/latest/_modules/sqlalchemy_utils/types/pg_composite.html. I've also looked at relevant posts here, but they all

Re: [sqlalchemy] LIMIT the number of children in relationship dynamically

2017-05-02 Thread mike bayer
On 05/02/2017 12:38 AM, Isaac Martin wrote: Thank you very much for your response. This solution isn't working for me, and I'm 99% sure I'm not translating what you've written into something that works for my use case. My situation is somewhat more complicated than I initially wrote. My

Re: [sqlalchemy] LIMIT the number of children in relationship dynamically

2017-05-02 Thread Isaac Martin
Well that was a very silly mistake. End of the day oversight is what happened here. I didn't notice that "offset" was set to 10 and my unit test only had 2 values. When I set offset to 0 it worked great. Sincerest thanks for this! I hadn't seen as_scalar used before. I'm looking forward to trying