jmbo-generic 0.0.2
Jmbo generic behaviour/templates app.
Jmbo Generic
Jmbo generic behavior/templates app.
Contents
Installation
Install or add jmbo-generic to your Python path.
Install django-preferences as described here.
Add generic to your INSTALLED_APPS setting.
Add generic URL include to your project's urls.py file:
(r'^', include('generic.urls')),jmbo-generic includes a number of template sets allowing you to deliver lightweight(zero), mobile(basic) or desktop/touch(full) specific output. Specifying which template set to use is simply a matter of specifying a TEMPLATE_TYPE setting, and adding generic.loaders.TypeLoader to the TEMPLATE_LOADERS setting. For example to use the basic template set update your settings as follows:
TEMPLATE_TYPE = "basic" TEMPLATE_LOADERS = ( 'generic.loaders.TypeLoader', ...other template loader classes... )This causes templates to be loaded from a path prefixed with whatever value was specified as the TEMPLATE_TYPE setting. For example in this case a template specified as generic/home.html would actually be loaded from basic/generic/home.html.
Note
You have to add TypeLoader as the first loader for it to resolve templates correctly.
jmbo-generic includes static media resources which you need to configure as described in Django`s managing static files documentation.
Models
generic.models.Link
Used in conjunction with {% menu %} and {% navbar %} to provide an admin configurable navbar and menu.
Fields
title
A short descriptive title for link.
Methods & Properties
get_absolute_url(self)
Returns URL to which link should redirect based on a reversed view name as specified in view_name field or category view for category specified in category field or otherwise an explicitly provided URL as specified in url field.
is_active(self, request)
Determines whether or not the link can be consider active based on the request path. True if the request path can be resolved to the same view name as is contained in view_name field. Otherwise True if request path starts with URL as resolved for category contained in category field. Otherwise True if request path starts with URL as contained in url field.
generic.models.LinkPosition
Used to determine position/order of elements in {% menu %} and {% navbar %} inclusion tags.
Fields
position
Specifies position/order of link in {% menu %} and {% navbar %} inclusion tags.
Inclusion Tags
generic.templatetags.generic_inclusion_tags
Provides generic inclusion tags like {% menu %} and {% navbar %}. Load these tags by including {% load generic_inclusion_tags %} in your templates.
Authors
Praekelt Foundation
- Shaun Sephton
- Hedley Roos
| File | Type | Py Version | Uploaded on | Size | # downloads |
|---|---|---|---|---|---|
| jmbo-generic-0.0.2.tar.gz (md5) | Source | 2011-09-27 | 244KB | 190 | |
| jmbo_generic-0.0.2-py2.6.egg (md5) | Python Egg | 2.6 | 2011-09-27 | 272KB | 230 |
| jmbo_generic-0.0.2-py2.7.egg (md5) | Python Egg | 2.7 | 2011-09-27 | 272KB | 336 |
- Author: Praekelt Foundation
- Home Page: http://github.com/praekelt/jmbo-generic
- License: BSD
- Categories
- Package Index Owner: Shaun.Sephton, Praekelt
- DOAP record: jmbo-generic-0.0.2.xml
