From 111f147cac795722e2b243ee70762b77056ad7cc Mon Sep 17 00:00:00 2001 From: Dirk Jahnke Date: Thu, 10 Mar 2022 18:19:13 +0100 Subject: [PATCH] Fixed urls --- asset/admin.py | 4 +++- asset/templates/asset/asset_form.html | 2 +- asset/templates/asset/asset_index.html | 2 +- asset/views.py | 6 +++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/asset/admin.py b/asset/admin.py index 8c38f3f..12af028 100644 --- a/asset/admin.py +++ b/asset/admin.py @@ -1,3 +1,5 @@ from django.contrib import admin -# Register your models here. +from .models import Asset + +admin.site.register(Asset) diff --git a/asset/templates/asset/asset_form.html b/asset/templates/asset/asset_form.html index e7713d4..2dff386 100644 --- a/asset/templates/asset/asset_form.html +++ b/asset/templates/asset/asset_form.html @@ -1,5 +1,5 @@ {% extends 'base.html' %} -{% load statics %} +{% load static %} {% block content %}

Form for Asset

diff --git a/asset/templates/asset/asset_index.html b/asset/templates/asset/asset_index.html index 5cbccd0..300ce5e 100644 --- a/asset/templates/asset/asset_index.html +++ b/asset/templates/asset/asset_index.html @@ -9,7 +9,7 @@ {% if asset_list %} {% else %} diff --git a/asset/views.py b/asset/views.py index de397f4..baca53e 100644 --- a/asset/views.py +++ b/asset/views.py @@ -5,15 +5,15 @@ from asset.models import Asset class AssetCreateView(CreateView): model = Asset - #fields = ['name'] + fields = ['named_id', 'description', 'quantity'] class AssetUpdateView(UpdateView): model = Asset - #fields = ['name'] + fields = ['named_id', 'description', 'quantity'] class AssetDeleteView(DeleteView): model = Asset - success_url = reverse_lazy('asset-list') + success_url = reverse_lazy('asset-index') class AssetIndexView(generic.ListView): template_name = 'asset/asset_index.html'