django-oscar / django-oscar

Domain-driven e-commerce for Django

Home Page:http://oscarcommerce.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

variant: how to inherit some of the parent fields

Chrescht opened this issue · comments

I am looking to setup a model for wine, and I'm wondering how to efficiently set up the variants.
There is a new variant every year having the same

  • name
  • wine type (red, rosé, white, ..)
    but different
  • grape varieties (cépage in French)
  • price
  • vintage

This is not an urgent oscar issue but I hope it's still is a valid question because of the parent inheritance.

Technical details

  • Python version: 3.10.12
  • Django version: 4.2.6
  • Oscar version: 3.2.2

Ok, perfect, thanks @viggo-devries
I take it for the grape variety, since it's not a trivial attribute, I have to add a custom one?
E.g. it's several types of percentages adding up to 100%.

Ok but the variety itself is of a more complex i.e. non-trivial type so I would have to add it with a custom model.

  • variety is a combination of one or several grapes.
  • every grape has a given percentage.
  • total percentage has to add up to 100.

Hi the issue tracker is for reporting bugs, if you need help please ask elsewhere.

A little harsh but I get it :-)
I did ask in the Google group but got no replies.