'Reactivity', 'Other'],
[Healths, Fires,
Reactivities, Others]) :
- string += " \multicolumn{3}{c}{\Tstrut %s : %s} \\\\\n" \
- % (name, NFPA_maxs[field])
+ if (not hasattr(NFPA_maxs[field], '__len__')) \
+ or len(NFPA_maxs[field]) > 0 :
+ string += " \multicolumn{3}{c}{\Tstrut %s : %s} \\\\\n" \
+ % (name, NFPA_maxs[field])
+ else : # Print "Other" instead of "Other : []"
+ string += " \multicolumn{3}{c}{\Tstrut %s} \\\\\n" \
+ % (name)
for db_id in array :
record = self.db.record(db_id)
string += " %s & %s & %s \\\\\n" \
update = False
for field in db.field_list() :
if newvals[field] != record[field] :
+ # TODO: add validation!
update=True
record[field] = newvals[field]
if 'MSDS source' in newvals :
if name == 'door_warning.pdf' :
path = dgen.door_warning()
print file(path, 'rb').read() ,
-
+ def POST(self, name):
+ """
+ Read the form input and print the appropriate file.
+ """
+ db._refresh()
+ formdata = web.input()
+ user_regexp = formdata['regexp']
+ regexp = self.validate_string(user_regexp)
+ path = dgen.door_warning(lambda r: r['Location'] == regexp ) # no regexp matching yet, work in progress
+ print file(path, 'rb').read() ,
+ def validate_string(self, string): # work in progress
+ return string
class login (object) :
"Print an alphabetized index of all existing pages"