Advertisement
Guest User

Untitled

a guest
Apr 21st, 2014
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. {
  2. "_updated": "Sun, 06 Apr 2014 12:49:11 GMT",
  3. "name": "moody",
  4. "question": "how are you?",
  5. "_links": {
  6. "self": {
  7. "href": "127.0.0.1:5000/surveys/533e9f88936aa21dd410d4f1",
  8. "title": "Survey"
  9. },
  10. "parent": {
  11. "href": "127.0.0.1:5000",
  12. "title": "home"
  13. },
  14. "collection": {
  15. "href": "127.0.0.1:5000/surveys",
  16. "title": "surveys"
  17. }
  18. },
  19. "_created": "Fri, 04 Apr 2014 12:03:20 GMT",
  20. "_id": "533e9f88936aa21dd410d4f1",
  21. "_etag": "7d11e7f57ed306043d76c05257474670eccde91c"
  22. }
  23.  
  24. class surveyForm(Form):
  25. _id = HiddenField("_id")
  26. _etag = HiddenField("_etag")
  27. name = TextField("Name")
  28. question = TextField("question")
  29. submit = SubmitField("Send")
  30.  
  31. obj = getSurvey(id) # here I get the object from the API
  32. form = surveyForm(**obj)
  33. return render_template('surveyAdd.html', form=form)
  34.  
  35. <form class="form-horizontal" role="form" action="{{ url_for('surveyAddOrEdit') }}" method=post>
  36.  
  37. {{ form.hidden_tag() }}
  38.  
  39. {{ form._id }}
  40. {{ form._etag }}
  41.  
  42. {{ form.name.label }}
  43. {{ form.name(class="form-control") }}
  44.  
  45. {{ form.question.label }}
  46. {{ form.question(class="form-control") }}
  47.  
  48. {{ form.submit(class="btn btn-default") }}
  49. </form>
  50.  
  51. <form class="form-horizontal" role="form" action="/survey/add" method="post">
  52.  
  53. <div style="display:none;"><input id="csrf_token" name="csrf_token" type="hidden" value="1396959127.36##dc263965e20ecc9956fc25d5b5c96f90f311cf47"></div>
  54.  
  55. <UnboundField(HiddenField, ('_id',), {})>
  56. <UnboundField(HiddenField, ('_etag',), {})>
  57. <label for="name">Name</label>
  58. <input class="form-control" id="name" name="name" type="text" value="moody">
  59. <label for="question">question</label>
  60. <input class="form-control" id="question" name="question" type="text" value="how are you?">
  61. <input class="btn btn-default" id="submit" name="submit" type="submit" value="Send">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement