Questions tagged [django-mptt]

django-mptt is an implementation Modified Preorder Tree Traversal for handling trees of Django Model instances.

django-mptt is an implementation Modified Preorder Tree Traversal for handling trees of Django Model instances.

Useful links:

351 questions
0
votes
1 answer

global name not defined when filtering on model

i am a beginner in django mptt....thanks in advance class Category(MPTTModel): title = models.CharField(max_length =120) parent = TreeForeignKey('self' , null = True , blank = True , verbose_name='parent category',…
0
votes
0 answers

HTML refreshing on click

I'm using the sample found here http://stackoverflow.com/questions/27218680/how-can-i-reload-just-one-div-on-click and I think I'm missing something in my example or maybe the value is not passing as I'm using MPTT instead of a standard menu. This…
whoisearth
  • 4,080
  • 13
  • 62
  • 130
0
votes
1 answer

Is django's mtpp break manytomany filter?

I have models like below: class Topic(MPTTModel): parent = TreeForeignKey('self', null=True, blank=True, related_name='children', db_index=True) name = models.CharField(max_length=200, blank=False) tasks =…
lsaturn
  • 145
  • 1
  • 11
0
votes
1 answer

django-mptt children selection works on localhost but not on server

I have the same code on localhost and on server (thanks to mercurial), but it works a little bit different. I want to render category and its subcategories in template using this code: views.py: def category(request, category_slug): try: …
Enchantner
  • 1,534
  • 3
  • 20
  • 40
0
votes
1 answer

Django custom admin action for FeinCMS actions column

I'm making an admin panel for a Django-Mptt tree structure using the FeinCMS TreeEditor interface. This interface provides an 'actions column' per-node for things like adding or moving nodes quickly without using the typical Django admin action…
Chaffelson
  • 1,249
  • 9
  • 20
0
votes
2 answers

django-mptt & django 1.2

From the homepage of django-mptt Version 0.2.1 is not compatible with Django 1.0 and above - please use SVN trunk for now I tend to avoid using trunk for work that is going live any time soon, But I have a rush job. Does it work with Django 1.2,…
sjh
  • 2,236
  • 1
  • 18
  • 21
0
votes
2 answers

Upgrading from Django 1.7.1 to 1.8.2 fails

My Django 1.7.1 application runs fine. But I would like to upgrade to the more recent version 1.8.2. I'm following the instructions here which basically just say to do pip install -U Django from within my VirtualEnvironment. After I do that line…
Saqib Ali
  • 11,931
  • 41
  • 133
  • 272
0
votes
1 answer

recursetree code not working

I'm trying to fix a bug that appeared on a website I'm maintaining www.kenyabuzz.com the top navigation won't get the children elements. This is the code for the top nav I think {{ children }} is missing. {% recursetree top_menu %} …
0
votes
1 answer

Get first descendant with django-mptt

I'm using try: my_group.get_descendants().filter(number=number)[0] except IndexError: pass when I want to get all groups with my_group as an ancestor but only choose the first. Can I make the database do this for me? I'm thinking of…
Jamgreen
  • 10,329
  • 29
  • 113
  • 224
0
votes
1 answer

Using Custom Query For Children In django-mptt

I have added a custom field for my model (status). But I want to use a custom query for children: my template tag is: def get_top_menu(context): item = Item.objects.all() try: item = Item.objects.filter(position__position='top') …
TheNone
  • 5,684
  • 13
  • 57
  • 98
0
votes
1 answer

Folderlike group-structure with django-mptt

I would like to implement the following user-group structure in my application: Group_1 Group_1_1 Group_1_2 Group_2 Group_2_1 Group_2_1_1 I did manage to do that with django-mptt, but I am facing the following problem at the…
Icho Tolot
  • 11
  • 3
0
votes
1 answer

Add a new root node to django-mptt tree

How can I add a new root node to an existing tree in django-mptt? I am using Django 1.7.4 and django-mptt==0.6.1 with FactoryBoy to test trees. I tried the following: my_leaf.move_to(my_root, position='left') # creates a new…
robline
  • 450
  • 4
  • 13
0
votes
1 answer

Find Second Level Children In Django Mptt

I have a model that have a field like this: parent = TreeForeignKey('self', null=True, blank=True, related_name='children') I want to add parent to a select box and then with onclick, select the second level…
TheNone
  • 5,684
  • 13
  • 57
  • 98
0
votes
1 answer

Representing Hierarchical Data in Tastypie

everyone! I'm new to Django (and Tastypie) and i'm having some issues with hierarchical data. In my project, we have a couple of categories, represented by the following model: class Category(MPPTModel): desc = models.CharField(max_length=200) …
Erick Luis
  • 11
  • 2
0
votes
1 answer

Bug in Django MPTTMeta order_insertion_by causes nodes to report incorrect descendants?

My Django application has a model called Treenode which implements a tree by subclassing the MPTTModel (Version 0.6.1). The model is as follows: from mptt.models import MPTTModel, TreeForeignKey class Treenode(MPTTModel): name =…
Saqib Ali
  • 11,931
  • 41
  • 133
  • 272