[Mpuls-commits] r4600 - in base/trunk: . mpulsweb/controllers
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Feb 9 19:08:28 CET 2011
Author: bh
Date: 2011-02-09 19:08:26 +0100 (Wed, 09 Feb 2011)
New Revision: 4600
Modified:
base/trunk/ChangeLog
base/trunk/mpulsweb/controllers/formularpage.py
Log:
* mpulsweb/controllers/formularpage.py
(prepare_htmlfill_defaults): Removed. No longer used.
Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog 2011-02-09 18:05:08 UTC (rev 4599)
+++ base/trunk/ChangeLog 2011-02-09 18:08:26 UTC (rev 4600)
@@ -1,5 +1,10 @@
2011-02-09 Bernhard Herzog <bh at intevation.de>
+ * mpulsweb/controllers/formularpage.py
+ (prepare_htmlfill_defaults): Removed. No longer used.
+
+2011-02-09 Bernhard Herzog <bh at intevation.de>
+
Switch to libformed's renderer. Requires libformed > 343:4d20baece0e5
* mpulsweb/lib/formedrenderer.py: New. Customizations of the
Modified: base/trunk/mpulsweb/controllers/formularpage.py
===================================================================
--- base/trunk/mpulsweb/controllers/formularpage.py 2011-02-09 18:05:08 UTC (rev 4599)
+++ base/trunk/mpulsweb/controllers/formularpage.py 2011-02-09 18:08:26 UTC (rev 4600)
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
import logging
-import datetime
from pylons import request, c, g, h
from pylons.controllers.util import abort, redirect_to
@@ -18,7 +17,7 @@
from mpulsweb.lib.navigation import mark_folderopen
from mpulsweb.lib.base import BaseController, render, session
-from mpulsweb.lib.helpers import url_for, dd_mm_YYYY as format_date
+from mpulsweb.lib.helpers import url_for
from mpulsweb.model.phase import PhaseFactory, PC_MANUAL, PC_FULLAUTO
from mpulsweb.lib.formedrenderer import ViewRenderer, UrlFactory
@@ -46,26 +45,7 @@
result[i] = params[i]
return result
-def prepare_htmlfill_defaults(defaults):
- """Prepare default values for htmlfill.
- The defaults parameter should be a dictionary mapping field names to
- values. The return value is a new dictionary containing the
- converted defaults.
-
- String values are passed through unchanged. Date objects (instances
- of datetime.date) are converted using the format_date function.
- Other types are also passed through unchanged and it is assumed that
- the default conversion to strings that htmlfill performs does the
- right thing for these values.
- """
- converted = {}
- for key, value in defaults.iteritems():
- if isinstance(value, datetime.date):
- value = format_date(value)
- converted[key] = value
- return converted
-
def get_rendered_page(id):
factory = InstanceFactory(g.formedTree, PostgresDBInterface())
instance_tree = factory.loadInstanceTreeByIdentifier(
More information about the Mpuls-commits
mailing list