Re: Model.objects.get() raises AssertionError on multiple values

2007-02-16 Thread James Bennett
On 2/16/07, Rob Hudson <[EMAIL PROTECTED]> wrote: > Cool. I was looking at how I'd do this but I wouldn't have known > about the add_to_class in __new__. There are some notes on the wiki about how the model system works, useful for anyone who wants to venture in there and patch stuff: http://co

Re: Model.objects.get() raises AssertionError on multiple values

2007-02-16 Thread Rob Hudson
Cool. I was looking at how I'd do this but I wouldn't have known about the add_to_class in __new__. On Feb 16, 12:18 pm, "Gary Wilson" <[EMAIL PROTECTED]> wrote: > Ticket and patch created:http://code.djangoproject.com/ticket/3511 --~--~-~--~~~---~--~~ You recei

Re: Model.objects.get() raises AssertionError on multiple values

2007-02-16 Thread Gary Wilson
On Feb 14, 8:54 am, "Rob Hudson" <[EMAIL PROTECTED]> wrote: > I'm wondering if maybe get should raise an error with a name like > "MultipleValueError" rather than "AssertionError" when multiple values > are found... Ticket and patch created: http://code.djangoproject.com/ticket/3511 --~--~-

Re: Model.objects.get() raises AssertionError on multiple values

2007-02-16 Thread Gary Wilson
On Feb 14, 8:54 am, "Rob Hudson" <[EMAIL PROTECTED]> wrote: > I'm wondering if maybe get should raise an error with a name like > "MultipleValueError" rather than "AssertionError" when multiple values > are found... +1 --~--~-~--~~~---~--~~ You received this mess

Model.objects.get() raises AssertionError on multiple values

2007-02-14 Thread Rob Hudson
I'm wondering if maybe get should raise an error with a name like "MultipleValueError" rather than "AssertionError" when multiple values are found... Yesterday I was wiring up a toggle method. If the row is in the database, remove it. If it isn't in the database, add it. I don't have the exact