Re: Changing the order of SQL generation

2021-07-28 Thread schinckel
Hey Luke, Yeah, I had seen hybrid attributes. I think I came across them after starting this, but I think they are pretty much the same idea. Not sure if their hybrid methods are new, but that looks fun too ;) I'll be more than happy to look at a PR to include this in Django, once I've got a c

Re: Changing the order of SQL generation

2021-07-28 Thread Luke Plant
I haven't had chance to dig into this, but django-shared-property looks very interesting. IMO it would be great to be able to support it well, or even include that kind of functionality in Django itself. The closest SQLAlchemy equivalent to this seems to be hybrid attributes

Changing the order of SQL generation

2021-07-27 Thread Matthew Schinckel
Greetings, For a couple of things I’ve been working on, I wound up hitting exactly the same problem with respect to SQL generation. It seems that the `FROM` clauses are generated after the SELECT, but before WHERE. This means that any .as_sql() code that is run only on things that appear in a