__init__.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:planet-b-saleor 作者: planet-b 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号