I am working on a project which has two different sets of users - Customer 
and Merchant. Both of these users should be able to register and login to 
their respective profiles. The most obvious choice to implement this that 
came to my mind was to make two different models Customer and Merchant that 
inherit from a BaseUser model that will store the common fields i.e. 
Multi-table inheritance - 
https://docs.djangoproject.com/en/1.8/topics/db/models/#multi-table-inheritance


Quoting Two Scoops of Django -


At all costs, everyone should avoid multi-table inheritance (see warning above) 
since it adds both confusion and substantial overhead...Adds substantial 
overhead since each query on a child table requires joins with all parent 
tables.

I would like to know if and why having an explicit OneToOneField is better 
than Multi-table inheritance. Also, are there any other better ways to 
model the above relationship?

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/81954b62-2c89-404f-94a5-5f9a485c28c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to