Introduced namespaces for views/actions

This commit is contained in:
Dirk Jahnke 2022-03-09 18:29:44 +01:00
parent 330928b0f5
commit 02bc2f4667
3 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
<h1>Container: {{ container.named_id }}</h1> <h1>Container: {{ container.named_id }}</h1>
<div>{{ container.description }}</div> <div>{{ container.description }}</div>
<div>Color: {{ container.color }}</div> <div>Color: {{ container.color }}</div>
<div>Container Type: <a href="{% url 'container_type_details' container.container_type.id %}">{{ container.container_type.named_id }}</a></div> <div>Container Type: <a href="{% url 'container:container_type_details' container.container_type.id %}">{{ container.container_type.named_id }}</a></div>

View File

@ -3,7 +3,7 @@
{% if container_list %} {% if container_list %}
<ul> <ul>
{% for container in container_list %} {% for container in container_list %}
<li><a href="{% url 'container_details' container.id %}">{{ container.named_id }}: {{ container.description }}</a></li> <li><a href="{% url 'container:container_details' container.id %}">{{ container.named_id }}: {{ container.description }}</a></li>
{% endfor %} {% endfor %}
</ul> </ul>
{% else %} {% else %}
@ -15,7 +15,7 @@
{% if container_type_list %} {% if container_type_list %}
<ul> <ul>
{% for ctype in container_type_list %} {% for ctype in container_type_list %}
<li><a href="{% url 'container_type_details' ctype.id %}">{{ ctype.named_id }} {{ ctype.description }}</a></li> <li><a href="{% url 'container:container_type_details' ctype.id %}">{{ ctype.named_id }} {{ ctype.description }}</a></li>
{% endfor %} {% endfor %}
</ul> </ul>
{% else %} {% else %}

View File

@ -2,6 +2,7 @@ from django.urls import path
from . import views from . import views
app_name = 'container'
urlpatterns = [ urlpatterns = [
path('', views.index, name='index'), path('', views.index, name='index'),
path('<int:container_id>/', views.container_details, name='container_details'), path('<int:container_id>/', views.container_details, name='container_details'),