iday.
From: django-developers@googlegroups.com [django-developers@googlegroups.com]
On Behalf Of Aymeric Augustin [aymeric.augus...@polytechnique.org]
Sent: Wednesday, July 24, 2013 21:39
To: django-developers@googlegroups.com
Subject: Re: Custom Chainable QuerySets (#20625)
O
On 24 juil. 2013, at 13:53, Anssi Kääriäinen wrote:
> I will commit the patch on Friday. If somebody wants more time to review the
> patch, just ask and I will defer the commit to later date.
Where's the version of the patch you're ready to commit?
--
Aymeric.
--
You received this messag
On Tuesday, July 23, 2013 12:39:13 PM UTC+3, Loic Bistuer wrote:
>
> I thought of a third option that I think strikes the right balance between
> convenience and flexibility.
>
> Please see the following comment:
>
> https://github.com/django/django/pull/1328#issuecomment-21400832
>
>
I will go
I thought of a third option that I think strikes the right balance between
convenience and flexibility.
Please see the following comment:
https://github.com/django/django/pull/1328#issuecomment-21400832
--
Loic
--
You received this message because you are subscribed to the Google Groups
"Dj
On Jul 23, 2013, at 3:17 AM, Aymeric Augustin
wrote:
> Either way the factory should receive the QuerySet in argument as well as any
> other parameters required to create the custom Manager appropriately.
I missed the "other parameters required" part.
Please note that this is only needed for
I'm not a big fan of TIMTOWTDI so I don't think we should have both
`Manager.from_queryset()` and `QuerySet.as_manager()`.
The following commit moved all the logic that was on `QuerySet` to the
`Manager` class and implemented the `from_queryset()` API:
https://github.com/loic/django/commit/
On 22 juil. 2013, at 17:31, Loic Bistuer wrote:
> The goal is to make it painfully easy to get a `Manager` from a custom
> `QuerySet` and for most cases, having the factory on `Manager` instead of
> `QuerySet` results in a more verbose syntax and requires an unnecessary
> import.
Objects with
I would like to point out that using both a custom `Manager` *and* a custom
`QuerySet` is an edge case. After all, you can already do that if you want to.
The goal is to make it painfully easy to get a `Manager` from a custom
`QuerySet` and for most cases, having the factory on `Manager` instead
On Monday 22 July 2013 13:25:38 Anssi Kääriäinen wrote:
> On Monday, July 22, 2013 1:16:04 PM UTC+3, Loic Bistuer wrote:
> > On Jul 22, 2013, at 4:38 PM, Chris Wilson
> > >
> >
> > wrote:
> > > I think that's very true. How about this?
> > >
> > >> class MyQuerySet(models.QuerySet):
> > >>
Hi Aymeric,
On Mon, 22 Jul 2013, Aymeric Augustin wrote:
The idea of `QuerySet .as_manager()` sounded sane to me at
first—especially in the light of the failure of various other
attempts—but it creates a circular dependency between `Manager` and
`QuerySet`. Creating the `Manager` class now re
On 22 juil. 2013, at 12:16, Loic Bistuer wrote:
> That was my original proposal; the first 20 comments on the ticket and one
> nearly complete implementation are based on this idea.
Oh, sorry. I dived into the pull request without reading the ticket first.
I'm really trying to help this ticket
On Monday, July 22, 2013 1:16:04 PM UTC+3, Loic Bistuer wrote:
>
> On Jul 22, 2013, at 4:38 PM, Chris Wilson >
> wrote:
>
> > I think that's very true. How about this?
> >
> >> class MyQuerySet(models.QuerySet):
> >> def published(self):
> >> return self.filter(publ
On Jul 22, 2013, at 4:38 PM, Chris Wilson wrote:
> I think that's very true. How about this?
>
>> class MyQuerySet(models.QuerySet):
>> def published(self):
>> return self.filter(published_date__lte=now())
>>
>> class MyModel(models.Model):
>> published_
The idea of `QuerySet .as_manager()` sounded sane to me at first—especially in
the light of the failure of various other attempts—but it creates a circular
dependency between `Manager` and `QuerySet`. Creating the `Manager` class now
requires the `QuerySet` class, and `QuerySet` needs a referenc
Ticket #20625 deals with the problem of writing custom QuerySet methods.
The problem is that one needs to write some boilerplate code to have
methods available on both the Manager and the QuerySet. The ticket has a
patch for having custom QuerySet methods automatically available on the
model's
15 matches
Mail list logo