Added account login
This commit is contained in:
		@@ -1,6 +1,6 @@
 | 
				
			|||||||
from django.views import generic
 | 
					from django.views import generic
 | 
				
			||||||
from .models import Container, ContainerType
 | 
					from .models import Container, ContainerType
 | 
				
			||||||
 | 
					from blabel import LabelWriter
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class ContainerListView(generic.ListView):
 | 
					class ContainerListView(generic.ListView):
 | 
				
			||||||
    model = Container
 | 
					    model = Container
 | 
				
			||||||
@@ -44,6 +44,19 @@ class ContainerDeleteView(generic.DetailView):
 | 
				
			|||||||
    model = Container
 | 
					    model = Container
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class ContainerPrintLabelView(generic.DetailView):
 | 
				
			||||||
 | 
					    model = Container
 | 
				
			||||||
 | 
					    template_name = 'container/container_print_label.html'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def get(self, **kwargs):
 | 
				
			||||||
 | 
					        super().get(kwargs)
 | 
				
			||||||
 | 
					        label_writer = LabelWriter(
 | 
				
			||||||
 | 
					            'templates/label/container_label.html',
 | 
				
			||||||
 | 
					            default_stylesheets=("templates/label/label_style.css",)
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					        label_writer.write_labels(kwargs['pk'], target="container_label.pdf")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class ContainerTypeListView(generic.ListView):
 | 
					class ContainerTypeListView(generic.ListView):
 | 
				
			||||||
    template_name = 'container/container_type_list.html'
 | 
					    template_name = 'container/container_type_list.html'
 | 
				
			||||||
    context_object_name = 'container_type_list'
 | 
					    context_object_name = 'container_type_list'
 | 
				
			||||||
@@ -89,4 +102,3 @@ class ContainerTypeUpdateView(generic.UpdateView):
 | 
				
			|||||||
class ContainerTypeDeleteView(generic.DetailView):
 | 
					class ContainerTypeDeleteView(generic.DetailView):
 | 
				
			||||||
    model = ContainerType
 | 
					    model = ContainerType
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,7 @@ from django.contrib import admin
 | 
				
			|||||||
from django.urls import include, path
 | 
					from django.urls import include, path
 | 
				
			||||||
from django.views.generic import TemplateView
 | 
					from django.views.generic import TemplateView
 | 
				
			||||||
from homelog import views
 | 
					from homelog import views
 | 
				
			||||||
 | 
					from django.contrib.auth import views as auth_views
 | 
				
			||||||
 | 
					
 | 
				
			||||||
urlpatterns = [
 | 
					urlpatterns = [
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
@@ -28,4 +29,5 @@ urlpatterns = [
 | 
				
			|||||||
    path('container/', include('container.urls')),
 | 
					    path('container/', include('container.urls')),
 | 
				
			||||||
    path('asset/', include('asset.urls')),
 | 
					    path('asset/', include('asset.urls')),
 | 
				
			||||||
    path('admin/', admin.site.urls),
 | 
					    path('admin/', admin.site.urls),
 | 
				
			||||||
 | 
					    path('accounts/login/', auth_views.LoginView.as_view(), name='account_login'),
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user