1 | ## |
---|
2 | ## interfaces.py |
---|
3 | from zope.interface import Attribute, invariant |
---|
4 | from zope import schema |
---|
5 | from waeup.sirp.interfaces import IWAeUPObject |
---|
6 | from waeup.sirp.hostels.vocabularies import bed_letters, blocks |
---|
7 | |
---|
8 | class IHostelsContainer(IWAeUPObject): |
---|
9 | """A container for all kind of hostel objects. |
---|
10 | |
---|
11 | """ |
---|
12 | |
---|
13 | class IHostel(IWAeUPObject): |
---|
14 | """A base representation of hostels. |
---|
15 | |
---|
16 | """ |
---|
17 | |
---|
18 | def loggerInfo(ob_class, comment): |
---|
19 | """Adds an INFO message to the log file |
---|
20 | """ |
---|
21 | |
---|
22 | hostel_id = schema.TextLine( |
---|
23 | title = u'Hostel Id', |
---|
24 | readonly = True, |
---|
25 | ) |
---|
26 | |
---|
27 | sort_id = schema.Int( |
---|
28 | title = u'Sort Id', |
---|
29 | required = True, |
---|
30 | default = 10, |
---|
31 | ) |
---|
32 | |
---|
33 | hostel_name = schema.TextLine( |
---|
34 | title = u'Hall Name', |
---|
35 | required = True, |
---|
36 | default = u'Hall 1', |
---|
37 | ) |
---|
38 | |
---|
39 | nr_of_blocks = schema.Int( |
---|
40 | title = u'Number of Blocks', |
---|
41 | required = True, |
---|
42 | default = 3, |
---|
43 | ) |
---|
44 | |
---|
45 | floors_per_block = schema.Int( |
---|
46 | title = u'Floors per Block', |
---|
47 | required = True, |
---|
48 | default = 3, |
---|
49 | ) |
---|
50 | |
---|
51 | rooms_per_floor = schema.Int( |
---|
52 | title = u'Rooms per Floor', |
---|
53 | required = True, |
---|
54 | default = 20, |
---|
55 | ) |
---|
56 | |
---|
57 | beds_per_room = schema.Int( |
---|
58 | title = u'Beds per Room', |
---|
59 | required = True, |
---|
60 | default = 6, |
---|
61 | ) |
---|
62 | |
---|
63 | blocks_for_female = schema.List( |
---|
64 | title = u'Blocks for Female Students', |
---|
65 | value_type = schema.Choice( |
---|
66 | vocabulary = blocks |
---|
67 | ), |
---|
68 | ) |
---|
69 | |
---|
70 | beds_for_fresh = schema.List( |
---|
71 | title = u'Beds for Fresh Students', |
---|
72 | value_type = schema.Choice( |
---|
73 | vocabulary = bed_letters |
---|
74 | ), |
---|
75 | ) |
---|
76 | |
---|
77 | beds_for_final = schema.List( |
---|
78 | title = u'Beds for Final Year Students', |
---|
79 | value_type = schema.Choice( |
---|
80 | vocabulary = bed_letters |
---|
81 | ), |
---|
82 | ) |
---|