mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-28 12:33:59 +03:00
20 lines
545 B
Python
20 lines
545 B
Python
|
"""Views module."""
|
||
|
|
||
|
from flask import request, render_template
|
||
|
|
||
|
from .services import SearchService
|
||
|
|
||
|
|
||
|
def index(search_service: SearchService, default_search_term, default_search_limit):
|
||
|
search_term = request.args.get('search_term', default_search_term)
|
||
|
limit = request.args.get('limit', default_search_limit, int)
|
||
|
|
||
|
repositories = search_service.search_repositories(search_term, limit)
|
||
|
|
||
|
return render_template(
|
||
|
'index.html',
|
||
|
search_term=search_term,
|
||
|
limit=limit,
|
||
|
repositories=repositories,
|
||
|
)
|