<commit_before>#!/usr/bin/env python
# coding=utf8
__author__ = 'ldath'
from flask_lwadmin.config import ConfigParser
from lightningwolf_smp.utils.user import get_user_filters
from lightningwolf_smp.forms.user import FormUsernameFilter, FormUserBatchActions

filter_data = get_user_filters()

configuration = {
    'list': {
        'pk': {'key': 'id'},
        'display': [
            {'key': 'id', 'label': 'Id'},
            {'key': 'username', 'label': 'Username'},
            {'key': 'email', 'label': 'E-mail'}
        ],
        'actions': [
            {
                'key': 'new',
                'label': 'New',
                'url': 'user.user_create',
                'type': ConfigParser.URL_INTERNAL
            }
        ],
        'object_actions': [
            {
                'key': 'edit',
                'label': 'Edit',
                'url': 'user.user_edit',
                'type': ConfigParser.URL_PK
            },
            {
                'key': 'delete',
                'label': 'Delete',
                'url': 'user.user_del',
                'type': ConfigParser.URL_PK
            }
        ],
        'batch': {
            'url': 'user.user_batch',
            'type': ConfigParser.URL_INTERNAL,
            'form': FormUserBatchActions()
        },
        'filter': {
            'url': 'user.user_filter',
            'type': ConfigParser.URL_INTERNAL,
            'form': FormUsernameFilter(**filter_data)
        }
    }
}<commit_msg>more control on actions<commit_after>#!/usr/bin/env python
# coding=utf8
__author__ = 'ldath'
from flask_lwadmin.config import ConfigParser
from lightningwolf_smp.utils.user import get_user_filters
from lightningwolf_smp.forms.user import FormUsernameFilter, FormUserBatchActions

filter_data = get_user_filters()

configuration = {
    'list': {
        'pk': {'key': 'id'},
        'display': [
            {'key': 'id', 'label': 'Id'},
            {'key': 'username', 'label': 'Username'},
            {'key': 'email', 'label': 'E-mail'}
        ],
        'actions': [
            {
                'key': 'new',
                'label': 'New',
                'url': 'user.user_create',
                'type': ConfigParser.URL_INTERNAL
            }
        ],
        'object_actions': [
            {
                'key': 'edit',
                'label': 'Edit',
                'url': 'user.user_edit',
                'type': ConfigParser.URL_PK,
                'icon': 'icon-edit'
            },
            {
                'key': 'delete',
                'label': 'Delete',
                'url': 'user.user_del',
                'type': ConfigParser.URL_PK,
                'icon': 'icon-trash icon-white'
            }
        ],
        'batch': {
            'url': 'user.user_batch',
            'type': ConfigParser.URL_INTERNAL,
            'form': FormUserBatchActions()
        },
        'filter': {
            'url': 'user.user_filter',
            'type': ConfigParser.URL_INTERNAL,
            'form': FormUsernameFilter(**filter_data)
        }
    }
}
{'fraction_non_alphanumeric': 0.15061808718282368, 'fraction_numerical': 0.0006506180871828237, 'mean_word_length': 1.5122549019607843, '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': '1074773', 'n_tokens_mistral': 904, 'n_tokens_neox': 868, 'n_words': 164}