Re: [sqlalchemy] Relationship with query time evaluated primaryjoin

2016-08-09 Thread Florian Rüchel
016 07:43 AM, Florian Rüchel wrote: >> I created a gist that recreates the issue when running SQLAlchemy >> 1.1.0b3: https://gist.github.com/Javex/41c58b098c1e5736cb2b21c4b6708be3 > > great test. So this is to do with the lazy loader which is not > expecting to see what it's seei

Re: [sqlalchemy] Relationship with query time evaluated primaryjoin

2016-08-08 Thread Florian Rüchel
k it here if possible so I can follow it :) Cheers, Florian On Sunday, 7 August 2016 23:58:04 UTC+10, Mike Bayer wrote: > > > > On 08/06/2016 08:03 PM, Florian Rüchel wrote: > > Following up on this. I have implemented it in my application and it > > works beautifull

Re: [sqlalchemy] Relationship with query time evaluated primaryjoin

2016-08-06 Thread Florian Rüchel
ote: > > > > On 08/04/2016 10:14 AM, Florian Rüchel wrote: > > I have a relationship that depends on a query time variable to determine > > the correct join. The use case is request-time localization in a web > > application. When running the query during a request, I

Re: [sqlalchemy] Relationship with query time evaluated primaryjoin

2016-08-04 Thread Florian Rüchel
: > > > > On 08/04/2016 10:14 AM, Florian Rüchel wrote: > > I have a relationship that depends on a query time variable to determine > > the correct join. The use case is request-time localization in a web > > application. When running the query during a req

[sqlalchemy] Creating PostgreSQL Index with ASC/DESC and NULLS FIRST/LAST

2015-11-23 Thread Florian Rüchel
Hey, I want to execute the following statement in the most SQLAlchemy way possible: CREATE INDEX ix_user_points ON "user" (points DESC NULLS LAST); So I want to add a "DESC NULLS LAST" or equivalent as per documentation (http://www.postgresql.org/docs/current/static/indexes-ordering.html)

Re: [sqlalchemy] Creating PostgreSQL Index with ASC/DESC and NULLS FIRST/LAST

2015-11-23 Thread Florian Rüchel
Thanks! On 11/23/2015 09:06 PM, Mike Bayer wrote: > > On 11/23/2015 03:01 PM, Florian Rüchel wrote: >> Hey, >> >> I want to execute the following statement in the most SQLAlchemy way >> possible: >> >> CREATE INDEX ix_user_points ON "user" (poi

[sqlalchemy] Re: Having a proxy attribute along a relationship path

2015-03-11 Thread Florian Rüchel
You are correct. I wanted to see the query int produces to verify it works (in a small test case) and got an error that I did not make sense to me. I tried to used joinedload on the proxy, something that does not seem to work. But if I explicitly specify the chain as loading strategies, the

[sqlalchemy] Having a proxy attribute along a relationship path

2015-03-09 Thread Florian Rüchel
Hi there, I was wondering if it was possible to have an attribute on a model that is proxied through a relationship in a many-to-one case. I know for M2M there is association_proxy, but that does not seem to work. Example time! class Show(Base): id = sqlalchemy.Column(sqlalchemy.Integer,

[sqlalchemy] _listen() got an unexpected keyword argument 'named'

2014-09-15 Thread Florian Rüchel
Hi, I use events for some of my models to trigger changes and so on. However, one function needs to be triggered on very different events (attribute, mapper). To make things easy, I wanted to use named arguments and implement the correct logic to retrieve the values I needed. However, when I

[sqlalchemy] Adding a table to multiple metadata instances

2014-02-25 Thread Florian Rüchel
I have an application that uses Postgres Schemas to separate customers from each other. As a result each customer has their own schema and there is one additional schema that holds globally valid tables (such as the list of customers). So while each customer schema is identical, the global

Re: [sqlalchemy] Adding a table to multiple metadata instances

2014-02-25 Thread Florian Rüchel
, Michael Bayer wrote: On Feb 25, 2014, at 11:40 AM, Florian Rüchel florian...@gmail.comjavascript: wrote: I have an application that uses Postgres Schemas to separate customers from each other. As a result each customer has their own schema and there is one additional schema that holds

[sqlalchemy] Testing custom types

2013-10-01 Thread Florian Rüchel
I have created several custom types from base SQLAlchemy types. One example is a DateTime with integrated timezone support (i.e. it assumes all timezones are UTC when loading and attaches the tzinfo from pytz to it). Now I want to test these types. I could just integrate them in my usual

Re: [sqlalchemy] sqlite string concats and datetime arithmetics

2013-08-30 Thread Florian Rüchel
I recently had exactly the same problem on SQLAlchemy 0.8 where doing something like somestring + Item.some_column would not result in a || but in a + operator which sqlite could not handle. To note here in my case: The some_column was the id, thus an integer. I'm not sure how SQLAlchemy

Re: [sqlalchemy] sqlite string concats and datetime arithmetics

2013-08-30 Thread Florian Rüchel
Okay so basically what you are saying is that this is intended behaviour? I've been trying to dig through the source for quite some time now but finding the point where it is decided is harder than I thought. Could you explain why String + Int gives the operator add and not concat_op? On

[sqlalchemy] How to create a one-to-many relationship with a default one-to-one property for I18N

2013-08-26 Thread Florian Rüchel
Hey there, I have already posted this on stackoverflowhttp://stackoverflow.com/questions/18304212/how-do-i-create-a-one-to-many-relationship-with-a-default-one-to-one-property-fobut not recieved an answer yet so I thought I might try here. To quote from my original question: Suppose we have