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
Hello world written in Django.

Learning Django 💡 create a virtual environment create python -m venv ./venv. this virtualenv file will be excluded by .gitignore activate the virtual

Dipak giri 4 Nov 26, 2021
Django CacheMiddleware has a multi-threading issue with pylibmc

django-pylibmc-bug Django CacheMiddleware has a multi-threading issue with pylibmc. CacheMiddleware shares a thread-unsafe cache object with many thre

Iuri de Silvio 1 Oct 19, 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
webfest Django project @innovaccer

inno-doctor webfest Django project @innovaccer setup guide create new directory for project clone the repo with url into the directory make sure pytho

Rohit sahu 6 Oct 28, 2022
A CTF leaderboard for the submission of flags during a CTF challenge. Built using Django.

🚩 CTF Leaderboard The goal of this project is to provide a simple web page to allow the participants of an CTF to enter their found flags. Also the l

Maurice Bauer 2 Jan 17, 2022
Phoenix LiveView but for Django

Reactor, a LiveView library for Django Reactor enables you to do something similar to Phoenix framework LiveView using Django Channels. What's in the

Eddy Ernesto del Valle Pino 526 Jan 02, 2023
Website desenvolvido em Django para gerenciamento e upload de arquivos (.pdf).

Website para Gerenciamento de Arquivos Features Esta é uma aplicação full stack web construída para desenvolver habilidades com o framework Django. O

Alinne Grazielle 8 Sep 22, 2022
Django based webapp pulling in crypto news and price data via api

Deploy Django in Production FTA project implementing containerization of Django Web Framework into Docker to be placed into Azure Container Services a

0 Sep 21, 2022
PicoStyle - Advance market place website written in django

Advance market place website written in django :) Online fashion store for whole

AminAli Mazarian 26 Sep 10, 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 feature flipper for Django

README Django Waffle is (yet another) feature flipper for Django. You can define the conditions for which a flag should be active, and use it in a num

950 Dec 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 Django application that provides country choices for use with forms, flag icons static files, and a country field for models.

Django Countries A Django application that provides country choices for use with forms, flag icons static files, and a country field for models. Insta

Chris Beaven 1.2k Dec 31, 2022
📊📈 Serves up Pandas dataframes via the Django REST Framework for use in client-side (i.e. d3.js) visualizations and offline analysis (e.g. Excel)

Django REST Pandas Django REST Framework + pandas = A Model-driven Visualization API Django REST Pandas (DRP) provides a simple way to generate and se

wq framework 1.2k Jan 01, 2023
I managed to attach the Django Framework to my Telegram Bot and set a webhook

I managed to attach the Django Framework to my Telegram Bot and set a webhook. I've been developing it from 10th of November 2021 and I want to have a basic working prototype.

Valentyn Vovchak 2 Sep 08, 2022
This is a basic Todo Application API using Django Rest Framework

Todo Application This is a basic Todo Application API using Django Rest Framework. Todo Section - User can View his previously added todo items, creat

Atharva Parkhe 1 Aug 09, 2022
Utilities to make function-based views cleaner, more efficient, and better tasting.

django-fbv Utilities to make Django function-based views cleaner, more efficient, and better tasting. 💥 📖 Complete documentation: https://django-fbv

Adam Hill 49 Dec 30, 2022
Django-Text-to-HTML-converter - The simple Text to HTML Converter using Django framework

Django-Text-to-HTML-converter This is the simple Text to HTML Converter using Dj

Nikit Singh Kanyal 6 Oct 09, 2022
Актуальный сборник шаблонов для создания проектов и приложений на Django

О чем этот проект Этот репозиторий с шаблонами для быстрого создания Django проекта. В шаблоне проекта настроены следующий технологий: Django gunicorn

Denis Kustov 16 Oct 20, 2022
💨 Fast, Async-ready, Openapi, type hints based framework for building APIs

Fast to learn, fast to code, fast to run Django Ninja - Fast Django REST Framework Django Ninja is a web framework for building APIs with Django and P

Vitaliy Kucheryaviy 3.8k Jan 01, 2023