Saturday, June 29, 2019

Re: what's a good approach for building a product model in a django multi-vendor eCommerce system?

You can use Choices - https://docs.djangoproject.com/en/2.2/ref/models/fields/#choices

On Saturday, June 29, 2019 at 3:17:04 AM UTC-5, Arya wrote:
as you know eCommerce websites consist of various types of products and attributes.
there are digital products as well as physical products.
there are many different attributes that are assigned to a specific type of product.

i need a good example to build such a system in django.

what i know is that i need to create an app for products and create a class for the product type and then later you lookup the data in the database using this fields:

class Product(models.Model):
title = models.CharField(max_length=200)
...
...
...
a
but what if i want my users (vendors) to be able to define an attribute for their product model that is not pre-defined by me?
say a shoe might have a size field(attribute) but a memory may have a capacity attribute. a developer can't predefine everything.

woocommerce in WordPress has a system that enables admins to add global attributes for product types that is usable and see-able by all vendors.
vendors can also define local attributes only seen by themselves.

how do you perform such a task in django? are there any good articles/tutorials on this subject that covers everything?

thank you

--
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+unsubscribe@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/188364d5-9cf3-4cb8-9833-638c82ce273f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment