Software Index
Linux Software Programming  

django-generic-flatblocks

download download home home   report broken
important software information
company name:
Martin Mahner
license: Freeware
minimum requirements:
functional limitations:
django-generic-flatblocks description
django-generic-flatblocks is a Django plugin that solves this problem as it knows nothing about the content itself. You attach your hand made content node (a simple model) where you can define any fields you want.

Installation

1. Insert django_generic_flatblocks to your INSTALLED_APPS in your settings.
2. (optional) Define the url prefix to your contrib.admin installation in the setting ADMIN_URL_PREFIX. Most commonly this is /admin/. Beware the trailing slash.
3. Resync your database: ./manage.py syncdb

Usage in templates

First of all, in every template you want to use generic-flatblocks, load the templatetags library:

{% load generic_flatblocks %}

Then define a content node using the gblock templatetag:

{% gblock "unique_slug" for "applabel.modelname" with "render/with/template.html" as "variable" %}

The arguments in detail:

* "unique_slug" (required): The slug argument defines under which key the content is stored in your database. You can define as many slugs as you want, just use a comma as separator. You can use context-variables as well. Examples:

"homepage headline" becomes "homepage_headline"
"homepage","headline" becomes "homepage_headline"
"homepage_title",LANGUAGE_CODE becomes "homepage_title_en" (depends on the users locale code)

* for "applabel.modelname" (required): The for argument defines, what content-node (model) will be used to store and display the content. The format is appname.modelname. For some contributed content-nodes see Contributed content nodes below. This argument can be a context-variable.
* with "template_path" (optional): You can define a template that is used for rendering the content node. If you do not provide any template, the default template //flatblock.html is used. This argument can be a context-variable.
* as "variable name" (optional): If you provide a variable name, the rendered content node is stored in it. Otherwise it's displayed directly. This argument can be a context-variable.

Create your own content node

A content node is a simple django-model. No quirks. If you want to use a title and a textfield as your content-node, define a new model Entry in your application myproject:

from django.db import models
from django.contrib import admin

class Entry(models.Model):
title = models.CharField(max_length=255, blank=True)
content = models.TextField(blank=True)

def __unicode__(self):
return self.title

admin.site.register(Entry)

Important

django-generic-flatblocks creates an empty content-node upon first request, so make sure each field has either it's default value or allow blank=True. Don't forget to register your Model in the admin backend, if you want to edit it there.

Then create a template myproject/entry/flatblock.html in your template directory. This template is the default template to render the content node, if you do not provide a unique template for it (with argument).

In this template are all context-variables from the parent template available plus some extra variables:

* object: This variable is the model-instance for the generic block.
* generic_object: This variable is the model-instance for the generic content object itself. Mostly you don't need this.
* admin_url: A URL to the change view of the current object. This variable is None if the current user has no change permissions for the object.

A common template source for the above content node would be:

< h1 >{{ object.title }}< /h1 >
{{ object.content|safe }}

{% if admin_url %}edit this{% endif %}

In your templates, create a new content node using the templatetag:

{% gblock "about_me" for "myproject.Entry" %}

Contributed content nodes

django-generic-flatblocks comes with some very commonly used content-nodes. They are not installed by default. To do so, insert django_generic_flatblocks.contrib.gblocks to your INSTALLED_APPS in your settings and resync your database: ./manage.py syncdb.

The contributed content nodes are:

* gblocks.Title: A CharField rendered as a Tag.
* gblocks.Text: A TextField rendered as html paragraphs. (This is what django-chunks provides)
* gblocks.Image: A ImageField rendered as Tag.
* gblocks.TitleAndText: A CharField and a TextField. (This is what django-flatblocks provides)
* gblocks.TitleTextAndImage: A CharField, TextField and ImageField

So if you want to display a title and textfield, use this templatetag for example:. Martin Mahner: Designer, Programmer and Catfeeder. Publisher of django-generic-flatblocks, Author of django-generic-flatblocks 0.3.0. django-generic-flatblocks is a Django plugin that solves this problem as it knows nothing about the content itself. You attach your hand made content node (a simple model) where you can defi
Similar software
django-uni-form (Popularity: ) : Django forms are easily rendered as paragraphs, tables, and unordered lists. However, elegantly rendered div based forms is something you have to do by hand. The purpose of this application is to provide a simple tag and/or filter that lets ...
django-markup (Popularity: ) : django-markup is a generic way to provide filters that convert text into HTML.. Martin Mahner: Designer, Programmer and Catfeeder. Publisher of django-markup, Author of django-markup 0.3. django-markup is a generic way to provide filters that convert text into HTML. The ...
django-attachments (Popularity: ) : django-attachments is a generic set of template tags for the Django framework to attach any kind of files to models.

Installattion:

Put attachments to your INSTALLED_APPS in your settings.py within your django project. This app provides a additional permission delete_foreign_attachments which enables ...

django-frontendadmin (Popularity: ) : django-frontendadmin is a set of template tags to allow an easy and unobtrusive way to edit model-data in the frontend of your page.

Example project

This package provides an easy example project, a weblog with comments. Here is a quick step-by-step guide ...

django-ajax-filtered-fields (Popularity: ) : django-ajax-filtered-fields contains Django fields which may be used in a many to many or foreign key relation, where the user may want to apply filters to the listed objects, because of they being too many, or just for usability reasons.

Technical ...

django-friends (Popularity: ) : Many websites allow users to assert relationships between other users, to upload contacts and to invite their contacts to become users.

django-friends is a Django plugin that aims to provide an app for this sort of functionality. This includes:

* relationships between ...

django-authority (Popularity: ) : django-authority is a Django app for per-object-permissions that includes a bunch of helpers to create custom permission checks.

The main website for django-authority is packages.python.org/django-authority. You can also install the in-development version of django-authority with pip install django-authority==dev or easy_install django-authority==dev.

Example:

To ...

Daemon::Generic (Popularity: ) : Daemon::Generic is a Perl module that provides a framework for starting, stopping, reconfiguring daemon-like programs. The framework provides for standard commands that work for as init.d files and as apachectl-like commands.

Programs that use Daemon::Generic subclass Daemon::Generic to override its behavior. ...

django-disqus (Popularity: ) : django-disqus is a Django plugin to easily integrate DISQUS comments into your Django website.. arthurk's django-disqus at master - GitHub. Easily integrate DISQUS comments into your Django website
django-tools (Popularity: ) : django-tools is a plugin with miscellaneous tools for Django.

Installation:

You can easy install it with:

easy_install django-tools. . Publisher of django-tools, Author of django-tools 0.5.0 Beta. django-tools is a plugin with miscellaneous tools for Django. Installation: You can easy install it with: ...

Disco-Light X (Popularity: ) : Disco-Light X is a light and colourful GTK theme.

How to install?

· Right click on your desktop and select Change Desktop Background
· Click on the first tab: Theme
· Drag and drop the theme's archive in the Appearance Preferences window.
· If everything ...

django-ticker (Popularity: ) : django-ticker is a simple Django plugin for news ticker with a row level permission based workflow.. Martin Mahner: Designer, Programmer and Catfeeder. Publisher of django-ticker, Author of django-ticker 0.2.1. django-ticker is a simple Django plugin for news ticker with a ...
User reviews

Write a review:
1 2 3 4 5 6 7 8 9 10
1=poor 10=excellent
Write review*
Your name*
Email*
  (Comments are moderated, and will not appear on this site until the editor has approved them)
 
Similar scripts
simple generic library (Popularity: ) : This is a simple generic libary for interactive art and design. This library wraps Ruby/SDL ang OpenGL. The main purpose for this library is teaching interactive desing for art school student.
Generic Menu Selection (Popularity: ) : Generic console menu selection. Change function names to whatever you have and want options to be, this will continue to go through and ask the menu choic everytime until exit is selected.

There really isn't a need for 6 options ...

Generic Actions (Popularity: ) : Generic Actions - Generic Actions for Ruby
Generic Tree Data Structure for Ruby (Popularity: ) : Generic Tree Data Structure for Ruby is a simple to use general purpose Tree data structure implementation in Ruby.It provides easy access methods for navigating the hierarchy, as well as for accessing the nodes. Also provides ability to marshal the ...
Distributed Generic Info Retrieval (Popularity: ) : Distributed Generic Information Retrieval (DiGIR) - developing and testing a protocol for single point access to distributed data sources. Based on HTTP, XML, and UDDI.
Turbo Coding For Generic RSC Coders (Popularity: ) : Generic transmitter-receiver turbo coding scheme with puncturing and generic RSC coders. It represents the trellis structure and puncturing can be specified.BER plots can be output.
Generic particle filter (Popularity: ) : Implementation of the generic particle filterArulampalam et. al. (2002). A tutorial on particle filters for online nonlinear/non-gaussian bayesian tracking. IEEE Transactions on Signal Processing. 50 (2). p 174--188
G2A - Generic Genetic Algorithm (Popularity: ) : Generic class for genetic algorithms, making it possible to evolve any class.
GNN - Generic Neural Network (Popularity: ) : Generic Neural Network. It's a class to build almost any type of Neural Networks, from a simple Perceptron to a SOM, supporting recurrence.
A Generic Database Web Editor (Popularity: ) : A Generic Database Web Editor is a tutorial which helps in managing the database through web. Here the author discusses about the connection string and statement in SQL to administer the database and suggest to provide more security to the ...
Rate me
supported os's
stats
downloads 10
version 0.3.0
size in Kb 10
popularity   
1875/1272475
user rating 5/10
our rating 0 Stars
share info
Recommend django-generic-flatblocks
Report spyware
New Software
Popular Software
Latest Reviews