Advertisement
khangnguyen

Untitled

Aug 24th, 2011
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. def render_scheduleFollowUp(request):
  2.     errors = []
  3.     try:
  4.         studentID = int(request.resource.args[0])
  5.     student = store.get(Student, studentID)
  6.     except Exception:
  7.         return _error("Student not found")
  8.  
  9.     try: fields = json.load(request.content)[0][u'fields']
  10.     except Exception: return _error("Fields not found")
  11.  
  12.     try:
  13.         method = fields["method"].encode("utf-8")
  14.     except Exception:
  15.         return errors.append(("followup-n1-method", "Invliad value"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement