Commit 9efbc440 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

better latitude/longitude description, plus constraint to ensure consistency

branch : stable
parent 3314c5f4d3e7
from yams.buildobjs import EntityType, String, Float
from yams.constraints import IntervalBoundConstraint
_ = unicode
......@@ -13,11 +14,15 @@ class PostalAddress(EntityType):
street = String(fulltextindexed=True, required=True, maxsize=256)
street2 = String(fulltextindexed=True, maxsize=256)
postalcode = String(fulltextindexed=True, required=True, maxsize=256)
city = String(fulltextindexed=True, required=True, maxsize=256)
country = String(fulltextindexed=True, maxsize=256)
city = String(fulltextindexed=True, required=True, maxsize=256,
internationalizable=True) # see static-message.pot
country = String(fulltextindexed=True, maxsize=256,
internationalizable=True) # see static-message.pot
state = String(fulltextindexed=True, maxsize=256)
latitude = Float()
longitude = Float()
latitude = Float(required=True, constraints=[IntervalBoundConstraint(-90, 90)],
description=_('latitude in degree'))
longitude = Float(required=True, constraints=[IntervalBoundConstraint(-180, 180)],
description=_('longitude in degree'))
class IMAddress(EntityType):
im_account = String(fulltextindexed=True, required=True, maxsize=64)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment