Changeset 6971 for main/waeup.sirp/trunk/src
- Timestamp:
- 31 Oct 2011, 04:35:23 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/hostels
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/hostels/browser_templates/hostelmanagepage.pt
r6970 r6971 67 67 <tr> 68 68 <th> </th> 69 <th> BedId</th>70 <th> BedType</th>71 <th> Sort Id</th>69 <th>Id</th> 70 <th>Type</th> 71 <th>Number</th> 72 72 <th>Owner</th> 73 73 </tr> … … 80 80 </td> 81 81 <td> <a tal:attributes="href value/__name__"> 82 <span tal:content="value/bed_id"> BedId</span>82 <span tal:content="value/bed_id">Id</span> 83 83 </a></td> 84 <td tal:content="value/bed_type"> BedType</td>85 <td tal:content="value/ sort_id">Sort Id</td>84 <td tal:content="value/bed_type">Type</td> 85 <td tal:content="value/bed_number">Number</td> 86 86 <td tal:content="value/owner">Owner</td> 87 87 </tr> -
main/waeup.sirp/trunk/src/waeup/sirp/hostels/hostel.py
r6970 r6971 56 56 beds_for_returning = getattr(self,'beds_for_returning',[]) 57 57 beds_for_final = getattr(self,'beds_for_final',[]) 58 beds_for_all = getattr(self,'beds_for_all',[]) 58 59 beds_reserved = [] #temporarily empty 59 60 all_blocks = blocks_for_female + blocks_for_male 60 61 all_beds = (beds_for_pre + beds_for_fresh + 61 beds_for_returning + beds_for_final )62 beds_for_returning + beds_for_final + beds_for_all) 62 63 #import pdb;pdb.set_trace() 63 64 for block in all_blocks: … … 72 73 if (block,room_nr) in beds_reserved: 73 74 bt = "reserved" 74 # Hostels with special handling and75 # without bed categorisation76 elif (self.special_handling != 'none' and not77 self.special_handling.endswith("_withcat")):78 bt = self.special_handling[3:]79 75 elif bed in beds_for_fresh: 80 76 bt = 'fr' … … 85 81 elif bed in beds_for_returning: 86 82 bt = 're' 87 # Hostels with special handling and 88 # with bed categorisation 89 if (self.special_handling != 'none' and 90 self.special_handling.endswith("_withcat")): 83 # Hostels with special handling 84 if self.special_handling != 'none': 91 85 bt += "_" + self.special_handling 92 86 bt = u'%(sex)s_%(bt)s' % vars() … … 96 90 if bed.bed_type != bt: 97 91 bed.bed_type = bt 98 bed.sort_id = getattr(self,'sort_id',0)99 92 #modified.append('"%(uid)s","%(bt)s","%(bed.owner)s"' % vars()) 100 93 modified_counter += 1 … … 103 96 bed.bed_id = uid 104 97 bed.bed_type = bt 105 bed. sort_id = getattr(self,'sort_id',0)98 bed.bed_number = len(self) + 1 106 99 bed.owner = NOT_OCCUPIED 107 100 self.addBed(bed) -
main/waeup.sirp/trunk/src/waeup/sirp/hostels/interfaces.py
r6970 r6971 45 45 title = u'Floors per Block', 46 46 required = True, 47 default = 3,47 default = 1, 48 48 ) 49 49 … … 51 51 title = u'Rooms per Floor', 52 52 required = True, 53 default = 2 0,53 default = 2, 54 54 ) 55 56 #beds_per_room = schema.Int(57 # title = u'Beds per Room',58 # required = True,59 # default = 6,60 # )61 55 62 56 blocks_for_female = schema.List( … … 95 89 ) 96 90 91 beds_for_all = schema.List( 92 title = u'Beds without category', 93 value_type = schema.Choice( 94 vocabulary = bed_letters 95 ), 96 ) 97 97 98 special_handling = schema.Choice( 98 99 title = u'Special Handling', … … 125 126 raise Invalid('Bed categories overlap.') 126 127 127 #@invariant128 #def numberOfBeds(hostel):129 # bfr = hostel.beds_for_fresh130 # bre = hostel.beds_for_returning131 # bfi = hostel.beds_for_final132 # if len(bfr + bre + bfi) != hostel.beds_per_room:133 # raise Invalid(134 # 'Bed categories and number of beds per room do not match.')135 136 128 class IBed(IWAeUPObject): 137 129 """A base representation of beds. … … 159 151 ) 160 152 161 sort_id= schema.Int(162 title = u' Sort Id',153 bed_number = schema.Int( 154 title = u'Bed Number', 163 155 required = True, 164 default = 100,165 156 ) 166 157
Note: See TracChangeset for help on using the changeset viewer.