diff --git a/.travis.yml b/.travis.yml index 0b15b55..9c20921 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,8 +18,9 @@ python: - "3.7" env: - - DJANGO="django>=2.2,<2.3" - - DJANGO="django>=3.0,<3.1" + - DJANGO="django~=2.2" + - DJANGO="django~=3.0" + - DJANGO="django~=3.1" branches: only: diff --git a/README.rst b/README.rst index 36ef1b2..2981379 100644 --- a/README.rst +++ b/README.rst @@ -52,7 +52,7 @@ Reusable django-app for storing GIS and indoor coordinates of objects. Dependencies ------------ -* Python >= 3.5 +* Python >= 3.6 * GeoDjango (`see GeoDjango Install Instructions `_) * One of the databases supported by GeoDjango diff --git a/django_loci/base/admin.py b/django_loci/base/admin.py index 7b7913e..08996d9 100644 --- a/django_loci/base/admin.py +++ b/django_loci/base/admin.py @@ -172,8 +172,11 @@ class Media: js = ( 'admin/js/jquery.init.js', 'django-loci/js/loci.js', + 'django-loci/js/floorplan-widget.js', ) - css = {'all': ('django-loci/css/loci.css',)} + css = { + 'all': ('django-loci/css/loci.css', 'django-loci/css/floorplan-widget.css') + } def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) diff --git a/django_loci/widgets.py b/django_loci/widgets.py index e78a8be..cb3c075 100644 --- a/django_loci/widgets.py +++ b/django_loci/widgets.py @@ -1,11 +1,9 @@ import logging from django import forms -from django.templatetags.static import static from leaflet.forms.widgets import LeafletWidget as BaseLeafletWidget logger = logging.getLogger(__name__) -_floorplan_css = {'all': (static('django-loci/css/floorplan-widget.css'),)} class ImageWidget(forms.FileInput): @@ -36,11 +34,6 @@ def get_context(self, name, value, attrs): logger.error(msg.format(value.name)) return c - @property - def media(self): - css = _floorplan_css - return forms.Media(css=css) - class FloorPlanWidget(forms.TextInput): """ @@ -49,12 +42,6 @@ class FloorPlanWidget(forms.TextInput): template_name = 'admin/widgets/floorplan.html' - @property - def media(self): - js = (static('django-loci/js/floorplan-widget.js'),) - css = _floorplan_css - return forms.Media(js=js, css=css) - class LeafletWidget(BaseLeafletWidget): include_media = True diff --git a/requirements-test.txt b/requirements-test.txt index ae97802..41a08aa 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -3,4 +3,4 @@ attrs>=17.4.0 pytest-django>=3.4.2,<3.10.0 pytest-asyncio>=0.10.0,<0.15.0 pytest-cov>=2.7.0,<2.11.0 -openwisp-utils[qa]~=0.5.1 +openwisp-utils[qa]~=0.6.0 diff --git a/requirements.txt b/requirements.txt index 8447151..3072d6a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ -django>=2.2,<3.1 +django>=2.2,<3.2 django-leaflet>=0.23,<0.28 -channels>=2.1.3,<2.5.0 +channels>=2.3.0,<2.5.0 Pillow~=7.2.0 -openwisp-utils~=0.5.1 +openwisp-utils~=0.6.0