Commit d0456177 authored by Nicolas Chauvat's avatar Nicolas Chauvat
Browse files

backport stable

if "PhoneNumber" in schema: if "PhoneNumber" in schema:
sql(''' sql('''
CREATE FUNCTION phonetype_sort_value(text) RETURNS int CREATE FUNCTION phonetype_sort_value(text) RETURNS int
...@@ -7,4 +5,4 @@ CREATE FUNCTION phonetype_sort_value(text) RETURNS int ...@@ -7,4 +5,4 @@ CREATE FUNCTION phonetype_sort_value(text) RETURNS int
LANGUAGE plpythonu; LANGUAGE plpythonu;
''') ''')
add_attribute('PostalAddress', 'latitude') add_attribute('PostalAddress', 'latitude')
add_attribute('PostalAddress', 'longitude') add_attribute('PostalAddress', 'longitude')
add_entity_type('IMAddress') add_entity_type('IMAddress')
...@@ -20,7 +20,7 @@ class PostalAddress(EntityType): ...@@ -20,7 +20,7 @@ class PostalAddress(EntityType):
longitude = Float() longitude = Float()
class IMAddress(EntityType): class IMAddress(EntityType):
im_account = String(fulltextindexed=True, required=True, maxsize=64) im_account = String(fulltextindexed=True, required=True, maxsize=64)
type = String(required=True, internationalizable=True, type = String(required=True, internationalizable=True,
vocabulary=('jabber', 'icq', 'msn'), vocabulary=('jabber', 'icq', 'msn'),
default=u'jabber') default=u'jabber')
...@@ -45,6 +45,6 @@ def install(**kwargs): ...@@ -45,6 +45,6 @@ def install(**kwargs):
url=web, url=web,
data_files=data_files, data_files=data_files,
**kwargs) **kwargs)
if __name__ == '__main__' : if __name__ == '__main__' :
install() install()
...@@ -2,13 +2,13 @@ from logilab.common.testlib import unittest_main ...@@ -2,13 +2,13 @@ from logilab.common.testlib import unittest_main
from cubicweb.devtools.testlib import AutomaticWebTest from cubicweb.devtools.testlib import AutomaticWebTest
class AddressbookAutomaticWebTest(AutomaticWebTest): class AddressbookAutomaticWebTest(AutomaticWebTest):
def to_test_etypes(self): def to_test_etypes(self):
return set(('PhoneNumber', 'PostalAddress')) return set(('PhoneNumber', 'PostalAddress'))
def list_startup_views(self): def list_startup_views(self):
return () return ()
del AutomaticWebTest del AutomaticWebTest
if __name__ == '__main__': if __name__ == '__main__':
......
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