12311k

Untitled

Mar 7th, 2020
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. def search(request):
  2. if request.method == 'GET':
  3. name = request.GET['name']
  4. year = int(request.GET['year'])
  5. found_articles = []
  6. for article in articles_list:
  7. if article[1] == name and article[2] == year:
  8. found_articles.append(article)
  9. beautiful_html = generate_html(found_articles)
  10. return HttpResponse(beautiful_html)
Add Comment
Please, Sign In to add comment