12311k

Untitled

Mar 2nd, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. def add_tag(request):
  2. if request.method == 'GET':
  3. html = html_template.format(where = request.path)
  4. resp = HttpResponse(html)
  5. return resp
  6. elif request.method == 'POST':
  7. article_id = int(request.POST['id'])
  8. new_tag = request.POST['new_tag']
  9. for article in articles_list:
  10. if article[0] == article_id:
  11. article[4].append(new_tag)
  12. return article_by_id(request, article_id)
Add Comment
Please, Sign In to add comment