In django what is a SKU?
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.
精彩评论