Skip to main content

Django-mptt-admin provides a nice Django Admin interface for Mptt models

Project description

Django-mptt-admin provides a nice Django Admin interface for django-mptt models. The source is available on https://github.com/mbraak/django-mptt-admin. It uses the jqTree library.

Requirements

The package is tested with Django (1.7 - 1.8), and django-mptt (0.7.x). Also with Python 2.7, 3.3 and 3.4.

Installation

Install the package:

$ pip install django_mptt_admin

Add django_mptt_admin to your installed apps in settings.py.

INSTALLED_APPS = (
    ..
    'django_mptt_admin',
)

Use the DjangoMpttAdmin class in admin.py:

from django.contrib import admin
from django_mptt_admin.admin import DjangoMpttAdmin
from models import Country

class CountryAdmin(DjangoMpttAdmin):
    pass

admin.site.register(Country, CountryAdmin)

Options

tree_auto_open

Auto-open node. Default value is 1.

Values: - True: autopen all nodes - False: do not autoopen - integer: autopen until this level

tree_load_on_demand

Load on demand (True / False / level). Default is True.

  • True: load nodes on demand

  • False: do not load nodes on demand

  • int: load nodes on demand until this level

autoescape

Autoescape (True / False). Default is True.

Autoescape titles in tree.

filter_tree_queryset

Override the filter_tree_queryset method to filter the queyset for the tree.

class CountryAdmin(DjangoMpttAdmin):
  def filter_tree_queryset(self, queryset):
    return queryset.filter(name='abc')

use_context_menu

True / False. Default is False.

“useContextMenu” option for tree.

Changelog

0.3.0 (august 21 2015)

  • Issue 67: update jqtree to 1.2.1

  • Issue 68: drop support for Django 1.6 and older

    • Note that version 0.2.1 supports these versions.

  • Issue 71: added use_context_menu option (thanks to ITCase)

  • Issue 75: added Russian translation (thanks to Mike Silonov)

  • Issue 80: fix wrong url resolving with multiple admin sites (thanks to Hubert Bielenia)

0.2.1 (march 29 2015)

  • Issue 65: support Django 1.8

0.2.0 (january 12 2015)

  • Issue 23: fixed save-state for load-on-demand

  • Issue 35: fixed auto-open for load-on-demand

  • Issue 40: use jqtree 1.0.0

  • Issue 45: added i18n support and Hebrew translation (thanks to Udi Oron)

  • Issue 47: added filter_tree_queryset method

0.1.10 (september 24 2014)

  • Issue 31: added autoescape option

  • Issue 34: use the default change list in popup mode (thanks to hstanev)

  • Issue 36: the option tree_load_on_demand = False does not work

0.1.9 (july 12 2014)

  • Issue 25: update jqtree to 0.21.0

  • Issue 28: fixing problems related to working with model’s pk-field, named other than “id” (thanks to Igor Gai)

  • Issue 29: fix path to spinner.gif (thanks to Igor Gai)

0.1.8 (februari 2 2014)

  • Issue 17: handle error when moving node

  • Issue 18: do not use inline javascript

  • Issue 19: support Django 1.7 alpha

0.1.7 (january 3 2014)

  • Issue 16: moving a node fails if the node id is a uuid

0.1.6 (october 10 2013)

  • Issue 8: removing node from the tree causes the tree view to crash

0.1.5 (august 27 2013)

  • Issue 6: save the tree state

  • Issue 7: do not handle the right mouse click

0.1.4 (august 8 2013)

  • Issue 5: Support for uuid ids

0.1.3 (may 2 2013)

This version drops support for Django 1.3.7

  • Issue 2: Posting a screenshot in the readme would be really useful (thanks to Andy Baker)

  • Issue 3: Use static templatetag for CDN-compatible file paths (thanks to Alex Holmes)

  • Added Coveralls support

0.1.2 (march 12 2013)

  • Issue 1: Grid view doesn’t link correctly to object change pages (thanks to Kris Fields)

0.1.1 (februari 25 2013)

  • Added experimental Python 3 support

0.1 (februari 7 2013)

  • Initial version

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-mptt-admin-0.3.0.tar.gz (92.0 kB view details)

Uploaded Source

Built Distributions

django_mptt_admin-0.3.0-py2.py3-none-any.whl (98.1 kB view details)

Uploaded Python 2 Python 3

django_mptt_admin-0.3.0-py2.7.egg (99.9 kB view details)

Uploaded Source

File details

Details for the file django-mptt-admin-0.3.0.tar.gz.

File metadata

File hashes

Hashes for django-mptt-admin-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d47b49679f6dc8da337643e1276ba0fffb70056b02bd75e7ea35fa8ba83cbddc
MD5 6d7a59dd43abe1a2f611792c6deb9c48
BLAKE2b-256 33f6c78c87037c7c185ab9941ff0f05de321eeb38437bb47b4e7b471ef3f1234

See more details on using hashes here.

File details

Details for the file django_mptt_admin-0.3.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_mptt_admin-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 fc83627a7a19045b8efc20dddf8f9b8f84f8fa846413496965de8650ebfeb033
MD5 5201d113a66fa3f5e3921512cba59ba0
BLAKE2b-256 f165e68d71e03a04034d70013ec664af84216848ab7b0f0427b76d7086097986

See more details on using hashes here.

File details

Details for the file django_mptt_admin-0.3.0-py2.7.egg.

File metadata

File hashes

Hashes for django_mptt_admin-0.3.0-py2.7.egg
Algorithm Hash digest
SHA256 01fe37d1ed17ecabf2e3409ea1bf4e53ab114d600bed259a893ab4a811b6f227
MD5 d34c7d28a19f6ecb6d802ee6e1b1b221
BLAKE2b-256 92e9b905d5ba58e48fea3ec56102ac36c0082fcec5c3783fc7622e4aac863b61

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page