I have 2 apps in my django project
- customer app
- trades app
Customer app has following tables in models.py
- customer_table
- trade_plan_table
- service_plan_table
- customer_payments
trades app has following table in models.py
- trade_details_table
- service_details_table
Below are my dependencies:
service_plan_table has foreign key ref to service_details_table
customer_payments has foreign key ref to customer_table, trade_plan_table, service_plan_table
trade_details_table has foreign key ref to customer_table
service_details_table has foreign key ref to customer_table
Since there is dependency from customer model to trades model and vice versa, I'm facing circular dependency error. Instead of importing I tried 'string reference' but it did not help.
how to solve this issue?