From: philipp Date: Mon, 17 Mar 2014 20:15:48 +0000 (+0000) Subject: Added GasthausboxDictValidator. X-Git-Url: https://git.toastfreeware.priv.at/philipp/winterrodeln/wrpylib.git/commitdiff_plain/12946a02d54c62a9797a60f57925da6a3e15fd31?ds=sidebyside Added GasthausboxDictValidator. git-svn-id: http://www.winterrodeln.org/svn/wrpylib/trunk@1934 7aebc617-e5e2-0310-91dc-80fb5f6d2477 --- 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())