Comments (2)
I suspect the issue lies somewhere around here in sitetree/sitetreeapp.py
:
535 if not sitetree:
536 if DYNAMIC_ONLY:
537 sitetree = []
538
539 else:
540 sitetree = (
541 MODEL_TREE_ITEM_CLASS.objects.
542 select_related('parent', 'tree').
543 prefetch_related('access_permissions__content_type').
544 filter(tree__alias__exact=alias).
545 order_by('parent__sort_order', 'sort_order'))
546
547 -> sitetree = self.attach_dynamic_tree_items(alias, sitetree)
548 set_cache_entry('sitetrees', alias, sitetree)
549 caching_required = True
453 items = []
454 if not src_tree_items: # THIS IS AN EMPTY ARRAY WHEN `DYNAMIC_ONLY` IS TRUE.
455 if _IDX_ORPHAN_TREES in trees and tree_alias in trees[_IDX_ORPHAN_TREES]:
456 for tree in trees[_IDX_ORPHAN_TREES][tree_alias]:
458 else: # THIS ATTACHMENT BRANCH NEVER GETS RUN
459
460 # TODO Seems to be underoptimized %)
461
462 # Tree item attachment by alias.
463 for static_item in list(src_tree_items):
464 items.append(static_item)
465 if not static_item.alias:
466 continue
467
468 idx = _IDX_TPL % (tree_alias, static_item.alias)
469 if idx not in trees:
from django-sitetree.
The purpose of SITETREE_DYNAMIC_ONLY
as documented here is to prevent reading static trees from DB entirely.
sitetree_resync_apps
is to make your trees static.
Attaching tree items was initialy implemented to allow attachment of dynamic nodes to static.
In your case, if I understand correctly, you want to attach items from one dynamic tree into another.
I'm afraid this case is not covered now. Maybe we could implement that, but it'll probably require registering trees using some definite sequence (first parents, then children).
If you have any ideas of how could this be solved in a backward-compatible, robust and convenient way, you're welcome.
from django-sitetree.
Related Issues (20)
- Dynamic Trees - missing something? HOT 6
- Finer add permission check for displaying the "Add site tree Item" button HOT 3
- How to pass the data models to a menu template ? HOT 4
- Menu Components only appear when the current page HOT 5
- Django 3.1 compatibility HOT 2
- Tests are missing from the sdist HOT 1
- Matching this when multiple URL matches fails HOT 2
- Tree items not displayed in menu if url contains certain special characters HOT 4
- Query the AppConfig directly for its module name HOT 4
- NoReverseMatch on custom models HOT 5
- SiteTree class not returning current item HOT 1
- Sitetreedump with "tree" arguments don't work correctly HOT 1
- compose_dynamic_tree with access_by_perms called in `config.ready` results in database errors HOT 3
- Allow HTML in title_resolved (to allow font-awesome icons) HOT 4
- When changing DEFAULT_AUTO_FIELD setting there are pending migrations
- Building and using a dynamic menu HOT 2
- Dynamic tree items: allow custom attribute binding in item() HOT 1
- Dynamic tree items: simplified access check
- Mapping nested entities to bread crumbs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-sitetree.