I'm making a model to order several items that I want to attach to a catalog. I can not wrap my head in the right way to do this, it makes sense to me that with a lot of relation with the foreign key for the item list and then the order catalog. This catalog gives the object itself in its own order, not the catalog item.
This is my model:
class articles (models.Model): catalog = models.ForeignKey (list, related_name = 'articles_products', empty = true, zero = True) title = model.carfield (max_long = 200) abstract = model. TextField (max_ length = 1000, empty = true) full_text = model. TextField (empty = true) def __unicode __ (self): return Unicode (self-titled) class catalog (models.Model): pass def __unicode __ (self): Return Unicode (self.id) class command (models.Model) : Choose user = models.ForeignKey (user, related_name = 'joe_order') = models Many tommyfields (catalogs, related_name = 'valve_ordered', empty = true, empty = true) def __unicode __ (self): return unicode (self. User)
I attached an image to the administrator : Some other items are attached in this image but it shows the problem Instead of creating a new catalog order, I want to be able to select from the items in the catalog to create a new order.
< / Html>
Comments
Post a Comment