fork download
  1. Model
  2. class Resume(models.Model):
  3. user = models.ForeignKey(User)
  4. title = models.CharField(max_length=255)
  5. salary = models.PositiveIntegerField()
  6. city = models.CharField(max_length=255)
  7. skills = models.TextField(blank=True)
  8. experience = models.PositiveIntegerField()
  9. ENGLISH_CHOICES = (
  10. ('NS','No english skills'),
  11. ('RO','Can read tech docs'),
  12. ('SG','Can be a part of meeting'),
  13. ('SP','Fluent English'),
  14. )
  15. english = models.CharField(max_length=255, choices = ENGLISH_CHOICES)
  16. VARIANTS_CHOICES = (
  17. ('FT','Full Time'),
  18. ('PT','Part Time'),
  19. ('FL','Freelance'),
  20. ('MR','Move to Russia'),
  21. ('MUE','Move to USA or Europe'),
  22. )
  23. variants = models.CharField(max_length=255, choices = VARIANTS_CHOICES)
  24. about_job = models.TextField(blank=True)
  25. achivements = models.TextField(blank=True)
  26.  
  27. URL
  28. url(r'^accounts/profile/resume/edit/$', 'Registry.views.resume_update'),
  29.  
  30. View
  31. def resume_update(request, pk=None):
  32. obj = get_object_or_404(Resume, pk=pk)
  33. form = ResumeForm(request.POST, instance=obj)
  34. if request.method == 'POST':
  35. if form.is_valid():
  36. form.save()
  37. return HttpResponseRedirect('/')
  38. else:
  39. user = request.user
  40. obj = Resume.objects.get(user=request.user)
  41. form = ResumeForm(instance=obj)
  42. args = {}
  43. args.update(csrf(request))
  44. args['form'] = form
  45. return render_to_response('resume_update.html', args)
  46.  
  47. Template
  48. <form action='/accounts/profile/resume/edit/' method="post">
  49. {% csrf_token %}
  50. {{form.as_ul}}
  51. <input type="submit" value="Update" />
  52.  
  53. </form>
Runtime error #stdin #stdout #stderr 0.46s 323200KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
js: "prog.js", line 2: missing ; before statement
js: class Resume(models.Model):
js: ............^
js: "prog.js", line 3: syntax error
js:     user = models.ForeignKey(User)
js: ..........^
js: "prog.js", line 4: syntax error
js:     title = models.CharField(max_length=255)
js: ...........^
js: "prog.js", line 5: syntax error
js:     salary = models.PositiveIntegerField()
js: ............^
js: "prog.js", line 6: syntax error
js:     city = models.CharField(max_length=255)
js: ..........^
js: "prog.js", line 7: syntax error
js:     skills = models.TextField(blank=True)
js: ............^
js: "prog.js", line 8: syntax error
js:     experience = models.PositiveIntegerField()
js: ................^
js: "prog.js", line 9: syntax error
js:     ENGLISH_CHOICES = (
js: .....................^
js: "prog.js", line 10: missing ; before statement
js:             ('NS','No english skills'),
js: .....................................^
js: "prog.js", line 11: missing ; before statement
js:             ('RO','Can read tech docs'),
js: ......................................^
js: "prog.js", line 12: missing ; before statement
js:             ('SG','Can be a part of meeting'),
js: ............................................^
js: "prog.js", line 13: missing ; before statement
js:             ('SP','Fluent English'),
js: ..................................^
js: "prog.js", line 22: syntax error
js:             )
js: ............^
js: "prog.js", line 23: syntax error
js:     variants = models.CharField(max_length=255, choices = VARIANTS_CHOICES)
js: ..............^
js: "prog.js", line 24: syntax error
js:     about_job = models.TextField(blank=True)
js: ...............^
js: "prog.js", line 25: syntax error
js:     achivements = models.TextField(blank=True)
js: .................^
js: "prog.js", line 28: missing ) after argument list
js: url(r'^accounts/profile/resume/edit/$', 'Registry.views.resume_update'),
js: .....................................^
js: "prog.js", line 31: missing ; before statement
js: def resume_update(request, pk=None):
js: .................^
js: "prog.js", line 32: syntax error
js:     obj = get_object_or_404(Resume, pk=pk)
js: .........^
js: "prog.js", line 33: syntax error
js:     form = ResumeForm(request.POST, instance=obj)
js: ..........^
js: "prog.js", line 34: missing ; before statement
js:     if request.method == 'POST':
js: ...............................^
js: "prog.js", line 35: missing ; before statement
js:         if form.is_valid():
js: ..........................^
js: "prog.js", line 36: syntax error
js:             form.save()
js: .................^
js: "prog.js", line 38: syntax error
js:     else:
js: ........^
js: "prog.js", line 39: syntax error
js:         user = request.user
js: ..............^
js: "prog.js", line 40: syntax error
js:         obj = Resume.objects.get(user=request.user)
js: .............^
js: "prog.js", line 41: syntax error
js:         form = ResumeForm(instance=obj)
js: ..............^
js: "prog.js", line 42: syntax error
js:     args = {}
js: ..........^
js: "prog.js", line 43: syntax error
js:     args.update(csrf(request))
js: .........^
js: "prog.js", line 45: invalid return
js:     return render_to_response('resume_update.html', args)
js: ..........^
js: "prog.js", line 48: missing ; before statement
js:     <form action='/accounts/profile/resume/edit/' method="post">
js: ................^
js: "prog.js", line 49: syntax error
js:     {% csrf_token %}
js: ......^
js: "prog.js", line 50: syntax error
js:     {{form.as_ul}}
js: .................^
js: "prog.js", line 51: missing ; before statement
js:     <input type="submit" value="Update" />
js: ...............^
js: "prog.js", line 53: unterminated regular expression literal
js:     </form>
js: ..........^
js: "prog.js", line 1: Compilation produced 35 syntax errors.