Speicherplatz für Auslieferungzeit
die Lösung ist das doppelte Seichern!
http://code.djangoproject.com/wiki/UsingMarkup
CookBook - Using Markup Filters in Models ¶
The markup application (django.contrib.markup) is pretty handy for using filters like Textile or Markdown in your templates, but has a slight downside: every time a page is generated, you have to run the markup filter over the text, which may or may not be an acceptable performance hit. You could, if you wanted, just define a save() hook which applies the filter to incoming text so it gets saved to your DB as HTML, but then you're in a pickle if you want to edit it again later. What to do, then?
One solution is found in the Textpattern CMS, which incorporates Textile. Textpattern accepts input in Textile syntax, and then saves two copies: one is the raw input, which is stored for later use when an item is being edited, and the other is the XHTML Textile produces for that input, which is used for actual page display. The idea here is that database columns are cheap, but processing time might not be. And this is easy to do in Django; for example, let's say you have a weblog where you'd like to use Markdown on the entries. You might define your Entry model like so:
---
soweit die Theorie
aber wo ist mein Fehler?
http://lethain.com/entry/2008/jan/09/dont-repeat-yourself-bloggers-dynamic-blog-context/
Integration mit Bordmitteln
http://www.freewisdom.org/projects/python-markdown/Django
http://lethain.com/entry/2008/jul/07/release-of-lifeflow-0-91/ /: Rageev Sebastian contributed an excellent patch to the code syntax highlighter, so that it now works properly at non-base levels of indention. This means that code syntax highlighting can now play nicely within lists (like the example just below), as well as any other tomfoolery you might attempt.
http://github.com/lethain/lifeflow/tree/d89b3ee8addb7642c0df2eb8ab832e84e54725d0/text_filters.py
lifeflow / text_filters.py
- """
This file contains filters which are used for pre and post processing various kinds of text within LifeFlow.
Which values are applied is controlled by a number of global variables within the project's settings.py file. These vars are:
LIFEFLOW_ENTRY_FILTERS LIFEFLOW_COMMENT_FILTERS
If you wish to add your own filters, you don't have to add them to this file, they can exist anywhere, and simply import them into the settings.py file and add them to the appropriate global variable.
The API for these processing functions is very simple: they accept two parameters, a string to process, and optionally a related model. """
from django.conf import settings from lifeflow.markdown.markdown import Markdown from lifeflow.markdown import mdx_lifeflow from lifeflow.markdown import mdx_code from lifeflow.markdown import mdx_footnotes from lifeflow.markdown import mdx_foreign_formats
LOCALS = locals() DEFAULT_COMMENT_FILTERS = (comment_markdown,) DEFAULT_ENTRY_FILTERS = (entry_markdown,)
http://lifeflow.lighthouseapp.com/projects/12083-lifeflow/overview
-- DetlevLengsfeld 2008-12-03 16:22:38
Python/Django/markdown und lifeflow verbinden (last edited 2008-12-03 16:52:03 by )