开发者

In django what is a SKU?

开发者 https://www.devze.com 2022-12-20 16:59 出处:网络
When I read django code I often see in models what is called \"sku\", and \"slug\". E.g: name = models.CharField(_(\"Full Name\"), max_length=255, blank=False,

When I read django code I often see in models what is called "sku", and "slug". E.g:

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 secti开发者_如何学运维on 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"))

I am not sure what is the relation with the slug URLs.

How and when is this SKU supposed to be used?


SKU is an abbreviation for Stock-Keeping Unit.

A stock-keeping unit or SKU is a unique identifier for each distinct product and service that can be purchased. SKU use is rooted in data management, enabling the company to systematically track its inventory or product availability, such as in warehouses and retail outlets. They are often assigned and serialized at the merchant level. Each SKU is attached to an item, variant, product line, bundle, service, fee, or attachment.


A slug is a url-friendly and SEO-friendly identifier for a resource on your website. For a more thorough description and examples you could check out Wordpress' definition. Slugs have a limited allowable character set, hence the custom Django field type.

A SKU is a "Stock Keeping Unit" which is a unique identifier for an item (generally used in retail businesses or manufacturing, but can be used elsewhere). They can be any alpha-numeric character.


SKU is usually a product id number.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号