Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

cms.models.pagemodel.Page.get_absolute_url performance bug #770

ojii opened this Issue Apr 17, 2011 · 2 comments


None yet
2 participants

ojii commented Apr 17, 2011

cms.models.pagemodel.Page.get_absolute_url should use the precalculated Title.path instead of building the path manually using self.get_cached_ancestors.

@ojii ojii was assigned Apr 17, 2011


ojii commented May 20, 2011

not as trivial as expected, postponed

@ojii ojii pushed a commit to ojii/django-cms that referenced this issue Aug 2, 2011

Jonas Obrist Okay this is a big one:
I wanted to fix #885, which I did.
However it appeared that Page.get_absolute_url was a complete mess.
So I ended up fixing that, by moving page-path (url) logic to post-save (Title/Page) signals and compute them there, and store them in Title.path.
This means Page.get_absolute_url() should be A LOT faster now (=faster menus?), however someone better check that first.
It also means that page/title writes (create,update,move,blah) will be SLOWER, but in my opinion, optimizing reads over writes is preferable.

As a little side effect this commit also potentially fixes #493  due to also fixing #770.

And a further side effect, it will HIDE but NOT FIX #760. Potentially making that bug even more obscure (however it might still show up in the signals).

As you can see, I've changed a lot of tests (because they looked broken in my opinion), so this patch should get extra care.

digi604 commented Apr 8, 2013

fixed a long time ago... closing

@digi604 digi604 closed this Apr 8, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment