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
0
votes
1 answer

Counting all items within django-treebeard Materialised Path nodes

I'm using django-treebeard to create a tree of Categories, each of which contains some Books: from django.db import models from treebeard.mp_tree import MP_Node class Book(models.Model): title = models.CharField(max_length=255, blank=False,…
Phil Gyford
  • 13,432
  • 14
  • 81
  • 143
0
votes
0 answers

Django: How to use OuterRef() for .get() in annotate?

I am using django-treebeard and use a model that allows recursive relations. So, I need to count the number of my descendants using .annotate(), but To get it, you need to go through .get() once, as shown below. However, in that case, OuterRef("pk")…
Jvn
  • 425
  • 4
  • 9
0
votes
0 answers

no such table using ( django-treebeard)

I am trying to view my table in the django-admin panel but i keep reciving no such table (table name) when i am sure it exists. I am using django-treebeard to create a hierarchical data. I have also tried deleting the sql table and migrations. it…
newprogrammer12
  • 231
  • 1
  • 10
0
votes
1 answer

django-treebeard Materialized Path tree depth ended up being zero

I found a problematic node with id 633. tree.find_problems() ([], [], [], [633], [35, 9, 50, 291, 464]) After running tree.fix_tree() It does not find any problems. tree.find_problems() ([], [], [], [], []) But actually 633 is still in some wierd…
jaanus
  • 404
  • 5
  • 14
0
votes
1 answer

wagtail: Adding page as the first child of the parent page on creation

Im trying to add the created list page as the first child of the parent Index page. The problem is that when I use django treebeard api django treebeard api it succeeds sometimes but other times it shows me an error: {'path': ['Page with this Path…
0
votes
1 answer

Retrieve all related objects of objects in a queryset

Asked another question yesterday. Unfortunately, the answer did not solve the problem so I thought I narrow the question down and ask again. I have a Category model which is hierarchial(using django-treebeard). When I run…
0
votes
1 answer

Display objects related to requested object and children in Materialized Path trees

categories/models.py from django.db import models from treebeard.mp_tree import MP_Node class Category(MP_Node): title = models.CharField(max_length=50) slug = models.SlugField(unique=True) node_order_by = ['title'] class Meta: …
0
votes
0 answers

Implementing a hierarchical system in django using django treebeard

I am trying to implement a web based organisational church system which has a hierarchy as shown in the diagram. I want to implement the system using django treebeard materialized path. I want each node on the tree to be an instance of a Church…
0
votes
1 answer

How do I filter for leaf nodes in an MP_NODE

I have a tree model for categories like this: from treebeard.mp_tree import MP_Node class Category(MP_Node): ... And I want to get a queryset with only the leaf nodes.
Francisco
  • 10,918
  • 6
  • 34
  • 45
0
votes
1 answer

Django-Tteebeard using treadbeard field forms in django forms

I am trying to use TreeBeard's built in Form's with django forms (not admin). I specifically wanted to replace the rendering of a Select ForeignKey field with TreeBeard forms format. I thought I could do this by declaring the field in my ModelForm,…
pgwalsh
  • 31
  • 3
0
votes
1 answer

Django-taggit with Django-treebeard or suitable Taxonomy app

Environment: Python 2.7.10 Django 1.11.3 Problem I need a Taxonomy system instead of just tags. For example: Art > Digital Illustration Programming > Websites > Code Fights Programming > Websites > Hackerrank Programming > Websites > Code Fights >…
Chayemor
  • 3,577
  • 4
  • 31
  • 54
0
votes
1 answer

Serializing Treebeard AL_NODE as JSON using Django Serializer

I can't get Django to serialize the AL_NODE as a modelserializer. Is it possible to serialize AL_NODEs? Here is my code: class UserSecuritySelectionModelSerializers(serializers.ModelSerializer): class Meta: model = UserSecuritySelectionModel() …
Axwack
  • 569
  • 1
  • 8
  • 26
1 2 3
4