def checkbox(value): return True if value == "on" else False def safe_int(value): try: return int(value) except: return 0