from django.contrib.auth.models import User

class Users(models.Model):
    user = models.OneToOneField(User, related_name = 'user_users')
    user_type = models.IntegerField()
    sub_customer = models.ForeignKey(SubCustomer, related_name = 
'subcustomer_users')
    designation = models.ForeignKey(Designation, related_name = 
'designation_users')
    is_contact_person = models.BooleanField(default = False)
    address = models.CharField(max_length = 350, null = True, blank = True)
    mobile1 = models.CharField(validators=[phone_regex], null = True, blank 
= True, max_length = 15)
    mobile2 = models.CharField(validators=[phone_regex], null = True, blank 
= True, max_length = 15)

I want to save the values into both the tables(users_users and auth_user). 
How can I save the values into both the tables using ModelViewSet or 
ListCreateAPIView?




-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to