Re: Insert data into multiple models when doing POST method

2018-05-21 Thread Daniel Germano Travieso
Hello! ​As my initial understanding, you are attempting to use some sort of Django REST Framework. Check the django-rest-framework documentation for some insights: http://www.django-rest-framework.org/api-guide/serializers/ You will need to overwrite the .create method of the Patient Model and

Insert data into multiple models when doing POST method

2018-05-21 Thread thiagarajan.kpt
Hi, I have two models (Patients and PatientAddress). I want to create a new patient using POST method and data should be inserted in Patient and PatientAddress tables. But the data is inserted only into Patients table and not in PatientAddress table. When I POST a new patient with Address