The Django Leaflet Admin List package provides an admin list view featured by the map and bounding box filter for the geo-based data of the GeoDjango.

Overview

Build Status

Django Leaflet Admin List

Screen Example

The Django Leaflet Admin List package provides an admin list view featured by the map and bounding box filter for the geo-based data of the GeoDjango. It requires a django-leaflet package.

Installation

Stable version from the PyPi package repository

pip install django-leaflet-admin-list

Last development version from the GitHub source version control system

pip install git+git://github.com/nnseva/django-leaflet-admin-list.git

Configuration

Include the leaflet_admin_list application into the INSTALLED_APPS list, like:

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    ...
    'leaflet',
    'leaflet_admin_list',
    ...
]

Using

In your admin.py:

...
from leaflet.admin import LeafletGeoAdminMixin
from leaflet_admin_list.admin import LeafletAdminListMixin
...

class WaypointAdmin(LeafletAdminListMixin, LeafletGeoAdminMixin, ModelAdmin):
    ...

Visual View

Open the admin list view and see the map above the list of objects. Every object in the list is represented on the map.

Also, the bounding box filter is added to the list of filters.

Use a bounding box filter to filter objects by the geometry. Just press the 'Current map bounding box' link to filter out objects outside of the current map bounding box. The current filtering box will be represented on the map as a rectangle. The color of the rectangle is shown to the right of the 'Current map bounding box' link. Manual input of the bounding_box parameter in the address box also works.

As usual, pressing the filter or paging link will reload a page with new parameters. The map keeps its position for standard static Django filters and pager using permalink.

Customizing view

The geodata shown on the map is represented as GeoJSON feature collection. Every GeoJSON feature corresponds to one geo field of one Django model instance. All standard Django geometry-based fields are shown on the map by default. Every such feature has the following list of mandatory properties to be used:

  • field identifies the geometry field shown
  • app_label and model_name identify the model of the instance shown
  • pk is an instance primary key which identifies the model instance shown

The following optional GeoJSON feature properties are used to customize the look and feel of the feature on the map:

  • popup if present, is used to create a popup. A value started with '<' is used to create an HTML popup, else the text popup is used, see also bindPopup method
  • tooltip if present, is used to create a tooltip. A value started with '<' is used to create an HTML tooltip, else the text tooltip is used, see also bindTooltip method
  • line_style if present, is used to apply as an options parameter when creating lines and polygons, see also Leaflet Path options
  • point_style if present, is used as an options parameter to create a Leaflet marker, see also Marker options
  • an icon member of the point_style if present, is used as an options parameter to create a Leaflet icon, see also Icon options

The Admin class may override every part of this data, or even the whole data output overriding admin methods producing this data:

  • get_geojson_feature_list(request, queryset) returns the whole GeoJSON FeatureList instance representing a queryset
  • get_geojson_features(request, o, queryset) returns the features member of the FeatureList instance for the model instance o
  • get_geojson_geometry_fields(request, o, queryset) returns a list of geometry field names that need to be included in the feature list
  • get_geojson_feature(request, name, o, queryset) returns a GeoJSON Feature instance representing the instance o geometry field name
  • get_geojson_geometry(request, name, o, queryset) returns a geometry member of the GeoJSON Feature instance representing the instance o geometry field name
  • get_geojson_properties(request, name, o, queryset) returns a properties member of the GeoJSON Feature instance representing the instance o geometry field name
  • get_geojson_feature_popup(request, name, o, queryset) returns a popup property of the GeoJSON Feature instance representing the instance o geometry field name
  • get_geojson_feature_tooltip(request, name, o, queryset) returns a tooltip property of the GeoJSON Feature instance representing the instance o geometry field name
  • get_geojson_feature_verbose_name(request, name, o, queryset) returns a verbose name of the instance o geometry field name which is used to create popup and tooltip
  • get_geojson_feature_line_style(request, name, o, queryset) returns a line_style property of the GeoJSON Feature instance representing the instance o geometry field name
  • get_geojson_feature_point_style(request, name, o, queryset) returns a point_style property of the GeoJSON Feature instance representing the instance o geometry field name
  • get_geojson_feature_icon_style(request, name, o, queryset) returns an icon member of the point_style property of the GeoJSON Feature instance representing the instance o geometry field name
Owner
Vsevolod Novikov
Vsevolod Novikov
User Authentication In Django/Ajax/Jquery

User Authentication In Django/Ajax/Jquery Demo: Authentication System Using Django/Ajax/Jquery Demo: Authentication System Using Django Overview The D

Suman Raj Khanal 10 Mar 26, 2022
A simple app that provides django integration for RQ (Redis Queue)

Django-RQ Django integration with RQ, a Redis based Python queuing library. Django-RQ is a simple app that allows you to configure your queues in djan

RQ 1.6k Jan 06, 2023
A simple demonstration of integrating a sentiment analysis tool in a django project

sentiment-analysis A simple demonstration of integrating a sentiment analysis tool in a django project (watch the video .mp4) To run this project : pi

2 Oct 16, 2021
Example project demonstrating using Django’s test runner with Coverage.py

Example project demonstrating using Django’s test runner with Coverage.py Set up with: python -m venv --prompt . venv source venv/bin/activate python

Adam Johnson 5 Nov 29, 2021
Reusable, generic mixins for Django

django-braces Mixins for Django's class-based views. Documentation Read The Docs Installation Install from PyPI with pip: pip install django-braces Bu

Brack3t 1.9k Jan 05, 2023
A handy tool for generating Django-based backend projects without coding. On the other hand, it is a code generator of the Django framework.

Django Sage Painless The django-sage-painless is a valuable package based on Django Web Framework & Django Rest Framework for high-level and rapid web

sageteam 51 Sep 15, 2022
Realtime data read and write without page refresh using Ajax in Django.

Realtime read-write with AJAX Hey,this is the basic implementation type of ajax realtime read write from the database. where you can insert or view re

Mehedi Hasan 3 Dec 13, 2022
☄️ Google Forms autofill script

lazrr 'Destroy Them With Lazers' - Knife Party, 2011 Google Forms autofill script Installation: pip3 install -r requirements.txt Usage: python3 lazrr.

Serezha Rakhmanov 12 Jun 04, 2022
:couple: Multi-user accounts for Django projects

django-organizations Summary Groups and multi-user account management Author Ben Lopatin (http://benlopatin.com / https://wellfire.co) Status Separate

Ben Lopatin 1.1k Jan 01, 2023
A Powerful HTML white space remover for Django

HTML Whitespace remover for Django Introduction : A powerful tool to optimize Django rendered templates Why use "django_stip_whitespace" ? Adds line b

3 Jan 01, 2022
A simple polling app made in Django and Bootstrap

DjangoPolls A Simple Polling app made with Django Instructions Make sure you have Python installed Step 1. Open a terminal Step 2. Paste the given cod

Aditya Priyadarshi 1 Nov 10, 2021
Django And React Notes App

Django & React Notes App Cloning the repository -- Clone the repository using the command below : git clone https://github.com/divanov11/Django-React

Dennis Ivy 136 Dec 27, 2022
Duckiter will Automatically dockerize your Django projects.

Duckiter Duckiter will Automatically dockerize your Django projects. Requirements : - python version : python version 3.6 or upper version - OS :

soroush safari 23 Sep 16, 2021
Simpliest django(uvicorn)+postgresql+nginx docker-compose (ready for production and dev)

simpliest django(uvicorn)+postgresql+nginx docker-compose (ready for production and dev) To run in production: docker-compose up -d Site available on

Artyom Lisovskii 1 Dec 16, 2021
🗂️ 🔍 Geospatial Data Management and Search API - Django Apps

Geospatial Data API in Django Resonant GeoData (RGD) is a series of Django applications well suited for cataloging and searching annotated geospatial

Resonant GeoData 53 Nov 01, 2022
Django REST Client API

Django REST Client API Client data provider API.

Ulysses Monteiro 1 Nov 08, 2021
It's the assignment 1 from the Python 2 course, that requires a ToDoApp with authentication using Django

It's the assignment 1 from the Python 2 course, that requires a ToDoApp with authentication using Django

0 Jan 20, 2022
Simple Login Logout System using Django, JavaScript and ajax.

Djanog-UserAuthenticationSystem Technology Use #version Python 3.9.5 Django 3.2.7 JavaScript --- Ajax Validation --- Login and Logout Functionality, A

Bhaskar Mahor 3 Mar 26, 2022
With Django Hijack, admins can log in and work on behalf of other users without having to know their credentials.

Django Hijack With Django Hijack, admins can log in and work on behalf of other users without having to know their credentials. Docs 3.x docs are avai

1.2k Jan 05, 2023
A beginner django project and also my first Django project which involves shortening of a longer URL into a short one using a unique id.

Django-URL-Shortener A beginner django project and also my first Django project which involves shortening of a longer URL into a short one using a uni

Rohini Rao 3 Aug 08, 2021