Django circular model reference

前端 未结 8 1320
长发绾君心
长发绾君心 2020-11-29 07:42

I\'m starting to work on a small soccer league management website (mostly for learning purposes) and can\'t wrap my mind around a Django models relationship. For simplicity,

8条回答
  •  北海茫月
    2020-11-29 07:57

    Now can be used the AppConfig feature to import models:

    Retailer = apps.get_model('retailers', 'Retailer')
    retailer = Retailer.objects.get(id=id)            
    

提交回复
热议问题