[Fixed]-Create branches of a model in django

1👍

Here are two common approaches data modeling for this. Pick whichever one better fits your business domain.

  • Clinic contains a ForeignKey to Clinic representing the parent-child relationship. Because many different sub-Clinics can have the same super-Clinic, the sub-Clinic should contain the ForeignKey and it should be named something along the lines of parent_clinic.
  • Introduce another model along the lines of ClinicGroup and relate Clinic to them. That is, Clinic contains a ForeignKey to ClinicGroup named something along the lines of clinic_group.
👤Ming

Leave a comment