Hi,
I've got a model Child inheriting from a (non abstract) model Parent. For a given instance parent of Parent, how can I know if it's a Child?
If it is,
parent.child
returns the child, but otherwise it returns a DoesNotExist exception.
Is a try/except the only way to check that?
Thanks
jul
# EDITI've just find the same question here: http://stackoverflow.com/questions/2202232/distinguishing-parent-models-children-with-django-inheritance.
And the answer is....
hasattr(parent, 'child')