Community
CommunityThe 'Community' application is the root concept of Sphene Community Tools - Itself does not have any (useful) views on it's own, it just defines a few utility methods and models.
All applications (ie. Board and Wiki) require this application and it's middleware.
1. Features
- User Profiles - Including individual settings for board and wiki with an extensible architecture which can also be used by 3rd party applications !
- Registration and Forgot Username / Password facilities.
- Provides tagging supported - used by the Wiki and Board)
- Provides advanced permissions by using Roles
2. Requirements
It requires the following applications:
- django.contrib.auth
- django.contrib.contenttypes
- django.contrib.sessions
- django.contrib.sites
and the following middleware (these are actually the default in django)
- django.middleware.common.CommonMiddleware
- django.contrib.sessions.middleware.SessionMiddleware
- django.contrib.auth.middleware.AuthenticationMiddleware
- django.middleware.doc.XViewMiddleware
and... template processors (also a django default):
- django.core.context_processors.auth
- django.core.context_processors.debug
- django.core.context_processors.i18n
- django.core.context_processors.request
3. Provided Middleware
It provides the following middleware:
- sphene.community.middleware.ThreadLocals
- sphene.community.middleware.GroupMiddleware
- sphene.community.middleware.MultiHostMiddleware
- sphene.community.middleware.StatsMiddleware
- sphene.community.middleware.LastModified
They are further described in the following sections:
3.1. sphene.community.middleware.ThreadLocals
This is basically the same as: http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser
It provides the request object, currently logged in user, request parameters, etc. in thread local variables which can be accessed by template filters, template tags, models, etc.
It should be one of the first middlewares.
3.2. sphene.community.middleware.GroupMiddleware
If there is a view argument called 'group' it is set by this GroupMiddleware. Either by looking into the arguments for 'groupName' and retrieving it from the database, or by using the ThreadLocals middleware.
3.3. sphene.community.middleware.MultiHostMiddleware
TODO describe me :(
3.4. sphene.community.middleware.LastModified
This middleware is responsible for setting cache related HTTP headers. If the request object has an attribute called 'sph_lastmodified' (containing either 'True' or a datetime object) it will set Last-Modified and other cache related http headers.
4. Provided Template Processors
- sphene.community.context_processors.navigation
4.1. sphene.community.context_processors.navigation
This template processor will put two variables into the template context:
- navigation_left: The navigation items for the "left" navigation.
- group: The current group.
Tags:
Last Modified: 2008-03-23 14:52:27 by Herbert Poul - [ Snip Changes ] [ Wiki History ]
1 Comments
Customize ListPlease login to create a new thread.