Commit ec20f15f authored by Stephanie Marcu's avatar Stephanie Marcu
Browse files

remove cw 3.9 deprecation warnings

parent d76c10609d7e
......@@ -13,7 +13,7 @@ author = "Logilab"
author_email = "contact@logilab.fr"
web = 'http://www.cubicweb.org/project/%s' % distname
__depends__ = {'cubicweb': '>= 3.8.0'}
__depends__ = {'cubicweb': '>= 3.9.0'}
classifiers = [
'Environment :: Web Environment',
......
......@@ -9,7 +9,7 @@ Homepage: http://www.cubicweb.org/project/cubicweb-addressbook
Package: cubicweb-addressbook
Architecture: all
Depends: cubicweb-common (>= 3.8.0)
Depends: cubicweb-common (>= 3.9.0)
Description: contact information component for the CubicWeb framework
This CubicWeb component store contact information such as postal
addresses, phone numbers, instant messager address.
......
......@@ -6,8 +6,9 @@
"""
__docformat__ = "restructuredtext en"
from cubicweb.interfaces import IGeocodable
from cubicweb.entities import AnyEntity, fetch_config
from cubicweb.selectors import is_instance
from cubicweb.web.views.igeocodable import IGeocodableAdapter
class PhoneNumber(AnyEntity):
__regid__ = 'PhoneNumber'
......@@ -27,8 +28,6 @@ class PostalAddress(AnyEntity):
__regid__ = 'PostalAddress'
fetch_attrs, fetch_order = fetch_config(['street', 'street2', 'postalcode',
'city', 'country'])
__implements__ = AnyEntity.__implements__ + (IGeocodable,)
def dc_long_title(self):
lines = []
if self.street:
......@@ -42,3 +41,6 @@ class PostalAddress(AnyEntity):
if self.country:
lines.append(self.country)
return u' '.join(lines)
class PostalAddressIGeocodableAdapter(IGeocodableAdapter):
__select__ = is_instance('PostalAddress')
......@@ -10,12 +10,12 @@ __docformat__ = 'restructuredtext en'
from cubes.addressbook import geocoding
from cubicweb.selectors import implements
from cubicweb.selectors import is_instance
from cubicweb.server.hook import Hook
class AutoSetLatLng(Hook):
__regid__ = 'auto_lat_lng_hook'
__select__ = implements('PostalAddress')
__select__ = is_instance('PostalAddress')
events = ('before_add_entity', 'before_update_entity')
def __call__(self):
......
......@@ -4,6 +4,6 @@ options = (
{'type' : 'string',
'default': '',
'help': 'the google map key used to display postal address on google map',
'group': 'gmap', 'inputlevel': 0,
'group': 'gmap', 'level': 0,
}),
)
......@@ -9,7 +9,7 @@ __docformat__ = "restructuredtext en"
from logilab.mtconverter import xml_escape
from cubicweb.view import EntityView
from cubicweb.selectors import implements
from cubicweb.selectors import is_instance
from cubicweb.web import uicfg
from cubicweb.web.views import baseviews
......@@ -20,13 +20,13 @@ uicfg.autoform_section.tag_attribute(('PostalAddress', 'latitude'), 'main', 'hid
uicfg.autoform_section.tag_attribute(('PostalAddress', 'longitude'), 'main', 'hidden')
class PhoneNumberInContextView(baseviews.InContextView):
__select__ = implements('PhoneNumber')
__select__ = is_instance('PhoneNumber')
def cell_call(self, row, col=0):
self.w(xml_escape(self.cw_rset.get_entity(row, col).dc_title()))
class PhoneNumberListItemView(baseviews.ListItemView):
__select__ = implements('PhoneNumber')
__select__ = is_instance('PhoneNumber')
def cell_call(self, row, col=0, vid=None):
entity = self.cw_rset.get_entity(row, col)
......@@ -36,7 +36,7 @@ class PhoneNumberListItemView(baseviews.ListItemView):
class PhoneNumberSipView(EntityView):
__regid__ = u'sip'
__select__ = implements('PhoneNumber')
__select__ = is_instance('PhoneNumber')
def cell_call(self, row, col, contexteid=None):
entity = self.cw_rset.get_entity(row, col)
......@@ -47,7 +47,7 @@ class PhoneNumberSipView(EntityView):
class PostalAddressInContextView(baseviews.InContextView):
__select__ = implements('PostalAddress')
__select__ = is_instance('PostalAddress')
def cell_call(self, row, col, contexteid=None):
entity = self.cw_rset.get_entity(row, col)
......
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