add command to process location data
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
from django.contrib import admin
|
||||
from django.conf.urls import url
|
||||
from django.contrib import admin, messages
|
||||
from django.shortcuts import redirect
|
||||
from django.template.response import TemplateResponse
|
||||
|
||||
from .models import *
|
||||
from django import forms
|
||||
from django.core.exceptions import ValidationError
|
||||
@@ -33,6 +37,16 @@ class ClientAdmin(admin.ModelAdmin):
|
||||
|
||||
@admin.register(LocationData)
|
||||
class LocationDataAdmin(admin.ModelAdmin):
|
||||
def get_urls(self):
|
||||
urls = super().get_urls()
|
||||
my_urls = [
|
||||
url(r'^process_locationdata/$', self.admin_site.admin_view(self.process_locationdata), name='process_locationdata'),
|
||||
]
|
||||
return my_urls + urls
|
||||
|
||||
def process_locationdata(self, request):
|
||||
messages.success(request, '2739847239847298374982374 Items prozessiert.')
|
||||
return redirect('admin:billard_locationdata_changelist')
|
||||
list_display = ('client_id', 'desk_no', 'tst', 'on_off', 'processed', 'error_msg')
|
||||
fields = ['client_id', 'desk_no', 'tst', 'on_off', 'processed', 'error_msg']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user