mptt Questions

1

Say, I've got a product instance. Product instance linked to 4th level child category. If I only want to get root category and 4th level child category the query below is enough to fetch data with ...
Jolo asked 2/5, 2019 at 14:34

6

Solved

I have a list of items in a hierarchy, and I'm attempting to parse this list out into an actual hierarchy of objects. I'm using modified pre-order tree traversal to store/iterate through this list,...
Monogram asked 25/11, 2008 at 22:24

2

I was trying to find solution for this (Google cache) And I could only came up with a solution like this: import json from mptt.utils import tree_item_iterator from rest_framework import gene...
Demented asked 11/12, 2017 at 23:36

2

Solved

I'm using mptt in a model to manage a tagging system (each tag has an optional TreeForeignKey to a 'parent' tag) Whenever I need to save a tag model, the following query runs exceptionally slow (u...
Asperse asked 28/12, 2015 at 16:14

3

Solved

I am trying to get all descendants(include_self=True) not for one Node, but for a list (a QuerySet) of Nodes. This should be one SQL query. Example (that actually is not working:) some_nodes ...
Iz asked 19/4, 2011 at 21:11

3

I am trying to get the objects of all the children of a given node on Django with django-mppt I have a model designed as shown below, the classes/categories (node) with the same indent level defin...
Mccrary asked 26/10, 2015 at 21:29

3

Solved

I don't have a background in CS or data structures. I want to make a PHP class that stores a modified preorder transversal tree, for manipulation and syncing with a database. Basically I need to ...
Westernmost asked 5/8, 2010 at 19:59

1

Is there a Rails ACL plugin/gem that uses MPTT (Modified Preorder Tree Traversal) as the technique to administer permissions? I'm looking for ACL that will allow me to create roles, assign users t...
Mudslinging asked 1/11, 2011 at 16:9

4

Solved

I have an MPTT tree of over 100,000 records stored in MySQL using lft, rght and parent_id columns. Now the left/right values became corrupted, while the parent ids are still intact. It would requir...
Lassiter asked 2/9, 2010 at 3:30

1

Solved

I'm trying to make a model for categorizing some objects. I already tried using django-mptt to easily retrieve related categories, and now I'm searching different solutions to find the best one. ...
Asco asked 5/11, 2009 at 17:42

2

Solved

For a while now I've been wrestling with how best to handle hierarchies in SQL. Frustrated by the limitations of adjacency lists and the complexity of MPTT/nested sets, I began thinking about simpl...
Obla asked 19/11, 2011 at 18:18

2

Solved

Does anybody have an efficient algorithm to retrieve all ancestors of an mptt queryset? The best I could think of so far is something like this: def qs_ancestors(queryset): if isinstance(queryset...
Imhoff asked 24/6, 2011 at 17:15

1

Solved

I'm looking for a good way to store and use hierarchical (parent/child) data in Django. I've been using django-mptt, but it seems entirely incompatible with my brain - I end up with non-obvious bug...
Noenoel asked 23/4, 2010 at 15:37

1

Solved

I'm attempting to use django-mptt with very little luck. This is with Python2.5, windows, sqlite3, Django 1.2pre , django-mptt latest from svn. The code: model: class Node(models.Model): name =...
Dialogize asked 28/1, 2010 at 7:12

1

Solved

In CakePHP, how do you select just a subtree in a model which actsAs tree? I tried this, to find the tree headed by the item with label = "My Label" $this->find("threaded", array( "conditions...
Pet asked 21/10, 2009 at 0:50
1

© 2022 - 2024 — McMap. All rights reserved.