Ignore:
Timestamp:
12 Nov 2015, 06:15:44 (9 years ago)
Author:
Henrik Bettermann
Message:

Only hostel sort ids below 100 are allowed.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/hostels
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/hostels/interfaces.py

    r13346 r13442  
    2929    NOT_OCCUPIED)
    3030
     31# Define a validation method for sort ids
     32class NotASortId(schema.ValidationError):
     33    __doc__ = u"Invalid sort_id"
     34
     35def validate_sort_id(value):
     36    if not value < 100:
     37        raise NotASortId(value)
     38    return True
     39
    3140class IHostelsContainer(IKofaObject):
    3241    """A container for hostel objects.
     
    102111        required = True,
    103112        default = 10,
     113        constraint=validate_sort_id,
    104114        )
    105115
  • main/waeup.kofa/trunk/src/waeup/kofa/hostels/sample_hostel_data.csv

    r13346 r13442  
    88[],"['A', 'B']","['E', 'F']",['G'],"['C', 'D']",['G'],[],1,block-g-down-hostel,Block G Down Hostel,32,80,regular
    99[],"['A', 'B']","['D', 'E']",['F'],['C'],[],"['A', 'B']",1,hall-a,Hall A,44,90,regular
    10 [],"['A', 'B']","['D', 'E']",['F'],['C'],[],"['C', 'D']",1,hall-b,Hall B,44,100,regular
     10[],"['A', 'B']","['D', 'E']",['F'],['C'],[],"['C', 'D']",1,hall-b,Hall B,44,99,regular
    1111[],[],[],[],[],[],['A'],1,stores-32,Stores 32,16,10,regular
Note: See TracChangeset for help on using the changeset viewer.