Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
addressbook
Commits
c7112c1f2e8d
Commit
9efbc440
authored
Apr 05, 2011
by
Sylvain Thénault
Browse files
better latitude/longitude description, plus constraint to ensure consistency
--HG-- branch : stable
parent
3314c5f4d3e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
migration/1.6.2_Any.py
0 → 100644
View file @
c7112c1f
sync_schema_props_perms
(
'latitude'
)
sync_schema_props_perms
(
'longitude'
)
schema.py
View file @
c7112c1f
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment