you can use model signals

On Mon, Oct 23, 2017 at 4:15 PM, Mukul Mantosh <mukulmantos...@gmail.com>
wrote:

> I have two models (User and Employee). I want to create a new user and
> make a reference between employee and user.
>
>
> *User Table*
> 1. Name
> 2. E-Mail
> 3. Date of Birth
> 4. Contact Number
>
>
> *Employee Table*
> 1. EmployeeID
> 2. Address
> 3. Country
> 4. Profile Photo
> 5. *user_id*
>
> *Problem Statement:  *When i create a new user then automatically it
> should create a new record in employee table with *user_id* referencing
> to the user table and without writing two SQL Statements and should also
> follow the database transaction property(ACID).
>
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/124695ae-e1f1-4252-8bbb-272cb438243b%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/124695ae-e1f1-4252-8bbb-272cb438243b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACOk0TxA3cwExG_3V6gJix9RAJW8-CrJ_DpkCS8txfZS9SiC6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to