Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* skip nomilized models from admin as default

  • Loading branch information...
commit 6d4ec1a5f815a20c89cfdf645030435bcba4e047 1 parent 38fa849
@jedie authored
Showing with 18 additions and 12 deletions.
  1. +12 −12 django_kippo/admin.py
  2. +6 −0 django_kippo_test_project/settings.py
View
24 django_kippo/admin.py
@@ -3,6 +3,7 @@
from django.contrib import admin
from django_kippo.models import Auth, Client, Input, Sensor, Session, Ttylog
+from django.conf import settings
class AuthAdmin(admin.ModelAdmin):
@@ -14,11 +15,6 @@ class AuthAdmin(admin.ModelAdmin):
admin.site.register(Auth, AuthAdmin)
-class ClientAdmin(admin.ModelAdmin):
- list_display = ("version",)
-admin.site.register(Client, ClientAdmin)
-
-
class InputAdmin(admin.ModelAdmin):
list_display = ("id", "realm", "input", "success", "timestamp")
list_display_links = ("id",)
@@ -28,13 +24,6 @@ class InputAdmin(admin.ModelAdmin):
admin.site.register(Input, InputAdmin)
-class SensorAdmin(admin.ModelAdmin):
- list_display = ("id", "ip")
- list_display_links = ("ip",)
- search_fields = ("ip",)
-admin.site.register(Sensor, SensorAdmin)
-
-
class SessionAdmin(admin.ModelAdmin):
list_display = ("id", "ip", "starttime", "endtime", "termsize", "client")
list_display_links = ("ip",)
@@ -48,3 +37,14 @@ class TtylogAdmin(admin.ModelAdmin):
pass
admin.site.register(Ttylog, TtylogAdmin)
+
+if getattr(settings, "ADD_ALL_KIPPO_MODELS", False):
+ class SensorAdmin(admin.ModelAdmin):
+ list_display = ("id", "ip")
+ list_display_links = ("ip",)
+ search_fields = ("ip",)
+ admin.site.register(Sensor, SensorAdmin)
+
+ class ClientAdmin(admin.ModelAdmin):
+ list_display = ("version",)
+ admin.site.register(Client, ClientAdmin)
View
6 django_kippo_test_project/settings.py
@@ -139,6 +139,12 @@ def _pkg_path(obj, subdir=None):
}
}
+#------------------------------------------------------------------------------
+
+# Add all kippo models to admin ?
+ADD_ALL_KIPPO_MODELS = False
+
+#------------------------------------------------------------------------------
try:
from local_settings import *
Please sign in to comment.
Something went wrong with that request. Please try again.