Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Proposal: Sub-divide the page tree so it renders faster for sites with many thousands of pages#7933

jrief started this conversation inPolls
Discussion options

jrief
Jun 12, 2024
Collaborator

For sites which scale to many thousands of pages, it would be beneficial to separate the Page-tree into Departments, rather than Sites.

Currently each object of typeTreeNode has a foreign key onto a Site objects. This is fine for multi-tenant configurations with a few hundred pages per site. It does however not scale well for sites with many thousands of pages. This is because opening the page tree's list-view becomes time consuming since users have to drill down deeply. It also requires a lot of time to compute the permissions, since all pages of a site must be fetched from thePage model.

I therefore would like to add a new model namedDepartment which itself has a foreign key toSite. ModelTreeNode would then be altered to have a foreign key ontoDepartment instead ofSite. This adds another level of indirection and can be made fully backwards compatible. It however can be used to partition the page tree into many departments and hence give users a much clearer view of the pages they are allowed to edit.

Is there any objection to this proposal?
Yes – keep everything as it currently is.
0%
No – please proceed with this proposal.
100%

2 votes

You must be logged in to vote

Replies: 4 comments 11 replies

Comment options

jrief
Jun 12, 2024
Collaborator Author

This could be integrated together with#7873

You must be logged in to vote
0 replies
Comment options

marksweb
Jun 12, 2024
MaintainerSponsor

I'm in favour of this as it might even help smaller projects. However, I wouldn't call it "Department" because that's quite specific when what we're looking for is something that groups pages or categorises them. "Department" assumes an organisation structure which may not be in place.

Maybe the groups of pages would also have their own permissions associated?

You must be logged in to vote
8 replies
@jrief
Comment options

jriefJun 12, 2024
Collaborator Author

I like both terms,Collection andChapter. Maybe chapter is a good analogy to page. Anyway, we must provide a way to allow nestest chapters/collections. This is to further subdivide the page tree if it gets bigger and bigger. At the University of Innsbruck, we are heading towards ~100k pages. Since books never (rarely?) have nested chapters, the term collection may be a better name.

@fsbraun
Comment options

fsbraunJun 12, 2024
MaintainerSponsor

Just as a side-remark:Collection is used by djangocms-moderation. A site could have severalsections containing pages. (But then again,<section> is also a HTML tag used on a page.)

@sparrowme
Comment options

@fsbraun would this lend itself to the djangocms-categories idea you proposed a while back when the issue was brought up of tying blog entries to categories for "subscribing"... would/could that abstraction possibly fit this scenario as well?

@jrief
Comment options

jriefJun 12, 2024
Collaborator Author

The term "section" is also commonly used for CMS plugins. So this could be confusing.

@fsbraun
Comment options

fsbraunJun 12, 2024
MaintainerSponsor

@sparrowme Interesting thought! the djangocms-categories was an idea to be used to categorize any content element( like pages, blogs, etc...) It would have a generic foreign key and would be available to models through a manager (just likePlaceholderRelationField makes placeholder available).

Comment options

jrief
Jun 17, 2024
Collaborator Author

Currently, the best term we found for that new model isDivision. As@marksweb pointed out, the term "department" assumes an organisation structure which may not be in place.

This means that we would change the following models:

  • ModelPage andTreeNode will be merged intoPage. This separation was required by CMS version<4 because then, oneTreeNode could have more than onePage. This is a legacy now. See discussionMerge models Page with Node #7873.
  • There will be a new model namedDivision. Its two fields are a stringidentifier and a foreign key ontoSite. There is a unique together constraint onidentifier andsite.
  • In modelPage the foreign key ontoSite will be replaced by the nullable foreign key_division onto that new modelDivision. That foreign key_divison is unique, meaning that there can only be one page pointing onto a given object of typeDivision. For root pages, the foreign key_division is required (non-nullable).
  • Each object of typePage has a property nameddivision returning the value of_division. If_division isNone, it returns the valuedivision from its parent page.
You must be logged in to vote
0 replies
Comment options

fsbraun
Jun 18, 2024
MaintainerSponsor

Quick feedback from thediscussion at the tech committee last Friday:

  • The feature issupported
  • The naming should not assume or imply a specific organizational setup (like Department or Division)
  • According to django CMS 4 philosophy, thepreferred implementation is through a package outside the core
  • Something similar (though not identical) has been done withdjangocms-navigation (https://github.com/FidelityInternational/djangocms-navigation) as@NarenderRajuB pointed out
    • It allows managing the site navigation independently of the page tree through the admin (which might be part of the objective of this proposal)
    • For now, I have not found any documentation, though
    • It has been developed for django CMS 4.0, and would need some disentangling from assumptions about djangocms-versioning and the presence of djangocms-references to be used with django CMS 4.1+
  • Someopen questions need to be clarified about the functional scope of the proposal:
    • There was consensus that the user's view on the page tree is supposed to be restricted (which could potentially be done without changes in the model, e.g., based on permissions).
    • It remained unclear for the moment what the interaction with permissions will be: Are permissions being influenced by the new field? How can you secure that you can see all parts of the page tree you have permissions for?

@marksweb Is there anything to add from our discussion?

You must be logged in to vote
3 replies
@jrief
Comment options

jriefJun 18, 2024
Collaborator Author

Sincerely, I have no idea how to implement this feature request as a third party package. The modelPage is a fundamental part of Django-CMS andSite is built into Django itself. Therefore I would be interested in proposals on how to make this relationship pluggable.

@marksweb
Comment options

markswebJun 18, 2024
MaintainerSponsor

Sincerely, I have no idea how to implement this feature request as a third party package. The modelPage is a fundamental part of Django-CMS andSite is built into Django itself. Therefore I would be interested in proposals on how to make this relationship pluggable.

I think this is the real point here. We've got this new version that's more powerful than any of us know because we've lost the knowledge of those who built it.

But what we do know is that through the new CMSConfig concept we can do powerful things that weren't possible before that allow apps to change functionality if they're installed.

@fsbraun
Comment options

fsbraunJun 20, 2024
MaintainerSponsor

I had some thoughts on categories before, on how to define a general categorizing model.

But the first thing needing to be clarified would be if page permissions would not allow for filtering out the subtree(s) that should be displayed in the page tree.

If not, I'd go for a nullable one2one model to thePage model. Then, the third-party package needs to have aCMSAppConfig subclass incms_config.py which implements aconfigure_app method. In this method, the third-party package can inject something like thedivision method from theprevious comment intoPage using Django'sadd_to_class method. The admin'sget_queryset might have to be adjusted, and the page tree template would have to be overwritten to include a widget for selecting the "division".

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Polls
Labels
None yet
4 participants
@jrief@sparrowme@marksweb@fsbraun

[8]ページ先頭

©2009-2025 Movatter.jp