equal
deleted
inserted
replaced
12 from os.path import join |
12 from os.path import join |
13 from logging import getLogger |
13 from logging import getLogger |
14 from warnings import warn |
14 from warnings import warn |
15 |
15 |
16 from logilab.common.decorators import cached, clear_cache, monkeypatch |
16 from logilab.common.decorators import cached, clear_cache, monkeypatch |
17 from logilab.common.deprecation import obsolete |
17 from logilab.common.deprecation import deprecated |
18 from logilab.common.compat import any |
18 from logilab.common.compat import any |
19 |
19 |
20 from yams import BadSchemaDefinition, buildobjs as ybo |
20 from yams import BadSchemaDefinition, buildobjs as ybo |
21 from yams.schema import Schema, ERSchema, EntitySchema, RelationSchema |
21 from yams.schema import Schema, ERSchema, EntitySchema, RelationSchema |
22 from yams.constraints import (BaseConstraint, StaticVocabularyConstraint, |
22 from yams.constraints import (BaseConstraint, StaticVocabularyConstraint, |
76 if form: |
76 if form: |
77 key = key + '_' + form |
77 key = key + '_' + form |
78 # ensure unicode |
78 # ensure unicode |
79 # added .lower() in case no translation are available |
79 # added .lower() in case no translation are available |
80 return unicode(req._(key)).lower() |
80 return unicode(req._(key)).lower() |
81 __builtins__['display_name'] = obsolete('display_name should be imported from cubicweb.schema')(display_name) |
81 __builtins__['display_name'] = deprecated('display_name should be imported from cubicweb.schema')(display_name) |
82 |
82 |
83 def ERSchema_display_name(self, req, form=''): |
83 def ERSchema_display_name(self, req, form=''): |
84 """return a internationalized string for the entity/relation type name in |
84 """return a internationalized string for the entity/relation type name in |
85 a given form |
85 a given form |
86 """ |
86 """ |