1

I have 2 table, appointment and schedule.

schedule has these field: scheduleid, title, 'starttime', 'endtime', 'date'

appointment has these field: id, scheduleid, clinicid, 'time', 'queueNo', 'date'

schedule starttime is = appointment time. So is the date

When ever a user create a Appointment, it will also create a schedule as u can see on above. I know how to make a nested serializer but what i do not know is. If a schedule hasn't been created, what do i insert the scheduleid in the appointment table.

Reason is because, create appointment first, how to create so that in appointment django know how to create a scheduleid for it ?

1
  • Can you add your model classes to question? Commented Jan 24, 2018 at 12:49

1 Answer 1

1

You need to create a appointment table first and after the confirmation create schedule table. So remove the scheduleid from appointment instead of that add appointmentid to schedule table. This is not the only way, it's suggestion from side based on your requirements.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.