summaryrefslogtreecommitdiff
path: root/app/sightings
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2019-02-01 09:27:21 -0600
committerluxagraf <sng@luxagraf.net>2019-02-01 09:27:21 -0600
commit3a54cdb85027e4a59ca6d78f5b91dbf7be77afd0 (patch)
tree5fedfaa18d46d4da45ef9504b511eaa74bda4eae /app/sightings
parent34f95ec85a7956515f810c9fda7d9650edc7da30 (diff)
redid jrnl to speed things up and use less memory
Diffstat (limited to 'app/sightings')
-rw-r--r--app/sightings/admin.py4
-rw-r--r--app/sightings/autocomplete_light_registry.py14
-rw-r--r--app/sightings/forms.py12
-rw-r--r--app/sightings/views.py12
4 files changed, 1 insertions, 41 deletions
diff --git a/app/sightings/admin.py b/app/sightings/admin.py
index 7108bba..d95dd72 100644
--- a/app/sightings/admin.py
+++ b/app/sightings/admin.py
@@ -1,4 +1,4 @@
-import copy
+import copy
from django.contrib import admin
from django.contrib.gis.admin import OSMGeoAdmin
from .models import APClass, AP, Sighting
@@ -6,7 +6,6 @@ from .models import APClass, AP, Sighting
from photos.forms import GalleryForm
from utils.util import get_latlon
from utils.widgets import CustomSelectMultiple, LGEntryForm
-from .forms import SightingsForm
from django.contrib.admin.options import FORMFIELD_FOR_DBFIELD_DEFAULTS
class GalleryFormPlus(GalleryForm):
@@ -80,7 +79,6 @@ class APAdmin(admin.ModelAdmin):
@admin.register(Sighting)
class SightingAdmin(OSMGeoAdmin):
- form = SightingsForm
list_filter = (('location', admin.RelatedOnlyFieldListFilter),)
list_display = ('ap', 'location')
# options for OSM map Using custom ESRI topo map
diff --git a/app/sightings/autocomplete_light_registry.py b/app/sightings/autocomplete_light_registry.py
deleted file mode 100644
index 9c113d0..0000000
--- a/app/sightings/autocomplete_light_registry.py
+++ /dev/null
@@ -1,14 +0,0 @@
-import autocomplete_light.shortcuts as al
-from .models import AP
-
-al.register(AP,
- search_fields=['common_name',],
- attrs={
- 'placeholder': 'Animal/Plant...',
- 'data-autocomplete-minimum-characters': 2,
- },
- widget_attrs={
- 'data-widget-maximum-values': 4,
- 'class': 'modern-style',
- },
-)
diff --git a/app/sightings/forms.py b/app/sightings/forms.py
deleted file mode 100644
index 77d61f9..0000000
--- a/app/sightings/forms.py
+++ /dev/null
@@ -1,12 +0,0 @@
-from dal import autocomplete
-
-from .models import Sighting
-
-
-class SightingsForm(autocomplete.FutureModelForm):
- class Meta:
- model = Sighting
- fields = ('pub_date','ap', 'point',)
- widgets = {
- 'ap': autocomplete.ModelSelect2(url='ap-autocomplete')
- }
diff --git a/app/sightings/views.py b/app/sightings/views.py
index f65011c..c90e5c1 100644
--- a/app/sightings/views.py
+++ b/app/sightings/views.py
@@ -3,7 +3,6 @@ from django.views.generic import ListView
from django.contrib.auth.models import User
from utils.views import PaginatedListView
from .models import AP, Sighting
-from dal import autocomplete
class SightingListView(PaginatedListView):
@@ -57,14 +56,3 @@ class SightingDetailView(DetailView):
except Sighting.DoesNotExist:
pass
return context
-
-
-class APAutocomplete(autocomplete.Select2QuerySetView):
- def get_queryset(self):
- if not self.request.user.is_authenticated:
- return AP.objects.none()
- qs = AP.objects.all()
- if self.q:
- qs = qs.filter(common_name__icontains=self.q)
- return qs
-