Changeset 623 in tmcsimulator for branches/LCSv2/controllers/default.py
- Timestamp:
- 08/29/2020 08:19:30 AM (6 years ago)
- File:
-
- 1 edited
-
branches/LCSv2/controllers/default.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/LCSv2/controllers/default.py
r622 r623 3 3 hwys = ['','1','5', '22', '55', '57', '73', '74', '91', '133', '142', '241', '261', '405', '605'] 4 4 hwyDirections = ['','NB', 'SB', 'NB/SB','EB','WB','EB/WB'] 5 # Names to appeaer in the username dropdown box 6 users = [] 5 7 # Show the login page 6 8 def index(): 7 form = FORM(LABEL('Username:',_for='username', _class="label username-label"), 8 INPUT(_name='username', _size='15', _style="font-size: 18px;"), BR(), 9 userfile = open('student_names.txt','r') 10 users = [line.strip() for line in userfile.readlines()] 11 users.insert(0,'') 12 form = FORM(LABEL('User:',_for='username', _class="label username-label"), 13 #INPUT(_name='username', _size='15', _style="font-size: 18px;"), BR(), 14 SELECT(users,_name='username',requires=IS_LENGTH(minsize=1,error_message='Must select a user from the list.')),BR(), 9 15 INPUT(_type='submit',_value="Log in", _class=" btn btn-primary", _style="margin-top: 3%;")) 10 16 if form.process().accepted: … … 298 304 # Calculate the closure id to assign to the new closure 299 305 def calcNextClosureID(routeNum): 300 # Retrieve any existing closures on this route 301 item = db(db.closures.closureid.startswith('T'+routeNum)).select().last() # Might need to sort these 306 # Retrieve the last existing closure on this route 307 #item = db(db.closures.closureid.startswith('T'+routeNum)).select().last() # defective 308 item = db(db.closures.route == routeNum).select().last() 302 309 if (item != None): 303 310 currID = item.closureid
Note: See TracChangeset
for help on using the changeset viewer.
