在奥斯卡,台词是什么?

In Oscar, what is a line?

我正在使用电子商务包 Django-Oscar。在 Oscar 中有一个与 Basket 相关的对象,称为 "Line" 我不明白。什么是线,它传达什么信息,代表什么意思?

这是购物篮中的一件商品:

int single word "BasketItem"
""" product and a quantity """

参考:https://github.com/django-oscar/django-oscar/blob/master/src/oscar/apps/basket/abstract_models.py#L564

我已经使用 Django-Oscar 两年了。这是非常原始的包裹。 一条线是篮子中的一条记录。 您可以在源模型 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"))</p>

<pre><code># 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)