A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://django-treebeard.readthedocs.io/en/latest/admin.html below:

Admin — django-treebeard 4.7 documentation

django-treebeard Admin API
class treebeard.admin.TreeAdmin(model, admin_site)

Bases: django.contrib.admin.options.ModelAdmin

Django Admin class for treebeard.

Example:

from django.contrib import admin
from treebeard.admin import TreeAdmin
from treebeard.forms import movenodeform_factory
from myproject.models import MyNode

class MyAdmin(TreeAdmin):
    form = movenodeform_factory(MyNode)

admin.site.register(MyNode, MyAdmin)
treebeard.admin.admin_factory(form_class)

Dynamically build a TreeAdmin subclass for the given form class.

Parameters: form_class – Returns: A TreeAdmin subclass.
Interface

The features of the admin interface will depend on the tree type.

Model Detail Pages

If a model’s field values are modified, then it is necessary to add the fields ‘_position’ and ‘_ref_node_id’. Otherwise, it is not possible to create instances of the model.

Example:

class MyAdmin(TreeAdmin):
    list_display = ('title', 'body', 'is_edited', 'timestamp', '_position', '_ref_node_id',)
    form = movenodeform_factory(MyNode)

admin.site.register(MyNode, MyAdmin)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4