mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-07-27 08:19:57 +03:00
Update django app naming
This commit is contained in:
parent
6094186063
commit
361858950f
|
@ -1,4 +1,4 @@
|
||||||
"""Main package."""
|
"""Project package."""
|
||||||
|
|
||||||
from .containers import Container
|
from .containers import Container
|
||||||
from . import settings
|
from . import settings
|
||||||
|
|
|
@ -128,4 +128,4 @@ GITHUB_REQUEST_TIMEOUT = 10
|
||||||
# Search settings
|
# Search settings
|
||||||
DEFAULT_LIMIT = 5
|
DEFAULT_LIMIT = 5
|
||||||
DEFAULT_QUERY = 'Dependency Injector'
|
DEFAULT_QUERY = 'Dependency Injector'
|
||||||
LIMITS = [5, 10, 20]
|
LIMIT_OPTIONS = [5, 10, 20]
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
Limit:
|
Limit:
|
||||||
</label>
|
</label>
|
||||||
<select class="form-control" id="search_limit" name="limit">
|
<select class="form-control" id="search_limit" name="limit">
|
||||||
{% for value in limits %}
|
{% for value in limit_options %}
|
||||||
<option {% if value == limit %}selected{% endif %}>
|
<option {% if value == limit %}selected{% endif %}>
|
||||||
{{ value }}
|
{{ value }}
|
||||||
</option>
|
</option>
|
||||||
|
|
|
@ -15,7 +15,7 @@ def index(
|
||||||
search_service: SearchService = Provide[Container.search_service],
|
search_service: SearchService = Provide[Container.search_service],
|
||||||
default_query: str = Provide[Container.config.DEFAULT_QUERY],
|
default_query: str = Provide[Container.config.DEFAULT_QUERY],
|
||||||
default_limit: int = Provide[Container.config.DEFAULT_LIMIT.as_int()],
|
default_limit: int = Provide[Container.config.DEFAULT_LIMIT.as_int()],
|
||||||
limits: List[int] = Provide[Container.config.LIMITS],
|
limit_options: List[int] = Provide[Container.config.LIMIT_OPTIONS],
|
||||||
) -> HttpResponse:
|
) -> HttpResponse:
|
||||||
query = request.GET.get('query', default_query)
|
query = request.GET.get('query', default_query)
|
||||||
limit = int(request.GET.get('limit', default_limit))
|
limit = int(request.GET.get('limit', default_limit))
|
||||||
|
@ -28,7 +28,7 @@ def index(
|
||||||
context={
|
context={
|
||||||
'query': query,
|
'query': query,
|
||||||
'limit': limit,
|
'limit': limit,
|
||||||
'limits': limits,
|
'limit_options': limit_options,
|
||||||
'repositories': repositories,
|
'repositories': repositories,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user