|
@@ -0,0 +1,16 @@
|
|
1
|
+#-*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+from . import char
|
|
4
|
+
|
|
5
|
+class EmFieldType(char.EmFieldType):
|
|
6
|
+ help = 'Automatic string field, defined as concatenation of other fields'
|
|
7
|
+
|
|
8
|
+ def __init__(self, field_list, max_length, **kwargs):
|
|
9
|
+ self._field_list = field_list
|
|
10
|
+ super().__init__(internal='automatic', max_length = max_length)
|
|
11
|
+
|
|
12
|
+ def _construct_data(self, lec, fname, datas, cur_value):
|
|
13
|
+ ret = ''
|
|
14
|
+ for fname in self._field_list:
|
|
15
|
+ ret += datas[fname]
|
|
16
|
+ return ret
|