from the_tale.game.map.relations import TERRAIN from the_tale.game import relations as game_relations from . import forms from . import logic from . import storage from . import relations from . import meta_relations BASE_INDEX_FILTERS = [list_filter.reset_element(), list_filter.choice_element('тип:', attribute='type', choices=[(None, 'все')] + sorted(list(beings_relations.TYPE.select('value', 'text')), key=lambda x: x[1])), list_filter.choice_element('архетип:', attribute='archetype', choices=[(None, 'все')] + sorted(list(game_relations.ARCHETYPE.select('value', 'text')), key=lambda x: x[1])), list_filter.choice_element('территория:', attribute='terrain', choices=[(None, 'все')] + sorted(list(TERRAIN.select('value', 'text')), key=lambda x: x[1])), list_filter.choice_element('сортировка:', attribute='order_by', choices=relations.INDEX_ORDER_TYPE.select('value', 'text'), default_value=relations.INDEX_ORDER_TYPE.BY_NAME.value) ] MODERATOR_INDEX_FILTERS = BASE_INDEX_FILTERS + [list_filter.choice_element('состояние:', attribute='state', default_value=relations.MOB_RECORD_STATE.ENABLED.value, choices=relations.MOB_RECORD_STATE.select('value', 'text'))] class UnloginedIndexFilter(list_filter.ListFilter): ELEMENTS = BASE_INDEX_FILTERS
'тип:', attribute='type', choices=[(None, 'все')] + sorted(list(game_relations.BEING_TYPE.select('value', 'text')), key=lambda x: x[1])), list_filter.choice_element( 'архетип:', attribute='archetype', choices=[(None, 'все')] + sorted(list(game_relations.ARCHETYPE.select('value', 'text')), key=lambda x: x[1])), list_filter.choice_element( 'территория:', attribute='terrain', choices=[(None, 'все')] + sorted(list(TERRAIN.select('value', 'text')), key=lambda x: x[1])), list_filter.choice_element('сортировка:', attribute='order_by', choices=INDEX_ORDER_TYPE.select( 'value', 'text'), default_value=INDEX_ORDER_TYPE.BY_NAME.value) ] MODERATOR_INDEX_FILTERS = BASE_INDEX_FILTERS + [ list_filter.choice_element('состояние:', attribute='state', default_value=MOB_RECORD_STATE.ENABLED.value, choices=MOB_RECORD_STATE.select( 'value', 'text')) ]
from the_tale.game.map.relations import TERRAIN from the_tale.game import relations as game_relations from .relations import MOB_RECORD_STATE, INDEX_ORDER_TYPE from .prototypes import MobRecordPrototype from .storage import mobs_storage from .forms import MobRecordForm, ModerateMobRecordForm from . import meta_relations BASE_INDEX_FILTERS = [list_filter.reset_element(), list_filter.choice_element('тип:', attribute='type', choices=[(None, 'все')] + sorted(list(game_relations.BEING_TYPE.select('value', 'text')), key=lambda x: x[1])), list_filter.choice_element('архетип:', attribute='archetype', choices=[(None, 'все')] + sorted(list(game_relations.ARCHETYPE.select('value', 'text')), key=lambda x: x[1])), list_filter.choice_element('территория:', attribute='terrain', choices=[(None, 'все')] + sorted(list(TERRAIN.select('value', 'text')), key=lambda x: x[1])), list_filter.choice_element('сортировка:', attribute='order_by', choices=INDEX_ORDER_TYPE.select('value', 'text'), default_value=INDEX_ORDER_TYPE.BY_NAME.value) ] MODERATOR_INDEX_FILTERS = BASE_INDEX_FILTERS + [list_filter.choice_element('состояние:', attribute='state', default_value=MOB_RECORD_STATE.ENABLED.value, choices=MOB_RECORD_STATE.select('value', 'text'))] class UnloginedIndexFilter(list_filter.ListFilter): ELEMENTS = BASE_INDEX_FILTERS class ModeratorIndexFilter(list_filter.ListFilter):