Fixed urls
This commit is contained in:
parent
16a0b92731
commit
111f147cac
|
@ -1,3 +1,5 @@
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
# Register your models here.
|
from .models import Asset
|
||||||
|
|
||||||
|
admin.site.register(Asset)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% load statics %}
|
{% load static %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h2>Form for Asset</h2>
|
<h2>Form for Asset</h2>
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
{% if asset_list %}
|
{% if asset_list %}
|
||||||
<ul>
|
<ul>
|
||||||
{% for asset in asset_list %}
|
{% 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 %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
|
@ -5,15 +5,15 @@ from asset.models import Asset
|
||||||
|
|
||||||
class AssetCreateView(CreateView):
|
class AssetCreateView(CreateView):
|
||||||
model = Asset
|
model = Asset
|
||||||
#fields = ['name']
|
fields = ['named_id', 'description', 'quantity']
|
||||||
|
|
||||||
class AssetUpdateView(UpdateView):
|
class AssetUpdateView(UpdateView):
|
||||||
model = Asset
|
model = Asset
|
||||||
#fields = ['name']
|
fields = ['named_id', 'description', 'quantity']
|
||||||
|
|
||||||
class AssetDeleteView(DeleteView):
|
class AssetDeleteView(DeleteView):
|
||||||
model = Asset
|
model = Asset
|
||||||
success_url = reverse_lazy('asset-list')
|
success_url = reverse_lazy('asset-index')
|
||||||
|
|
||||||
class AssetIndexView(generic.ListView):
|
class AssetIndexView(generic.ListView):
|
||||||
template_name = 'asset/asset_index.html'
|
template_name = 'asset/asset_index.html'
|
||||||
|
|
Loading…
Reference in New Issue