Ticket #70 (new compito)

Opened 4 years ago

Last modified 3 years ago

Modifica Modello Product per gestione categorie

Reported by: dom_thual Owned by:
Priority: importante Milestone: SCEGLIAMO - I prodotti vengono inseriti
Component: sviluppo Keywords: categorie prodotto
Cc:

Description

Integrando i dati del prototipo viene evidenziato l'urgenza di trovare una soluzione al Ticket #54 e il Ticket #62

Change History

comment:1 Changed 4 years ago by dom_thual

Proposta di un miste tra

  • Cascading select boxes usando jquery tra categorie e sotto categorie
  • Se necessario usare il modello A "category" Data Model sulla categoria, se necessario. Cioè secondo la granularità desiderata dal consenso GAS-PRODUTTORI-REES-PROVINCIA.

--> sottoporre agli GAS la domanda: Gestione della classificazione dei prodotti

comment:2 Changed 4 years ago by dom_thual

In sostanza:

--class ProductCategory(models.Model, PermissionResource):
+class Category(models.Model, PermissionResource):
+ # Proposal: A "category" Data Model --> the name is in the form MAINCATEGORY1::MAINCATEGORY2::MAINCATEGORY3 ...
+ # like sourceforge categories
+ # http://code.djangoproject.com/wiki/CookBookCategoryDataModelPostMagic
+ name = models.CharField(max_length=255, unique=True, blank=False)
+
+ def unicode(self):
+ return self.name
+
+ class Meta:
+ app_label = 'product'
+ verbose_name = _("Product category")
+ verbose_name_plural = _("Product categories")

+class SubCategory(models.Model, PermissionResource):
+ # The producer specific category
+ # Proposal: use Javascript (jquery) for chaining the cascading lists: Javascript Chain Select Widget
+ category = models.ForeignKey('Category')
+ name = models.CharField(max_length=255)
+ #Use to ovveride alphabetical ordering on name if field is not null
+ order = models.PositiveIntegerField(null=True, blank=True)
+
+ def unicode(self):
+ return self.name
+
+ class Meta:
+ app_label = 'product'
+ verbose_name = _("Product sub category")
+ verbose_name_plural = _("Product sub categories")


class Product(models.Model, PermissionResource):
-- category = models.ForeignKey(ProductCategory)
+ subcategory = models.ForeignKey(SubCategory)

Last edited 4 years ago by dom_thual (previous) (diff)

comment:3 Changed 3 years ago by fero

Aggiungere l'attributo

  • supplier = models.ForeingKey(Supplier)

meglio SupplierCategory

Note: See TracTickets for help on using tickets.