Adding a dynamic parameter list to the model

Hi, everybody! I have a model product

class Product(models.Model):
    name = models.CharField(max_length=30)
    # some other fields like updated_at

    parameters = # ????

Each product can have several parameters (you can think of it as a characteristic, like height width width, depth)
They are unique for each product (or common for products in the same category).
I can’t figure out how to make these parameters?

I’m right that the best choice would be:

parameters = models.JSONField()

I would like to be able to edit these parameters on the frontend side and this is also a problem, how to do it? Maybe next js (or something similar) has something built in for this.

Does it make sense to separate the paramaters field into a separate model?

If you already know the parameters that each product will have, then i suggest that you store this information on another model, that relates to your product model, and by each category you can make that a product is required to have that relation.

class ProductDimension(models.Model):
  product = models.OneToOneField(to=Product, ...)
  width = ...

For the categories, you can have this control by the category type, or if categories are added by the database, you can have some flags on the Category model on how to control this behavior, example:

class Category(models.Model):
  name = models.CharField()
  requires_dimension = models.BooleanField()

[The above code is simplified and will not work as-is]