> Is there a particular reason why using a related OneToOneField raises
> DoesNotExist instead of returning None?
>
> | class Person( Model ):
> | pass
> |
> | class Pet( Model ):
> | owner = OneToOneField( Person )
> |
> | # Assuming "joe" exists as a Person
> | >>> kitty = joe.pet
> | DoesN
On May 14, 2010, at 5:43 AM, Tom Evans wrote:
> On Thu, May 13, 2010 at 7:31 PM, Daniel Roseman wrote:
>>
>>
>> On May 13, 5:35 pm, Peter Herndon wrote:
>>> On May 13, 2010, at 10:29 AM, TallFurryMan wrote:
>>>
Hello Django users,
>>>
Is there a particular reason why using a relat
On Thu, May 13, 2010 at 7:31 PM, Daniel Roseman wrote:
>
>
> On May 13, 5:35 pm, Peter Herndon wrote:
>> On May 13, 2010, at 10:29 AM, TallFurryMan wrote:
>>
>> > Hello Django users,
>>
>> > Is there a particular reason why using a related OneToOneField raises
>> > DoesNotExist instead of returni
Thanks for this insight. I was using OneToOneField in the same way as
ForeignKey.
| class Person( Model ):
| pass
|
| class Pet( Model ):
| owner = ForeignKey( Person )
|
| # Assuming "joe" exists as a Person
| >>> kitty = joe.pet_set.get_or_create()
Yes, in that situation "joe.pet_set" i
On May 13, 5:35 pm, Peter Herndon wrote:
> On May 13, 2010, at 10:29 AM, TallFurryMan wrote:
>
> > Hello Django users,
>
> > Is there a particular reason why using a related OneToOneField raises
> > DoesNotExist instead of returning None?
>
> Any query you make that is supposed to return one or
On May 13, 2010, at 10:29 AM, TallFurryMan wrote:
> Hello Django users,
>
> Is there a particular reason why using a related OneToOneField raises
> DoesNotExist instead of returning None?
Any query you make that is supposed to return one or more instances, that
instead cannot find any results,
Hello Django users,
Is there a particular reason why using a related OneToOneField raises
DoesNotExist instead of returning None?
| class Person( Model ):
|pass
|
| class Pet( Model ):
|owner = OneToOneField( Person )
|
| # Assuming "joe" exists as a Person
| >>> kitty = joe.pet
| DoesNot
7 matches
Mail list logo