*How to use Django Mttp Admin as an Inline in admin.py* *?*

On Thursday, 26 February 2009 15:12:15 UTC+5:30, Matthias Kestenholz wrote:
>
> Hey,
>
> A topic which comes up on this list from time to time is an automatic
> admin interface for django-mptt. I'd like to advertise a piece of code
> we have written at our company a little bit, and I'd also like to invite
> everyone to give comments and feedbacks. I do have many more ideas
> floating around, and there are a couple of issues still open, but I think
> the code is ready for wider review and maybe usage, who knows?
>
>
> The current version of the code generates an interface with drag/drop
> capabilities for managing mptt-based trees. It's still very clear that the
> code was extracted from a `classical' page cms. All you need to do
> is the following:
>
>
> -- 8< --
>
> from django.db import models
>
> class Category(models.Model):
>     title = models.CharField(max_length=200)
>     parent = models.ForeignKey('self', related_name='children',
> blank=True, null=True)
>
> -- 8< --
>
> from django.contrib import admin
> from feincms.admin import editor
>
> class CategoryAdmin(editor.TreeEditorMixin, admin.ModelAdmin):
>     pass
>
> admin.site.register(Category, CategoryAdmin)
>
> -- 8< --
>
> The generated admin interface looks like that:
>
> http://spinlock.ch/pub/feincms/category_tree_admin.png
>
> The page cms feeling is still very much there, but we'll see.
>
> In any case, you'll find the code on github:
> http://github.com/matthiask/feincms/tree/master
>
>
> Thanks,
> Matthias
>
>
> -- 
> "Programming is an art form, like the creation
> of poetry or music." (Donald E. Knuth, 1974)
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8598b799-6371-4346-abd2-39c7726189a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to