#30309: Remove hasattr reference in One-to-One documentation example
-------------------------------+--------------------------------------
Reporter: davidjb | Owner: nobody
Type: Uncategorized | Status: closed
Component: Documentation | Version: 2.2
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by felixxm):
* status: new => closed
* resolution: => invalid
Comment:
IMO this doc is still valid and it is not related with pre-Python 3.2
behavior. It's quite straightforward, so if you want to check that `p2`
doesn’t have an associated restaurant you can catch `ObjectDoesNotExist`
exception or you can use `hasattr(p2, 'restaurant')` (if you don't want to
catch exceptions).
--
Ticket URL: <https://code.djangoproject.com/ticket/30309#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.fee2007019fdd1d460de89084f3cdc9c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.