This syntax would be used when declaring default ordering in models (via the "ordering" argument), and it'd be used in the "order_by" parameter to the database API.
I like it because it's a lot less crufty, easier to type and easier to read.
The change can even be backwards-compatible if we wanted it to be, although I'd want to phase out the old-style ordering eventually.
> This syntax would be used when declaring default ordering in models
> (via the "ordering" argument), and it'd be used in the "order_by"
> parameter to the database API.
> I like it because it's a lot less crufty, easier to type and easier to
> read.
> The change can even be backwards-compatible if we wanted it to be,
> although I'd want to phase out the old-style ordering eventually.
> ordering = ('pub_date+', 'name-', 'other?') > The change can even be backwards-compatible if we wanted it to be, > although I'd want to phase out the old-style ordering eventually.
> Thoughts?
similar to SQLObject, where IIRC you can declare a DESC order using order_by='-pub_date'. you could imply a ASC order (that is without the the + at the end).
> > ordering = ('pub_date+', 'name-', 'other?') > > The change can even be backwards-compatible if we wanted it to be, > > although I'd want to phase out the old-style ordering eventually.
> > Thoughts?
> similar to SQLObject, where IIRC you can declare a DESC order using > order_by='-pub_date'. you could imply a ASC order (that is without the > the + at the end).
Nice. Seems like it would make sense to follow the lead of SQLObject here, prepending a "-" for descending order. It has the advantage of making sense mathematically as well.