[Mpuls-commits] r1412 - in wasko/branches/2.0: . waskaweb/controllers
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Tue Feb 9 16:58:44 CET 2010
Author: bh
Date: 2010-02-09 16:58:42 +0100 (Tue, 09 Feb 2010)
New Revision: 1412
Modified:
wasko/branches/2.0/ChangeLog
wasko/branches/2.0/waskaweb/controllers/repeatgroup.py
Log:
* waskaweb/controllers/repeatgroup.py: Fix formatting.
Modified: wasko/branches/2.0/ChangeLog
===================================================================
--- wasko/branches/2.0/ChangeLog 2010-02-09 15:51:36 UTC (rev 1411)
+++ wasko/branches/2.0/ChangeLog 2010-02-09 15:58:42 UTC (rev 1412)
@@ -1,5 +1,9 @@
2010-02-09 Bernhard Herzog <bh at intevation.de>
+ * waskaweb/controllers/repeatgroup.py: Fix formatting.
+
+2010-02-09 Bernhard Herzog <bh at intevation.de>
+
* waskaweb/controllers/annotations.py
(AnnotationsController.help): Make this work for ids that don't
refer to formed components such as 'wiederaufnahme' and
Modified: wasko/branches/2.0/waskaweb/controllers/repeatgroup.py
===================================================================
--- wasko/branches/2.0/waskaweb/controllers/repeatgroup.py 2010-02-09 15:51:36 UTC (rev 1411)
+++ wasko/branches/2.0/waskaweb/controllers/repeatgroup.py 2010-02-09 15:58:42 UTC (rev 1412)
@@ -1,42 +1,50 @@
import logging
import traceback
+
import formencode
-from pylons import request, response, session, c
-import mpulsweb.lib.helpers as h
-from pylons import g
+from pylons import request, response, session, c, g
from pylons.i18n import _
from pylons.controllers.util import abort, redirect_to
+from formed.instance.backends.postgres import DBFactory as InstanceFactory
+
+import mpulsweb.lib.helpers as h
+from mpulsweb.lib.db import PostgresDBInterface
+from mpulsweb.lib.navigation import get_navigation
+
from waskaweb.lib.base import BaseController, render
-from mpulsweb.lib.db import PostgresDBInterface
+from waskaweb.controllers.formularpage import FormularpageController
-from mpulsweb.lib.navigation import get_navigation
-from waskaweb.controllers.formularpage import FormularpageController
-from formed.instance.backends.postgres import DBFactory as InstanceFactory
log = logging.getLogger(__name__)
+
DELETE_RG_ENTRY_CONFIRM = u"""Datensatz löschen?"""
-DELETE_RG_ENTRY_CONFIRM_TEXT = u"""Wollen Sie wirklich diesen Datensatz löschen und die Daten unwiederbringlich verlieren?"""
+DELETE_RG_ENTRY_CONFIRM_TEXT = u"""\
+Wollen Sie wirklich diesen Datensatz löschen und die Daten
+unwiederbringlich verlieren?"""
+
class RepeatgroupController(BaseController):
def list(self, id):
- '''List rg-pages as overview page'''
+ """List rg-pages as overview page"""
pass
def select(self, id):
- '''Switch between rg in embedded rg'''
- # Currently this function is not needed as we do not support navigationable repeatgroups
- return FormularpageController().select(session.get('navigation.selectedpage'))
+ """Switch between rg in embedded rg"""
+ # Currently this function is not needed as we do not support
+ # navigationable repeatgroups
+ return FormularpageController().select(session.get('navigation'
+ '.selectedpage'))
def delete(self, id, confirmed='0'):
- '''Delete rg'''
+ """Delete rg"""
if confirmed == '1':
factory = InstanceFactory(g.formedTree, PostgresDBInterface())
instance_tree = factory.loadInstanceTreeByIdentifier(
- session['case'].id,
+ session['case'].id,
session.get('uncommited_fields'))
rg = instance_tree.getItem(id)
if not rg:
@@ -44,28 +52,30 @@
try:
rg.getParent().deleteInstance(rg)
except:
- c.status_msg = h.status_message(u"Fehler beim Löschen des Datensatzes.")
+ c.status_msg = h.status_message(u"Fehler beim Löschen"
+ u" des Datensatzes.")
# Build new Navigation
- navigation = get_navigation(
- session['case'].id,
- session['navigation.openfolders'])
+ navigation = get_navigation(session['case'].id,
+ session['navigation.openfolders'])
session['navigation.tree'] = navigation
session.save()
- c.status_msg = h.status_message(u"Datensatz wurde erfolgreich gelöscht.")
- return FormularpageController().select(session.get('navigation.selectedpage'))
+ c.status_msg = h.status_message(u"Datensatz wurde erfolgreich"
+ u" gelöscht.")
+ return FormularpageController().select(session.get('navigation'
+ '.selectedpage'))
else:
c.confirm_for = DELETE_RG_ENTRY_CONFIRM
- c.question = DELETE_RG_ENTRY_CONFIRM_TEXT
- c.url_yes = "/repeatgroup/delete/%s/1" % id
- c.url_no = "/formularpage/select/%s" % session['case'].getPageId()
+ c.question = DELETE_RG_ENTRY_CONFIRM_TEXT
+ c.url_yes = "/repeatgroup/delete/%s/1" % id
+ c.url_no = "/formularpage/select/%s" % session['case'].getPageId()
return render('/repeatgroup/dialogs/confirm_delete_rg_entry.mako')
def new(self, id):
- '''New rg'''
+ """New rg"""
factory = InstanceFactory(g.formedTree, PostgresDBInterface())
instance_tree = factory.loadInstanceTreeByIdentifier(
- session['case'].id,
+ session['case'].id,
session.get('uncommited_fields'))
rgcontainer = instance_tree.getItem(id)
if not rgcontainer:
@@ -73,9 +83,9 @@
rgcontainer.createInstance()
# Build new Navigation
- navigation = get_navigation(
- session['case'].id,
- session['navigation.openfolders'])
+ navigation = get_navigation(session['case'].id,
+ session['navigation.openfolders'])
session['navigation.tree'] = navigation
session.save()
- return FormularpageController().select(session.get('navigation.selectedpage'))
+ return FormularpageController().select(session.get('navigation'
+ '.selectedpage'))
More information about the Mpuls-commits
mailing list