some more stuff for mesh control
This commit is contained in:
parent
473e60aed0
commit
2ff4a9a64a
5 changed files with 80 additions and 13 deletions
|
@ -1,5 +1,5 @@
|
|||
from django.db.models import Max
|
||||
from django.views.generic import ListView
|
||||
from django.views.generic import ListView, DetailView
|
||||
|
||||
from c3nav.control.forms import MeshMessageFilerForm
|
||||
from c3nav.control.views.base import ControlPanelMixin
|
||||
|
@ -16,6 +16,13 @@ class MeshNodeListView(ControlPanelMixin, ListView):
|
|||
return super().get_queryset().annotate(last_msg=Max('received_messages__datetime')).prefetch_last_messages()
|
||||
|
||||
|
||||
class MeshNodeDetailView(ControlPanelMixin, DetailView):
|
||||
model = MeshNode
|
||||
template_name = "control/mesh_node_detail.html"
|
||||
pk_url_kwargs = "address"
|
||||
context_object_name = "node"
|
||||
|
||||
|
||||
class MeshMessageListView(ControlPanelMixin, ListView):
|
||||
model = NodeMessage
|
||||
template_name = "control/mesh_messages.html"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue