Fixed urls
This commit is contained in:
parent
16a0b92731
commit
111f147cac
|
@ -1,3 +1,5 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
from .models import Asset
|
||||
|
||||
admin.site.register(Asset)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{% extends 'base.html' %}
|
||||
{% load statics %}
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Form for Asset</h2>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
{% if asset_list %}
|
||||
<ul>
|
||||
{% for asset in asset_list %}
|
||||
<li><a href="{% url 'asset:asset-detail' asset.id %}">{{ asset.named_id }}: {{ asset.description }}</a></li>
|
||||
<li><a href="{% url 'asset:asset-update' asset.id %}">{{ asset.named_id }}: {{ asset.description }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Reference in New Issue