from django.core import models from shuup.core import models as shuup_models class MyProduct(models.Model): product = models.OneToOneField(shuup_models.Product) # fields of the extension... my_field = models.CharField(max_length=10) ...
Check multi-table-inheritance for extending models
Even though basic models cannot be replaced, it is possible to
User model. See
Polymorphic models (like
Contact) can be
extended by inheritance. The polymorphic base class has a
manager that makes sure that the returned
objects are correct type. For example, when getting all
Contacts with a query like
Contact.objects.all(), the returned
QuerySet may have instances of
CompanyContact and your custom class.
See django-polymorphic’s documentation for details.