Skip to content

Commit

Permalink
Merge 6ee075d into 42ee1e5
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Aug 16, 2020
2 parents 42ee1e5 + 6ee075d commit 4ee4774
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 23 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://docs.djangoproject.com/en/dev/ref/contrib/gis/install/#requirements>`_)
* One of the databases supported by GeoDjango

Expand Down
5 changes: 4 additions & 1 deletion django_loci/base/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions django_loci/channels/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from channels.routing import ProtocolTypeRouter, URLRouter
from channels.security.websocket import AllowedHostsOriginValidator
from django.conf.urls import url

from django_loci.channels.base import location_broadcast_path
from django_loci.channels.consumers import LocationBroadcast

Expand Down
1 change: 1 addition & 0 deletions django_loci/tests/base/test_channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from django.contrib.auth import login
from django.contrib.auth.models import Permission
from django.http.request import HttpRequest

from django_loci.channels.consumers import LocationBroadcast

from ...channels.base import _get_object_or_none
Expand Down
2 changes: 1 addition & 1 deletion django_loci/tests/testdeviceapp/admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.contrib import admin
from django_loci.admin import ObjectLocationInline

from django_loci.admin import ObjectLocationInline
from openwisp_utils.admin import TimeReadonlyAdminMixin

from .models import Device
Expand Down
13 changes: 0 additions & 13 deletions django_loci/widgets.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down Expand Up @@ -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):
"""
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
import os
import sys

from django_loci import get_version
from setuptools import find_packages, setup

from django_loci import get_version


def get_install_requires():
"""
Expand Down

0 comments on commit 4ee4774

Please sign in to comment.