Polymorphism in Django

前端 未结 8 910
死守一世寂寞
死守一世寂寞 2021-01-07 06:11

I have the following models. How do I get access to the unicode of the inheriting tables (Team and Athete) from the Entity table? I\'m trying to display a l

8条回答
  •  -上瘾入骨i
    2021-01-07 07:11

    I am not very clear what you want to do, but in any case you can add a criteria in dervied class instead of checking unicode method of derived classes

    e.g. you can ask the class isTypeA ? or why don't you check the type?

提交回复
热议问题