def get_display(status):
if status == ProductAvailabilityStatus.NOT_PUBLISHED:
return pgettext_lazy('Product status', 'not published')
elif status == ProductAvailabilityStatus.VARIANTS_MISSSING:
return pgettext_lazy('Product status', 'variants missing')
elif status == ProductAvailabilityStatus.NOT_CARRIED:
return pgettext_lazy('Product status', 'not carried')
elif status == ProductAvailabilityStatus.OUT_OF_STOCK:
return pgettext_lazy('Product status', 'out of stock')
elif status == ProductAvailabilityStatus.LOW_STOCK:
return pgettext_lazy('Product status', 'stock running low')
elif status == ProductAvailabilityStatus.NOT_YET_AVAILABLE:
return pgettext_lazy('Product status', 'not yet available')
elif status == ProductAvailabilityStatus.READY_FOR_PURCHASE:
return pgettext_lazy('Product status', 'ready for purchase')
else:
raise NotImplementedError('Unknown status: %s' % status)
评论列表
文章目录