Re: Window expressions, #26608

2017-02-24 Thread Mads Jensen
On 02/22/2017 12:00 PM, Josh Smeaton wrote: > - I'm unsure how DEFAULT_INDEX_TABLESPACE is causing issues with your > patch, can you explain a bit? It appears that it's necessary to have functions defined django/db/models/functions/X.py be importable from django.db.models.functions, which means

Re: Window expressions, #26608

2017-02-22 Thread Josh Smeaton
First off, great work on this patch. I haven't given it much of a look over just yet unfortunately, but I'm trying to figure out where your issues are to help unblock. - I'm unsure how DEFAULT_INDEX_TABLESPACE is causing issues with your patch, can you explain a bit? - Explicit arguments in

Re: Window expressions, #26608

2017-02-20 Thread Mads Jensen
I hit somewhat of a wall, and would like some input/help. * Import of window functions from `django.db.model.functions` seems to be the convention - `DEFAULT_INDEX_TABLESPACE` causes some headaches, because of XField being explicitly set in _output_field variable. Probably the functions

Re: Window expressions, #26608

2017-01-02 Thread Mads Jensen
I think this has cleaned up to request input (I'm a bit zealous to make something that will be merged). I left a note in 1.11.txt but when 2.0.txt is introduced, I'll move it there. Also, now everything is in places that are not PostgreSQL-only. I realized in the process that the only thing

Re: Window expressions, #26608

2016-11-30 Thread Mads Jensen
On Tuesday, November 29, 2016 at 11:04:49 PM UTC+1, Josh Smeaton wrote: > > Adam, are you thinking we should be adding something like > Model.objects.window(), or just allowing Window-type expressions on > backends that have a specific feature flag? Does the compiler need to get > involved at

Re: Window expressions, #26608

2016-11-30 Thread Mads Jensen
On Tuesday, November 29, 2016 at 10:35:34 PM UTC+1, Adam Johnson wrote: > > As to your point 1: > > >> Since this is specific to postgres > > > Well, Window expressions aren't specific to Postgres: > >- They exist in Oracle >- They exist in MariaDB 10.2 which is in beta and will be GA

Re: Window expressions, #26608

2016-11-29 Thread Shai Berger
On Wednesday 30 November 2016 03:10:23 Michael Manfre wrote: > > On 29 November 2016 at 22:04, Josh Smeaton > > wrote: > > > Mads, there's nothing that currently handles a list of expressions, and > > certainly nothing specific to OrderBy. Your proposed syntax is

Re: Window expressions, #26608

2016-11-29 Thread Michael Manfre
On Tue, Nov 29, 2016 at 6:37 PM Adam Johnson wrote: > I'm not sure about that detail atm, I need to review the patch. I just > think we shouldn't be putting anything in postgres-only land. > > On 29 November 2016 at 22:04, Josh Smeaton wrote: > > Adam, are

Re: Window expressions, #26608

2016-11-29 Thread Adam Johnson
I'm not sure about that detail atm, I need to review the patch. I just think we shouldn't be putting anything in postgres-only land. On 29 November 2016 at 22:04, Josh Smeaton wrote: > Adam, are you thinking we should be adding something like > Model.objects.window(), or

Re: Window expressions, #26608

2016-11-29 Thread Josh Smeaton
Adam, are you thinking we should be adding something like Model.objects.window(), or just allowing Window-type expressions on backends that have a specific feature flag? Does the compiler need to get involved at all, or can we handle the full range of window expressions with the expressions

Re: Window expressions, #26608

2016-11-29 Thread Adam Johnson
As to your point 1: > Since this is specific to postgres Well, Window expressions aren't specific to Postgres: - They exist in Oracle - They exist in MariaDB 10.2 which is in beta and will be GA at around the same time this patch is out:

Re: Window expressions, #26608

2016-11-29 Thread Mads Jensen
On Saturday, November 26, 2016 at 1:51:05 AM UTC+1, Josh Smeaton wrote: > > OrderBy takes an expression - it doesn't have to be a single column. For > example, this is valid: > > (Lower('last_name') + Lower('first_name)).desc() == > OrderBy(Lower('last_name') + Lower('first_name),

Re: Window expressions, #26608

2016-11-25 Thread Josh Smeaton
OrderBy takes an expression - it doesn't have to be a single column. For example, this is valid: (Lower('last_name') + Lower('first_name)).desc() == OrderBy(Lower('last_name') + Lower('first_name), descending=True) On Friday, 25 November 2016 23:22:58 UTC+11, Mads Jensen wrote: > > On Tuesday,

Re: Window expressions, #26608

2016-11-25 Thread Mads Jensen
On Tuesday, November 22, 2016 at 11:50:17 PM UTC+1, Josh Smeaton wrote: > Thanks for picking this up. I've been wondering if Window expressions > would be possible, and what limitations we might have to make based on our > ORM. > I was fortunate that the reporter posted a snippet to work from

Window expressions, #26608

2016-11-22 Thread Mads Jensen
Hi, I got somewhat stuck on progress with this ticket, and as I'd like to get it merged eventually (and avoid an abundant amount of fixes), I have a few things I like a bit of input about. 1. Since this is specific to postgres, I'm looking for a better place to put the actual Window-expression