Utilities for implementing Modified Preorder Tree Traversal (MPTT) with your Django Model classes and working with trees of Model instances.

Journal Entries

No entries yet. Link your entries with 'django-mptt' to include this project.


Ratings & Reviews

Community Rating
4.0/5.0

Based on 2 user ratings.

Your Rating

Click to rate this project.

Links

No links submitted so far. Submit your own links.

News

Edit RSS feeds.

    It doesn't rain - it pours. Django MPTT 0.2.1

    It turns out Django MPTT 0.2 had a dodgy setup.py, which only worked if you had a valid DJANGO_SETTINGS_MODULE environment variable in place.

    You can now grab version 0.2.1 instead, which puts in a quick fix to rectify this.

    Django MPTT 0.2 Released

    The second public release of Django MPTT is now available for download.

    Backwards-incompatible changes:

    mptt.register replaces mptt.models.treeify for registering models with the mptt application.
    move_node is now the only ... [More] "public" method for moving nodes in TreeManager - it will figure out what do do based on its arguments. Other, peviously public, methods have been renamed with a preceding underscore to indicate the internal nature of their intended use.

    New and improved features:

    New model instance methods:

    insert_at(target, position, commit)
    is_child_node()
    is_root_node()
    is_leaf_node()
    get_children()
    get_next_sibling()
    get_previous_sibling()
    get_root()

    New TreeManager methods:

    insert_node(node, target, position) - insert a new node at any position in the tree, no need to save and then move any more.
    root_node(tree_id)
    root_nodes()

    Tree options are now held in the Options (a.k.a. _meta) for each registered model.
    Added an order_insertion_by option when registering a model. If a field name is provided, new nodes will automatically be inserted so they're ordered based on the given field at each level in the tree. This ordering is also maintained when automatic reparenting is performed (i.e. when you change a node's parent, then save it).
    Nodes can now be moved to be siblings of root nodes - this is a special case due to Django MPTT's use of a tree id field, and used to be an invalid move.
    TreeManager.move_node now performs transaction management in the same manner as model save() and delete() methods.
    Added a drilldown_tree_for_node template tag.
    Added a tree_path template filter.
    The tree_info template filter now accepts an optional argument which can be used to specify that ancestor information be made available for each node in the tree.
    Added a custom newforms Form, MoveNodeForm, which takes care of moving a given node to any of a given selection of valid target nodes in the tree.

    Browse the version 0.2 HTML documentation online for more details. [Less]

    Django MPTT 0.1 Released

    The first public release of Django MPTT is available for download.

    Version 0.1 features:

    Simple registration of Model classes for MPTT.
    The tree structure is automatically managed when you create or delete MPTT Model ... [More] instances.
    MPTT Model instances gain tree-related methods.
    Automatic reparenting when an item's parent is changed - allows for basic tree management using the django.contrib.admin application.
    Custom TreeManager provides a tree node movement API.
    A template tag and template filter for working with trees of MPTT Model instances. [Less]

    Django MPTT

    Django MPTT is an application I've split out from a project I'm working on - it consists of some utilities for implementing Modified Preorder Tree Traversal (MPTT) with your own Django Model classes and helpers for working with trees of Model instances.

Download Page
0 downloads

Who uses django-mptt?

aaloy gogna wiz uptimebox

Who contributes to django-mptt?

Jonathan Buchanan brosner
I'm a contributor

Who manages django-mptt?

I'm a manager

Where in the world?




Project Cost

This calculator estimates how much it would cost to hire a team to write this project from scratch. More »
Include
Codebase 895
Effort (est.) 0 Person Years
Avg. Salary $ year
$ 9,790