On May 30, 2008, at 2:54 AM, [EMAIL PROTECTED] wrote:

> Guess and test using try; except; statements.  Alternatively, you
> could add a type field to Person() and overide the save fields on Man
> and Woman to set the type field correctly.
>
> On May 30, 1:38 am, "Davide.D" <[EMAIL PROTECTED]> wrote:
>> Simplify the question:
>>
>> I got a "person", and how to know the "person" is a "man" or a
>> "woman" ?

You can use also use hasattr().

Something like

if hasattr(person_obj, 'man'):
    #is man
elif hassattr(person_obj, 'woman'):
    #is woman
else:
    #is freakish mutated thing

---
David Zhou
[EMAIL PROTECTED]




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to