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
Agenda feita usando o django para adicionar eventos

Agenda de Eventos Projeto Agenda com Django Inicio O projeto foi iniciado no Django, usando o models.py foi adicionado os dados dos eventos e feita as

Bruno Fernandes 1 Apr 14, 2022
A middleware to log the requests and responses using loguru.

Django Loguru The extension was based on another one and added some extra flavours. One of the biggest problems with the apps is the logging and that

Tiago Silva 9 Oct 11, 2022
Учебное пособие по основам Django и сопутствующим технологиям

Учебный проект для закрепления основ Django Подробный разбор проекта здесь. Инструкция по запуску проекта на своей машине: Скачиваем репозиторий Устан

Stanislav Garanzha 12 Dec 30, 2022
Django-discord-bot - Framework for creating Discord bots using Django

django-discord-bot Framework for creating Discord bots using Django Uses ASGI fo

Jamie Bliss 1 Mar 04, 2022
React.JS - Django Application Template

OTS React.JS - DJango Web Application (UNTESTED) This repository servers as a template for creating React.JS - Django Web Applications. Note that the

Darryl See Wei Shen 5 Aug 19, 2022
A tool to automatically fix Django deprecations.

A tool to help upgrade Django projects to newer version of the framework by automatically fixing deprecations. The problem When maintaining a Django s

Bruno Alla 155 Dec 14, 2022
This is a Django app that uses numerous Google APIs such as reCAPTURE, maps and waypoints

Django project that uses Googles APIs to auto populate fields, display maps and routes for multiple waypoints

Bobby Stearman 57 Dec 03, 2022
Template de desarrollo Django

Template de desarrollo Django Python Django Docker Postgres Nginx CI/CD Descripción del proyecto : Proyecto template de directrices para la estandariz

Diego Esteban 1 Feb 25, 2022
Create a netflix-like service using Django, React.js, & More.

Create a netflix-like service using Django. Learn advanced Django techniques to achieve amazing results like never before.

Coding For Entrepreneurs 67 Dec 08, 2022
Repo for All the Assignments I have to submit for Internship Application !😅

Challenges Repository for All the Assignments I have to submit for Internship Application ! 😅 As You know, When ever We apply for an Internship, They

keshav Sharma 1 Sep 08, 2022
A django model and form field for normalised phone numbers using python-phonenumbers

django-phonenumber-field A Django library which interfaces with python-phonenumbers to validate, pretty print and convert phone numbers. python-phonen

Stefan Foulis 1.3k Dec 31, 2022
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
Py-instant-search-redis - Source code example for how to build an instant search with redis in python

py-instant-search-redis Source code example for how to build an instant search (

Giap Le 4 Feb 17, 2022
Use Database URLs in your Django Application.

DJ-Database-URL This simple Django utility allows you to utilize the 12factor inspired DATABASE_URL environment variable to configure your Django appl

Jacob Kaplan-Moss 1.3k Dec 30, 2022
Neighbourhood - A python-django web app to help the residence of a given neighborhood know their surrounding better

Neighbourhood A python-django web app to help the residence of a given neighborh

Levy Omolo 4 Aug 25, 2022
Django API that scrapes and provides the last news of the city of Carlos Casares by semantic way (RDF format).

"Casares News" API Api that scrapes and provides the last news of the city of Carlos Casares by semantic way (RDF format). Usage Consume the articles

Andrés Milla 6 May 12, 2022
django-idom allows Django to integrate with IDOM

django-idom allows Django to integrate with IDOM, a package inspired by ReactJS for creating responsive web interfaces in pure Python.

113 Jan 04, 2023
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
Django Audit is a simple Django app that tracks and logs requests to your application.

django-audit Django Audit is a simple Django app that tracks and logs requests to your application. Quick Start Install django-audit pip install dj-au

Oluwafemi Tairu 6 Dec 01, 2022
Easily share data across your company via SQL queries. From Grove Collab.

SQL Explorer SQL Explorer aims to make the flow of data between people fast, simple, and confusion-free. It is a Django-based application that you can

Grove Collaborative 2.1k Dec 30, 2022