Re: [Changeset] r2837 - django/trunk/docs

2006-05-06 Thread Adrian Holovaty
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

Re: [Changeset] r2837 - django/trunk/docs

2006-05-06 Thread Luke Plant
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

Re: [Changeset] r2837 - django/trunk/docs

2006-05-05 Thread Adrian Holovaty
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

Re: [Changeset] r2837 - django/trunk/docs

2006-05-05 Thread Luke Plant
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 +