我正在使用电子商务软件包Django-Oscar。在奥斯卡,有一个与篮子相关的物体称为“线”,我不明白。什么是Line,它传达了什么信息以及它代表什么?
答案 0 :(得分:2)
这是一个项目:
int single word "BasketItem"
""" product and a quantity """
答案 1 :(得分:1)
我已经使用了Django-Oscar 2年了。这是非常原始的包装。 一条线是篮子中的一条记录。 您可以在源模型AbstractLine中看到它。
class AbstractLine(models.Model):
"""
A line of a basket (product and a quantity)
"""
basket = models.ForeignKey('basket.Basket', related_name='lines',
verbose_name=_("Basket"))
# This is to determine which products belong to the same line
# We can't just use product.id as you can have customised products
# which should be treated as separate lines. Set as a
# SlugField as it is included in the path for certain views.
line_reference = models.SlugField(_("Line Reference"), max_length=128,
db_index=True)
product = models.ForeignKey(
'catalogue.Product', related_name='basket_lines',
verbose_name=_("Product"))
quantity = models.PositiveIntegerField(_('Quantity'), default=1)
# We store the unit price incl tax of the product when it is first added to
# the basket. This allows us to tell if a product has changed price since
# a person first added it to their basket.
price_excl_tax = models.DecimalField(
_('Price excl. Tax'), decimal_places=2, max_digits=12,
null=True)
price_incl_tax = models.DecimalField(
_('Price incl. Tax'), decimal_places=2, max_digits=12, null=True)
# Track date of first addition
date_created = models.DateTimeField(_("Date Created"), auto_now_add=True)