List feature

+ implemented list feature
+ implemented category feature
This commit is contained in:
Clemens-Dautermann 2018-12-23 14:27:16 +01:00
parent 5877b83424
commit 32d60f51ac
23 changed files with 210 additions and 60 deletions

View file

View file

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

View file

@ -0,0 +1,5 @@
from django.apps import AppConfig
class ObjectListerConfig(AppConfig):
name = 'object_lister'

View file

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

View file

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View file

@ -0,0 +1,6 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.objlist, name='objlist'),
]

View file

@ -0,0 +1,13 @@
from django.shortcuts import render
from object_adder.models import Object
from django.contrib.auth.decorators import login_required
# Create your views here.
@login_required
def objlist(request):
objects = Object.objects.all()
context = {'title': 'Inventar', 'objects': objects}
return render(request, 'object_lister/index.html', context)