- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
class Column(object):
"""
Элемент конфигурации
"""
def __init__(self, *args, **kwargs):
hid = False
filters = []
sorters = []
if len(args) == 3:
inner_name, verbose_name, width = args
elif len(args) == 2:
inner_name, verbose_name = args
width = 20
elif len(args) == 4:
inner_name, verbose_name, width, hid = args
elif len(args) == 5:
inner_name, verbose_name, width, hid, filters = args
elif len(args) == 6:
inner_name, verbose_name, width, hid, filters, sorters = args
special_attrs = ['locked', 'editable']
self.code = inner_name
self.name = verbose_name
self.width = width
self.hidden = hid
self.idx = 0
if sorters:
sorters.column = self
if filters:
filters.column = self
filters.code = self.code
#здесь хранятся экземпляры фильтров для колонок
self.filters = filters
#здесь хранятся экземпляры сортировщиков для колонок
self.sorters = sorters
def get_config(self):
''' ?
'''
config = dict()
config['data_index'] = self.code
config['header'] = self.name
config['width'] = self.width
config['hidden'] = self.hidden
return config