I always thought the functionality should be within the object:
Person.objects.filter_or_404(pk=2)
Person.objects.filter(pk=2).or_404()

On 1/31/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote:
>
> The descriptor-fields implementation is firming up, which is good. Now
> it's time to start changing all the various bits inside Django to use
> the new descriptor-fields syntax.
>
> Two that come to mind are the get_object_or_404() and
> get_list_or_404() shortcuts. Currently they accept a model and
> **kwargs that are passed to get_list(). We can change it to use
> filter(), but some previously-accepted kwargs, such as limit, offset
> and select_related, are no longer filter() arguments; they're methods
> on a QuerySet.
>
> Does anybody have ideas on ways to maintain this functionality without
> making the shortcuts too verbose (and defeating their purpose)?
>
> Adrian
>
> --
> Adrian Holovaty
> holovaty.com | djangoproject.com | chicagocrime.org
>

Reply via email to