Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 29.548.472 Times

django-generic-flatblocks 0.3.0

Company: Martin Mahner
Date Added: June 13, 2013  |  Visits: 426

django-generic-flatblocks

Report Broken Link
Printer Friendly Version


Product Homepage
Download (17 downloads)



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.<br /><br />Installation<br /><br /> 1. Insert django_generic_flatblocks to your INSTALLED_APPS in your settings.<br /> 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.<br /> 3. Resync your database: ./manage.py syncdb<br /><br />Usage in templates<br /><br />First of all, in every template you want to use generic-flatblocks, load the templatetags library:<br /><br />{% load generic_flatblocks %}<br /><br />Then define a content node using the gblock templatetag:<br /><br />{% gblock "unique_slug" for "applabel.modelname" with "render/with/template.html" as "variable" %}<br /><br />The arguments in detail:<br /><br />* "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:<br /><br /> "homepage headline" becomes "homepage_headline"<br /> "homepage","headline" becomes "homepage_headline"<br /> "homepage_title",LANGUAGE_CODE becomes "homepage_title_en" (depends on the users locale code)<br /><br />* 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.<br />* 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.<br />* 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.<br /><br />Create your own content node<br /><br />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:<br /><br />from django.db import models<br />from django.contrib import admin<br /><br />class Entry(models.Model):<br /> title = models.CharField(max_length=255, blank=True)<br /> content = models.TextField(blank=True)<br /><br /> def __unicode__(self):<br /> return self.title<br /><br />admin.site.register(Entry)<br /><br />Important<br /><br />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.<br /><br />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).<br /><br />In this template are all context-variables from the parent template available plus some extra variables:<br /><br /> * object: This variable is the model-instance for the generic block.<br /> * generic_object: This variable is the model-instance for the generic content object itself. Mostly you don't need this.<br /> * 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.<br /><br />A common template source for the above content node would be:<br /><br />< h1 >{{ object.title }}< /h1 ><br />{{ object.content|safe }}<br /><br />{% if admin_url %}edit this{% endif %}<br /><br />In your templates, create a new content node using the templatetag:<br /><br />{% gblock "about_me" for "myproject.Entry" %}<br /><br />Contributed content nodes<br /><br />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.<br /><br />The contributed content nodes are:<br /><br /> * gblocks.Title: A CharField rendered as a Tag.<br /> * gblocks.Text: A TextField rendered as html paragraphs. (This is what django-chunks provides)<br /> * gblocks.Image: A ImageField rendered as Tag.<br /> * gblocks.TitleAndText: A CharField and a TextField. (This is what django-flatblocks provides)<br /> * gblocks.TitleTextAndImage: A CharField, TextField and ImageField<br /><br />So if you want to display a title and textfield, use this templatetag for example:<br /><br />{% gblock "about_me" for "gblocks.TitleAndText" %}<br /><br />md5=c98c2c1d3dc8d74f635177ce438e70cc

Requirements: No special requirements
Platforms: *nix, Linux
Keyword: Argument Charfield Content Contentnode Database Default Define Django Generic Flatblocks 0 3 0 Gblock Model Object Optional Provide Rendered Template Templatetag Textfield Title Variable
Users rating: 0/10

License: Freeware Size: 10.24 KB
USER REVIEWS
More Reviews or Write Review


DJANGO-GENERIC-FLATBLOCKS RELATED
Personal Information Managers  -  DICOM Dumper 1.1
DICOM Dumper is a free and simple Java-based utility for decoding and dumping the content (Data Elements of the Data Set) of DICOM 3.0-compliant files. Since it is developed in Java, it should run on every OS for which a Java Runtime Environment...
128 KB  
Programming  -  django-generic-images 0.36
django-generic-images is a Django plugin that provides image model (with useful managers etc) that can be attached to any other Django model using generic relations. md5=a99a15c994543cfad18e19a1a572d4c2
368.64 KB  
Network & Internet  -  django-generic-confirmation 0.3.0
Every time a user enters data and you only want to accept it after it was verified (think of: email addresses, (mobile) phone numbers, postal addresses, bank accounts ...) django-generic-confirmation will allow you to implement the confirmation...
10.24 KB  
Network & Internet  -  django-nani 0.0.2
django-nani provides a high level API to maintain multilingual content in your database using the Django ORM.
30.72 KB  
Network & Internet  -  lfc-theme 1.0 Beta 3
The lfc-theme package contains the default theme for LFC. LFC is a Content Manangement System based on Django. #md5=fc48e8cf32f991cd397d9a01e5acd825
102.4 KB  
Content Management  -  dorcMan for Scripts 3.0.2
dorcMan is a dynamic object-related content management system.Dynamic: Web site layout and content are database-driven and controlled through easy to use web-based interfaces.Object-Related: The code is object oriented, which makes it modular,...
522.24 KB  
Network & Internet  -  django-versions 1.0.1
django-versions allows you to version the data stored in django models seamlessly. To get started all you need to do is to set VERSIONS_REPOSITORIES variable in your settings and configure the repositories you would like to use, then just subclass...
20.48 KB  
Web Browser Tools  -  Define Word 0.7.0 for Firefox
Define Word is an extension which allows you to look up definition of selected text. Look up definition of selected text using any of several search engines. The list of engines is configurable..
8.19 KB  
Libraries  -  Gtk2::Ex::MindMapView::ContentFactory 0.000001
Gtk2::Ex::MindMapView::ContentFactory is a maker of standard content. SYNOPSIS use Gtk2::Ex::MindMapView::ContentFactory; This module is internal to Gtk2::Ex::MindMapView. This factory makes content that can be passed to a...
50.18 KB  
Communication Tools  -  ActiveBoard b
A fully featured bulletin board system that uses flat files to store content (no database system required).
323.11 KB  
NEW DOWNLOADS IN PROGRAMMING, SPECIALIZED TOOLS
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
Specialized Tools  -  wolfSSL 3.10.2
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
2.73 MB  
Specialized Tools  -  SIMRI 2.0
SIMRI: a versatile and interactive Magnetic Resonance Imaging (MRI) simulator.Such a simulator is a command line software written in C that reproduces the physical phenomenas encountered during an MRI acquisition to produce a realistic MRI image.
6.39 MB  
Specialized Tools  -  Java Web Start Plugin for Eclipse 1.2.1
Java Web Start Plugin for Eclipse (WS4E) helps you to deploy your Java application through Java Web Start. With WS4E, Developers with very little knowledge can deploy their applications with just a few clicks. For advanced developers, WS4E is...
204.8 KB  
Specialized Tools  -  TUGGO for Linux 1.0.0
TUGGO is a website management system allowing anyone to easily create their own website without any code knowledge.
942.08 KB  
Specialized Tools  -  Jigs Persistent Objects (JPO) 0.2
Welcome to the Java Persistent Objects (JPO) project site. This site is dedicated to Java developers attempting to find a simple solution to object persistence in a relational database (or object-relational mapping). Get the latest...
1.4 MB