how Category and subcategory

pls how do i create a django category with sub-categories

After a quick Google search, I found this article:

For future posts, please provide more detail into what you’re trying to accomplish :slight_smile:

1 Like

actually i am trying to build an ecommerce platform with categories of product such as
phones
—samsung
— oppo
TV
—LG
—Akira

Gotcha! If that’s the case, I would recommend looking up integer choice fields in the Django official documentation :slight_smile:

yeah but i will like the choices not to be hard coded
rather to be supplied from the front end

So at this point it would be a lot more helpful if you provided all the key details about exactly what it is you’d like to see or have happen.

  • What is it you want your users to see?
  • What data do you want them to enter?
  • What do you want to do with that data they enter?

The more details you provide, the better our chances are of providing you with information that you can use.

when a user want to upload a product he can fill up the product form and select a category or the product. i the category doesn’t exist he can click on the add category button to add a category. say
Cars.
he can now add a subcategory under Cars, i he wants before adding the products. something like…
Cars
—Toyota
—Tesla

the user might be able to do this using the edit category view

worked like magic… thanks a lot