One way that occurs to me is defining 'father_id' and 'mother_id' as
integers instead of references and setting the default to zero.
But then you would have to check if the fields are zero before using
them as a reference.


On Apr 15, 7:45 am, Leandro - ProfessionalIT <[email protected]>
wrote:
> Friends,
>
>    I have a situation where I can have a dog that I don't know your
> father and mother. How to resolve this ? for example, a dog that I buy
> in a shop.
>
> db.define_table('dog',
>     Field('name'),
>     Field('father_id','reference dog'),
>     Field('mother_id','reference dog'))
>
>  How to map this table ? becaus in my situation I can have a null
> father_id and mother_id.
>
>  Thanks
>
>   -- Leandro.


-- 
Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en

Reply via email to