python - Formatting A ManyToManyField in to boxes with Django -
i having trouble formatting. here's code looks right now:
as can see have product field , price field each 1 of products. how can product , price in separate boxes else?
here's code:
class purchaseorder(models.model): product = models.manytomanyfield('product', null =true) def get_products(self): return "<br />".join("%s --- $%s" % (p.products, p.price_for_each_item) p in self.product.all()) get_products.allow_tags = true get_products.short_description = "product --- price" class product(models.model): products = models.charfield(max_length=256, null =true) price_for_each_item = models.floatfield(verbose_name = "price") def __unicode__(self): return self.products
Comments
Post a Comment