from sqlalchemy.sql.expression import func as sqlfunc
from osgeo import ogr
import formencode
-from wrpylib import mwdb, wrmwdb, mwmarkup, wrmwmarkup
+from wrpylib import mwdb, wrmwdb, mwmarkup, wrmwmarkup, wrvalidators
class UpdateCacheError(RuntimeError):
start, end, sledrun = wrmwmarkup.rodelbahnbox_to_sledrun(sledrun_page.old_text)
sledrun.page_id = sledrun_page.page_id
sledrun.page_title = sledrun_page.page_title
+ sledrun.name_url = wrvalidators.sledrun_page_title_to_pretty_url(sledrun_page.page_title)
sledrun.under_construction = connection.execute(select([categorylinks], (categorylinks.c.cl_from==sledrun_page.page_id) & (categorylinks.c.cl_to == 'In_Arbeit')).alias('x').count()).fetchone()[0] > 0 # It would be better to do this in the query above
connection.execute(wrsledruncache.insert(sledrun.__dict__))
except (RuntimeError, formencode.Invalid) as e: