No project description provided
Project description
A fork of “django-app-plugins” which caches the results of the lookups, saving several db queries per page.
- Requirements:
Django 1.2 or higher, tested up to Django 1.3.1
An exaple of usage is in the blog post http://coderseye.com/2008/app-plugins-example.html A shortened part of this is copied here:
In our base template, we just have to put this tag:
{% plugin_point "shop_sidebar" %}
And in our shop/__init__.py file, we set up the plugin point like so:
def shop_sidebar(point, context, user, *args, **kwargs):
'''A section on the sidebar of the base screen'''
return { }
register.plugin_point(takes_context=True, takes_user=True)(shop_sidebar)
Lastly, we add a new template at templates/wishlist/plugins/shop_sidebar.html
{% load i18n %}
{% if user.is_authenticated %}
<p class="wishlist">
<a href="{% url satchmo_wishlist_view %}">
{% trans 'Wishlist' %}
</a></p>
{% endif %}
A complete functional example and test app from http://coderseye.com/files/app-plugin-test.zip is unzipped to the directory app_plugins/test_app and little upgraded for compatibility with Django 1.3.
One application, which registeres a plugin point by app_plugins. (app “site”) One (or more) application which provide output to this plugin point without knowledge about app_plugins. (app “someapp”)
cd app_plugins/test_app
python manage.py syncdb
python manage.py runserver
Browse to http://localhost:8000/ All templates with names name_of_app/plugins/name_of_pluginpoint.html are combined together to the same plugin point . Applications can be added or removed without changing anything except INSTALLED_APPS.
History
The original project http://code.google.com/p/django-app-plugins/ have been forked at changeset r19 on Jan 25, 2009 (http://code.google.com/p/django-app-plugins/source/detail?r=19 ) Changes of the original project made after this date are mostly not reflected yet.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for djangoplicity-caching-app-plugins-0.1.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c55c23905938b047e7abb2cca1bd801401e0eaa5782f900348979d11313e5556 |
|
MD5 | 734619dd8053463617cf45dad663d1ed |
|
BLAKE2b-256 | 8d5176c3589aa879f8052f5bf37f96eceed5f07f16a3fb8d339f27daced6443b |
Hashes for djangoplicity_caching_app_plugins-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f50401a602464ce80ad49513bfa4f47c2b14fd01d195f336aee1b105089f2a8 |
|
MD5 | 394840c4221fca1bbfdf116b4fe7b932 |
|
BLAKE2b-256 | be7b93e3a68d38f2bf96816e934eafed326015ad5bb483876efa642b9a0fdf9a |