helpers.py 文件源码

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

项目:django-smart-lists 作者: plecto 项目源码 文件源码
def get_values(self):
        values = []
        if self.model_field.choices:
            values = [
                SmartFilterValue(self.field_name, choice[1], choice[0], self.query_params) for choice in self.model_field.choices
            ]
        elif type(self.model_field) == BooleanField:
            values = [
                SmartFilterValue(self.field_name, choice[1], choice[0], self.query_params) for choice in (
                    (1, _('Yes')),
                    (0, _('No'))
                )
            ]

        return [SmartFilterValue(self.field_name, _("All"), None, self.query_params)] + values
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号