Comments (10)
Hi,
"Problem. Every content-item ever fetched stays in that dict until Page class is unloaded (forked process dies)"
For me every Page instance should be garbage collected after the view as been executed. The cache dict should be GC as well isn't it?
from django-page-cms.
The dict we are talking about is the class attribute. It will be there until class is unloaded, this isn't implemented in standard CPython as far as I know...
from django-page-cms.
Well then it's a bug that need to be fixed. This cache dict are supposed to be by instance only: data attributes, not class attribute. This is a programmatic error that will certainly create some weird bugs.
from django-page-cms.
Here is the fix for the issue:
http://github.com/batiste/django-page-cms/commit/bd5af3a430c8b2b8f7478a73eb77df8a4c2118a5
The goal of the cache was only to save some hits on the database/memcached on the instance level, like to avoid to hit the database if the user do that:
{{ page.title }} {{ page.title }} {{ page.title }}
What do you think?
from django-page-cms.
Yes, this should fix it. Thanks!
from django-page-cms.
Fixed
from django-page-cms.
Sorry for joining in late...
the issue was non-existent.
As a matter of fact you were declaring the class attributes
but you were always using instance attributes:
in managers.py in method get_content() (around line 215):
if page._content_dict is None: page._content_dict = dict() if page._content_dict.get(key, None): content_dict = page._content_dict.get(key) else: content_dict = cache.get(key)
"page" is a Page instance and the first assignment overrides the class attribute.
from django-page-cms.
Are you saying that everything is ok? I don't quite remember everything.
from django-page-cms.
everything was OK even before the fix.
The fix just makes it easyer to understand that you're using an instance attribute. And that's good.
by the way, I like this cms, we're using it for our website and I'll be posting some pull requests shortly. Thanks!
from django-page-cms.
Nice. I am waiting to see some contributions. Cheers.
from django-page-cms.
Related Issues (20)
- Suggestion - Any plan to add meta_description & meta_keyword fields? HOT 5
- Displaying external application listview and detailview HOT 3
- When editing a page, admin forms forget title/slug/etc HOT 6
- Introduce mptt.admin.DraggableMPTTAdmin HOT 2
- Grappelli drag&drop is unusable
- Enlarge RichTextarea HOT 1
- Split Grappelli CSS in another file HOT 1
- ValueError on django 1.9.7 HOT 1
- Page not found error HOT 1
- Change Page - View on site bug? HOT 2
- General Settings for Pages. HOT 9
- child nodelist is None HOT 1
- Feature Request - Help text for placeholders HOT 1
- Test suite is not stable enough HOT 1
- Language code length issue
- Error After Installation HOT 1
- Broken image, language and page settings issues HOT 8
- integrate in templates
- Css and jquery broken on django 2.2
- Some tests misusing assertTrue for comparisons
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-page-cms.