Last change
on this file since 6957 was
6956,
checked in by Henrik Bettermann, 14 years ago
|
Add more fields and fix code.
|
-
Property svn:keywords set to
Id
|
File size:
1.3 KB
|
Rev | Line | |
---|
[6951] | 1 | ## |
---|
| 2 | ## interfaces.py |
---|
| 3 | from zope.interface import Attribute, invariant |
---|
| 4 | from zope import schema |
---|
| 5 | from waeup.sirp.interfaces import IWAeUPObject |
---|
| 6 | |
---|
| 7 | class IHostelsContainer(IWAeUPObject): |
---|
| 8 | """A container for all kind of hostel objects. |
---|
| 9 | |
---|
| 10 | """ |
---|
| 11 | |
---|
| 12 | class IHostel(IWAeUPObject): |
---|
| 13 | """A base representation of hostels. |
---|
| 14 | |
---|
| 15 | """ |
---|
[6952] | 16 | |
---|
| 17 | def loggerInfo(ob_class, comment): |
---|
| 18 | """Adds an INFO message to the log file |
---|
| 19 | """ |
---|
| 20 | |
---|
[6956] | 21 | #hostel_id = Attribute('Hostel Id') |
---|
| 22 | |
---|
[6952] | 23 | hostel_id = schema.TextLine( |
---|
[6956] | 24 | title = u'Hostel Id', |
---|
| 25 | readonly = True, |
---|
| 26 | ) |
---|
| 27 | |
---|
| 28 | sort_id = schema.Int( |
---|
| 29 | title = u'Sort Id', |
---|
[6954] | 30 | required = True, |
---|
[6956] | 31 | default = 10, |
---|
| 32 | ) |
---|
| 33 | |
---|
| 34 | hostel_name = schema.TextLine( |
---|
| 35 | title = u'Hall Name', |
---|
| 36 | required = True, |
---|
[6954] | 37 | default = u'hostel_1', |
---|
[6956] | 38 | ) |
---|
| 39 | |
---|
| 40 | nr_of_blocks = schema.Int( |
---|
| 41 | title = u'Number of Blocks', |
---|
| 42 | required = True, |
---|
| 43 | default = 3, |
---|
| 44 | ) |
---|
| 45 | |
---|
| 46 | nr_of_floors = schema.Int( |
---|
| 47 | title = u'Number of Blocks', |
---|
| 48 | required = True, |
---|
| 49 | default = 3, |
---|
| 50 | ) |
---|
| 51 | |
---|
| 52 | rooms_per_floor = schema.Int( |
---|
| 53 | title = u'Number of Blocks', |
---|
| 54 | required = True, |
---|
| 55 | default = 20, |
---|
| 56 | ) |
---|
| 57 | |
---|
| 58 | beds_per_room = schema.Int( |
---|
| 59 | title = u'Number of Blocks', |
---|
| 60 | required = True, |
---|
| 61 | default = 6, |
---|
| 62 | ) |
---|
| 63 | |
---|
Note: See
TracBrowser for help on using the repository browser.