deprecate display_name from builtin, ask for explicit import stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 30 Jun 2009 08:05:18 +0200
branchstable
changeset 2201 ddc1f58c8e8b
parent 2200 25bb65dc4559
child 2202 cb374512949f
deprecate display_name from builtin, ask for explicit import
schema.py
--- a/schema.py	Mon Jun 29 21:15:07 2009 +0200
+++ b/schema.py	Tue Jun 30 08:05:18 2009 +0200
@@ -14,6 +14,7 @@
 from warnings import warn
 
 from logilab.common.decorators import cached, clear_cache, monkeypatch
+from logilab.common.deprecation import obsolete
 from logilab.common.compat import any
 
 from yams import BadSchemaDefinition, buildobjs as ybo
@@ -120,7 +121,7 @@
     # ensure unicode
     # added .lower() in case no translation are available
     return unicode(req._(key)).lower()
-__builtins__['display_name'] = display_name
+__builtins__['display_name'] = obsolete('display_name should be imported from cubicweb.schema')(display_name)
 
 def ERSchema_display_name(self, req, form=''):
     """return a internationalized string for the entity/relation type name in