On 5/6/06, Luke Plant <[EMAIL PROTECTED]> wrote:
> But, thinking about it, perhaps it should actually raise IndexError in
> this situation, and use DoesNotExist for explicit .get() calls? This
> would make it act more like other sequences. I don't know how much
> code this might impact.
That so
On Saturday 06 May 2006 04:44, Adrian Holovaty wrote:
> Good call! I've changed the docs. For some reason I was thinking a
> simple slice would raise KeyError instead of DoesNotExist, but it
> does indeed raise DoesNotExist properly.
Ah yes, I hadn't thought about exceptions. I've now fixed a c
On 5/5/06, Luke Plant <[EMAIL PROTECTED]> wrote:
> > +To retrieve a *single* object rather than a list
> > +(e.g. ``SELECT foo FROM bar LIMIT 1``), slice the ``QuerySet`` to
> > ``[:1]`` and +call ``get()`` on that. For example, this returns the
> > first ``Entry`` in the +database, after ordering
Hi Adrian,
> Author: adrian
> Date: 2006-05-04 21:56:15 -0500 (Thu, 04 May 2006)
> New Revision: 2837
>
...
> +Limiting QuerySets
> +--
...
> +To retrieve a *single* object rather than a list
> +(e.g. ``SELECT foo FROM bar LIMIT 1``), slice the ``QuerySet`` to
> ``[:1]`` and +