<commit_before>from flask.ext.admin import Admin
from flask.ext.admin.contrib.sqla import ModelView
from mptracker import models
from mptracker.auth import is_privileged

admin = Admin(name="MP Tracker")


class AuthView(ModelView):

    can_create = False
    can_edit = False
    can_delete = False

    def is_accessible(self):
        return is_privileged()

admin.add_view(AuthView(models.StenoChapter, models.db.session))
admin.add_view(AuthView(models.StenoParagraph, models.db.session))
admin.add_view(AuthView(models.User, models.db.session))
admin.add_view(AuthView(models.County, models.db.session))


class PersonView(AuthView):

    column_searchable_list = ['name']

admin.add_view(PersonView(models.Person, models.db.session))


class QuestionView(AuthView):

    column_searchable_list = ['title']

admin.add_view(QuestionView(models.Question, models.db.session))<commit_msg>search in question title and text<commit_after>from flask.ext.admin import Admin
from flask.ext.admin.contrib.sqla import ModelView
from mptracker import models
from mptracker.auth import is_privileged

admin = Admin(name="MP Tracker")


class AuthView(ModelView):

    can_create = False
    can_edit = False
    can_delete = False

    def is_accessible(self):
        return is_privileged()

admin.add_view(AuthView(models.StenoChapter, models.db.session))
admin.add_view(AuthView(models.StenoParagraph, models.db.session))
admin.add_view(AuthView(models.User, models.db.session))
admin.add_view(AuthView(models.County, models.db.session))


class PersonView(AuthView):

    column_searchable_list = ['name']

admin.add_view(PersonView(models.Person, models.db.session))


class QuestionView(AuthView):

    column_searchable_list = ['title', 'text']

admin.add_view(QuestionView(models.Question, models.db.session))
{'fraction_non_alphanumeric': 0.10883977900552486, 'fraction_numerical': 0.0, 'mean_word_length': 5.633699633699634, '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': '1259194', 'n_tokens_mistral': 595, 'n_tokens_neox': 570, 'n_words': 107}