2
# SchoolTool - common information systems platform for school administration
3
# Copyright (c) 2015 Shuttleworth Foundation
5
# This program is free software; you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 2 of the License, or
8
# (at your option) any later version.
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
15
# You should have received a copy of the GNU General Public License
16
# along with this program. If not, see <http://www.gnu.org/licenses/>.
19
Evolve database to generation 1.
21
Adds new student fields
24
from zope.app.generations.utility import getRootFolder
26
from schooltool.basicperson.interfaces import IDemographicsFields
27
from schooltool.basicperson.demographics import TextFieldDescription
28
from schooltool.isli import IsliMessage as _
32
app = getRootFolder(context)
33
dfs = IDemographicsFields(app)
34
if 'mother_name' not in dfs:
35
dfs['mother_name'] = TextFieldDescription(
36
'mother_name', _('Mother name'),
37
limit_keys=['students'])
38
if 'father_name' not in dfs:
39
dfs['father_name'] = TextFieldDescription(
40
'father_name', _('Father name'),
41
limit_keys=['students'])
42
if 'economic_weakness' not in dfs:
43
dfs['economic_weakness'] = TextFieldDescription(
44
'economic_weakness', _('Economic weakness'),
45
limit_keys=['students'])