<commit_before>from flask_admin.contrib.sqla import ModelView

from arguments import admin
from arguments.database.datamodel import *


class BaseAdminView(ModelView):

    def __init__(self, model, session=db.session, *args, **kwargs):
        super(BaseAdminView, self).__init__(model, session, *args, **kwargs)


admin.add_view(BaseAdminView(User, category="User"))
admin.add_view(BaseAdminView(UserGroup, category="User"))
admin.add_view(BaseAdminView(Question, category="Content"))
admin.add_view(BaseAdminView(Argument, category="Content"))
admin.add_view(BaseAdminView(Tag, category="Content"))
admin.add_view(BaseAdminView(QuestionVote, category="Vote"))
admin.add_view(BaseAdminView(ArgumentVote, category="Vote"))<commit_msg>exclude unwanted columns in user admin view<commit_after>from flask_admin.contrib.sqla import ModelView

from arguments import admin
from arguments.database.datamodel import *


class BaseAdminView(ModelView):

    def __init__(self, model, session=db.session, *args, **kwargs):
        super(BaseAdminView, self).__init__(model, session, *args, **kwargs)


class QuestionView(ModelView):
    column_exclude_list = ("details", "search_vector")

    def __init__(self, session=db.session, *args, **kwargs):
        super(QuestionView, self).__init__(Question, session, category="Content", *args, **kwargs)


admin.add_view(BaseAdminView(User, category="User"))
admin.add_view(BaseAdminView(UserGroup, category="User"))
admin.add_view(QuestionView())
admin.add_view(BaseAdminView(Argument, category="Content"))
admin.add_view(BaseAdminView(Tag, category="Content"))
admin.add_view(BaseAdminView(QuestionVote, category="Vote"))
admin.add_view(BaseAdminView(ArgumentVote, category="Vote"))
{'fraction_non_alphanumeric': 0.13372093023255813, 'fraction_numerical': 0.0, 'mean_word_length': 8.456043956043956, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7128760', 'n_tokens_mistral': 524, 'n_tokens_neox': 508, 'n_words': 96}