From 12946a02d54c62a9797a60f57925da6a3e15fd31 Mon Sep 17 00:00:00 2001 From: philipp Date: Mon, 17 Mar 2014 20:15:48 +0000 Subject: [PATCH] Added GasthausboxDictValidator. git-svn-id: http://www.winterrodeln.org/svn/wrpylib/trunk@1934 7aebc617-e5e2-0310-91dc-80fb5f6d2477 --- wrpylib/wrvalidators.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/wrpylib/wrvalidators.py b/wrpylib/wrvalidators.py index df749f8..fc432d1 100644 --- a/wrpylib/wrvalidators.py +++ b/wrpylib/wrvalidators.py @@ -824,3 +824,21 @@ class RodelbahnboxDictValidator(OrderedSchema): self.add_field(u'Bild', UnicodeNone()) self.add_field(u'In Übersichtskarte', GermanBoolNone()) self.add_field(u'Forumid', UnsignedNeinNone()) + + +class GasthausboxDictValidator(OrderedSchema): + """Takes the fields of the Gasthausbox as dict of strings and returns them as dict of appropriet types.""" + def __init__(self): + self.add_field(u'Position', GeoNone()) # '47.583333 N 15.75 E' + self.add_field(u'Höhe', UnsignedNone()) + self.add_field(u'Betreiber', UnicodeNone()) + self.add_field(u'Sitzplätze', UnsignedNone()) + self.add_field(u'Übernachtung', BoolUnicodeTupleValidator()) + self.add_field(u'Rauchfrei', GermanTristateTuple()) + self.add_field(u'Rodelverleih', BoolUnicodeTupleValidator()) + self.add_field(u'Handyempfang', ValueCommentListNeinLoopNone()) + self.add_field(u'Homepage', UrlNeinNone()) + self.add_field(u'E-Mail', EmailCommentListNeinLoopNone(allow_masked_email=True)) + self.add_field(u'Telefon', PhoneCommentListNeinLoopNone(comments_are_optional=True)) + self.add_field(u'Bild', UnicodeNone()) + self.add_field(u'Rodelbahnen', WikiPageListLoopNone()) -- 2.30.2