Tuesday, June 1, 2021

Re: Inlined hierarchy models in django admin site.

btw have you applied in your models what I told you to do?

On Wed, Jun 2, 2021 at 10:31 AM Ayush Bisht <bisht.ayush2001@gmail.com> wrote:
yes, its true, but here it works as candidate key. so that we can identify the patient based in ICMR id's. 

On Tuesday, June 1, 2021 at 1:34:24 AM UTC-7 abubak...@gmail.com wrote:
class Patient(models.Model):
     patient_id = models.CharField(max_length=60) # no need for adding patient id because django automatically creates ids
    patient_vaccine = models.ForeignKey(PatientVaccine, related_name="patient_vaccine")
   vaccine = models.ForeignKey(Vaccinet, related_name="vaccinet")

On Tue, Jun 1, 2021 at 1:30 PM DJANGO DEVELOPER <abubak...@gmail.com> wrote:
class Vaccine(models.Model)
     vaccine = models.ForeignKey(PatientVaccineStatus, related_name="vaccine_status")
    patient = models.ForeignKey(Patient, related_name="patient")  # new line
apply this line and your patient model will be linked with Vaccine model 

On Tue, Jun 1, 2021 at 11:06 AM Ayush Bisht <bisht.a...@gmail.com> wrote:
class Patient(models.Model):
     patient_id = models.CharField(max_length=60)


class PatientVaccineStatus(models.Model):
      patient = models.ForeignKey(Patient, related_name="patient_vaccine_status")

class Vaccine(models.Model)
     vaccine = models.ForeignKey(PatientVaccineStatus, related_name="vaccine_status")
 
..................................................................

Is there any way to merged all the tables in a single table of patient.

I successfully merge, PatientVaccineStatus table with Patient table, but Vaccine's table is not merging with the Patient. 

how can this hierarchy be merged in a single table.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/57aac480-cb53-4fbe-a3bd-8766cd7a5b82n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d7ca06cb-c662-4994-b8cd-ff0cbfd61ea8n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKPY9pnLy_Drk1Tz6FCbQkkHGjWRPW8hfJ1Hjsr7C3-53cu6%2BQ%40mail.gmail.com.

No comments:

Post a Comment