当我阅读django代码时,我经常在模型中看到所谓的"sku"和"slug".例如:
name = models.CharField(_("Full Name"), max_length=255, blank=False,
help_text=_("This is what the product will be called in the default site language. To add non-default translations, use the Product Translation section below."))
slug = models.SlugField(_("Slug Name"), blank=True,
help_text=_("Used for URLs, auto-generated from name if blank"), max_length=255)
sku = models.CharField(_("SKU"), max_length=255, blank=True, null=True,
help_text=_("Defaults to slug if left blank"))
Run Code Online (Sandbox Code Playgroud)
我不确定与slug URL的关系是什么.
这个SKU应该如何以及何时使用?
SKU是Stock-Keeping Unit的缩写.
库存单位或SKU是可以购买的每种不同产品和服务的唯一标识符.SKU的使用植根于数据管理,使公司能够系统地跟踪其库存或产品可用性,例如仓库和零售店.它们通常在商家级别进行分配和序列化.每个SKU都附加到项目,变体,产品系列,捆绑,服务,费用或附件.
归档时间: |
|
查看次数: |
1370 次 |
最近记录: |