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
1
vote
0 answers

Django - problems with Grappelli, mptt and sorting fields

I am using Grappelli admin for it's great sortable fields function. However, I don't seem to be able to get it to work with mptt. Here's my code: class Category(models.Model): name = models.CharField(max_length = 100) def…
QlliOlli
  • 637
  • 3
  • 13
  • 25
1
vote
0 answers

Django MPTT : how to implement recursetree inside a recursetree tag.

Its like inception here .
    {% recursetree nodes %} {% recursetree #i get values dependsing on node which is a mptt model %} {{ node.name }} {% endrecursetree %} {%…
Kiran Ruth R
  • 902
  • 1
  • 11
  • 28
1
vote
3 answers

Django admin + MPTT : How to display children when filtering a parent node?

I set up 2 models Article and Taxonomy. Taxonomy is an MPTTModel Subclass. All is working fine except one thing : If I select a parent node that has no Article linked to it it will not display Articles linked to children nodes. So I am trying to…
Matthieu
  • 1,084
  • 12
  • 23
1
vote
1 answer

Django MPTT - how to query based on URL segments

I have: Home Things with Fur Dog Horse Basket Ball Games Twenty One Horse Assuming the slug for each is title.lower().replace(' ', '-'), my URLs would be: /home/ /home/things-with-fur/ …
orokusaki
  • 55,146
  • 59
  • 179
  • 257
0
votes
1 answer

MPTT - How can I pass extra data for each node to the template?

Given the following view: def comments(request): comments_list = Thing.objects.filter(thing_type=2) #Thing model extends MPTTModel comments_extra_data_list = Data.objects.filter(thing__in=comments_list) #Data objects have data for…
bentzy
  • 301
  • 2
  • 4
  • 15
0
votes
1 answer

django-mptt : Filter all categories having an online entry

I am passing this Django Blog App category system to django-mptt. The problem I have is about the _get_online_category method. This method allows me to get only the category having an Entry. def _get_online_categories(self): """ Returns…
Natim
  • 17,274
  • 23
  • 92
  • 150
0
votes
2 answers

Determining first and last element for each level in django-mptt

I am using django mptt to display navigational menu. {% load mptt_tags %}
Aidas Bendoraitis
  • 3,965
  • 1
  • 30
  • 45
0
votes
1 answer

SQL query to avoid fetching the entire nested set when parts of it are collapsed by the user

I'm trying to tie django-mptt and contrib.admin together by providing something friendlier than a flat list in the admin. Because the trees are supposed to be large (otherwise i wouldn't be using nested sets), users should be able to expand and…
Сыч
  • 930
  • 1
  • 8
  • 15
0
votes
0 answers

Django (RF) : Allow child comments (MPTT model) to be created within same Post as parent comment

I have a Post model and Comment model. The second one based on MPTT model to achive comments arrangement in a tree format. Everything works but the problem is to restrict new child Comment to be linked with other then parent Post on…
0
votes
1 answer

How to reply comment using django and javascript

Please, I need help with my code, I have been unable to figure out my mistake for two days. I have a comment system that work properly but I want user to be able to reply comments. My issue now is that the reply comment is not submitting as I keep…
0
votes
0 answers

Django-mptt model does not order by profile (ForeignKey), but it does after rebuild()

Django-mptt model does not order by (order_insertion_by) profile (ForeignKey), but it does after rebuild() models.py class Product(MPTTModel): # fields profile = models.ForeignKey( Profile, blank=True, null=True, …
comp_boon
  • 79
  • 7
0
votes
1 answer

Does django-mptt support nested models?

I have a database of nested entities, that actually address parts: Street-House-Technical Room. In other words, I'd like to have a tree of nodes with different attributes on each level. What I'd like to implement is to use django-mptt features for…
Andrii
  • 31
  • 6
0
votes
0 answers

dropdown menu with django-mptt in template

I want to make django mptt model dropdown menu. But I'm having trouble applying it to templates. I wrote the code at a certain level, but sometimes it works, sometimes it doesn't.
fero
  • 1
  • 2
0
votes
1 answer

Django-mptt with different parent model

I'm adding a new feature to the existing application. This new feature will inform the user how to get an award by collecting emblems. The application will show how to get the award (I plan to use the Django-mptt or probably the…
0
votes
0 answers

How i can to use django-import-export with a django-mptt?

In the project i used 2 packages "django-import-export" and "django-mptt" url follow below. django-import-export : https://django-import-export.readthedocs.io/en/latest/ django-mqtt : https://django-mptt.readthedocs.io/en/latest/overview.html I…
devnext
  • 872
  • 1
  • 10
  • 25