Hey guys,
I just stumbled into something weird.
I have a OneToOneField from Chair to Table. Let's say that it's called `.table`, and the reverse is called `.chair`.
Now, I've got a Table, and I want to see whether it has a chair associated with it. How could I check this? I assumed that I will just check whether `table.chair` is None or not, but apparently it's not how it works. If there is no chair associated with the table, you don't get `None`, you get a `DoesNotExist` exception!
Now, I could whip up a try...except block, but that strikes me as an ugly solution. I'd sooner make a helper property that will do this for me.
Is there a nicer way to check whether a Table has a Chair?
Thanks,
Ram.