widgets.py 文件源码

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

项目:django-localized-fields 作者: SectorLabs 项目源码 文件源码
def decompress(self, value: LocalizedValue) -> List[str]:
        """Decompresses the specified value so
        it can be spread over the internal widgets.

        Arguments:
            value:
                The :see:LocalizedValue to display in this
                widget.

        Returns:
            All values to display in the inner widgets.
        """

        result = []
        for lang_code, _ in settings.LANGUAGES:
            if value:
                result.append(value.get(lang_code))
            else:
                result.append(None)

        return result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号