Questions tagged [django-treebeard]

django-treebeard is a pluggable django app that implements efficient tree implementations

django-treebeard is a pluggable django app that implements efficient tree implementations:

  • Adjacency List
  • Materialized Path
  • Nested Sets
57 questions
1
vote
1 answer

Modelling a polymorphic tree with django-treebeard

I cannot seem to find a way to add nodes of various polymorphic types to the same tree. Basically, I think I want a tree whose nodes are either a Company or Region, both inheriting from HierarchyNode which inherits from MP_Node class…
James Maroney
  • 3,136
  • 3
  • 24
  • 27
1
vote
0 answers

Kendo TreeList is Not Refreshing with flat Data

I am using the Kendo TreeList. I have a data structure in the database using an Adjacency List data structure using Django TreeBeard. For the treelist, since the data is nested, I create flat objects and put them into an array. This works, fine but…
Axwack
  • 569
  • 1
  • 8
  • 26
1
vote
1 answer

How to add a second root element?

I have the model: from treebeard.ns_tree import NS_Node class Category(NS_Node): name = models.CharField(max_length=30) node_order_by = ['id'] def __str__(self): return self.name and i try create new root element: >>>from…
1
vote
1 answer

How to use treebeard admin in django 1.8

I am trying to use django-treebeard in the admin section, following suggestions at https://tabo.pe/projects/django-treebeard/docs/2.0/admin.html Using django 1.8 and treebeard 3.0 on python 3.4. models.py: class Site(models.Model): stype =…
velis
  • 8,747
  • 4
  • 44
  • 64
1
vote
1 answer

How to use django-treebeard in Admin?

I am trying to use django-treebeard in the admin section. from https://tabo.pe/projects/django-treebeard/docs/tip/intro.html#configuration Note: If you are going to use the Treeadmin class, you need to add the path to treebeard’s templates in…
Siecje
  • 3,594
  • 10
  • 32
  • 50
1
vote
1 answer

Django Treebeard display tree category using bootstrap effectively

How to traverse a tree of MP_Node (django-treebeard) categories and display effectively with lease amount of queries? I tried looking the docs but I see the queries number increasing with more categories. Is there a method to limit the number of…
Bharathwaaj
  • 2,627
  • 2
  • 22
  • 35
0
votes
1 answer

How to get the all descendants of a node including itself with Django treebeard?

I have Category model extending MP_Node with Django treebeard as shown below: # "models.py" from django.db import models from treebeard.mp_tree import MP_Node class Category(MP_Node): name = models.CharField(max_length=50) node_order_by =…
Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129
0
votes
0 answers

Issue creating relational tables for Django models with django-taggit and django-treebeard

I am trying to create hierarchical tags for my Django blog project using django-taggit and django-treebeard. However, I am encountering issues with the creation of the relational tables. Here is my models.py file: from django.db import models from…
0
votes
0 answers

Is it good idea to use result of dump_bulk() method from django-treebeard instead serialization in Serializer or ModelSerializer classes in DRF?

I wanna to build e-commerce website with Django Rest Framework and React. In e-commerce websites there are nested categories. So I needed to build model which can works with hierarchical data.And I stopped at the Django treebeard library. I've…
SM1L3_B0T
  • 35
  • 1
  • 6
0
votes
0 answers

Get Absolute URL of image using django-treebeard tree responce

Hello currently I implemented django-treebeard package for archive tree structure for categories. Here I faced problem in response with URL of image. I can't see Absolute URL of image categories NOTE - serializer is not working with this recursive…
0
votes
1 answer

Wagtail adding new collection: Integrity Error, UNIQUE constraint failed

I am using Wagtail with a lot of collections (one for each of > 100 users). After renaming a collection via the admin interface, adding a new collection very often results in an integrity error, violating a unique constraint/duplicate key error. I…
Kristin
  • 155
  • 4
0
votes
0 answers

Building a dynamic asynchronous filesystem in django: best practices

I am trying to rebuild our website in Django, and I am currently facing a series of rather difficult challenges for which I am not prepared. I was hoping to get some help in the matter. The website I am building is an online archival platform for…
0
votes
1 answer

How to link hierarhical data into another model in Django?

Consider the following hierarchical data. It can be 3 to 4 levels deep. I understand I can use existing packages like django-mptt or django-treebeard to create a tree data…
user4979733
  • 3,181
  • 4
  • 26
  • 41
0
votes
0 answers

Django treebeard count on each child

I'm using django-treebeard to create tree of Structures (some kind of folders). Each Structure could contain a Resource. When I list my Structures I need to know how many Resources are in current Structure and it's children. Is there a way to Sum…
0
votes
0 answers

Django Treebeard - showing hierarchy in admin page

I've used Django.treebeard to create a hierarchical system to classify books like so: The 'genres' model is related to another model by a many-to-many relationship, and I need to be able to select the right genres (ie, Fiction>Adult>Science…