forms.py 文件源码

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

项目:musicbot 作者: AdrienPensart 项目源码 文件源码
def __init__(self, records, precedent, *args, **kwargs):
        #only_csrf = MultiDict([('csrf_token', precedent.get('csrf_token'))])
        #super(FlaskForm, self).__init__(only_csrf, *args, **kwargs)
        super(FlaskForm, self).__init__(precedent, *args, **kwargs)

        genres_choices = [(x, x) for x in records.genres]
        no_genres_choices = genres_choices
        self.genres.choices = genres_choices
        self.no_genres.choices = no_genres_choices

        artists_choices = [(x, x) for x in records.artists]
        self.artists.choices = artists_choices
        self.no_artists.choices = artists_choices

        keywords_choices = [(x, x) for x in records.keywords]
        self.keywords.choices = keywords_choices
        self.no_keywords.choices = keywords_choices

        titles_choices = [(x, x) for x in records.titles]
        self.titles.choices = titles_choices
        self.no_titles.choices = titles_choices

        albums_choices = [(x, x) for x in records.albums]
        self.albums.choices = albums_choices
        self.no_albums.choices = albums_choices
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号