schema.py
changeset 2613 5e19c2bb370e
parent 2531 531ea4e7013e
child 2616 4501ee760eec
equal deleted inserted replaced
2612:c3059d308dc2 2613:5e19c2bb370e
    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,
    73     if form:
    73     if form:
    74         key = key + '_' + form
    74         key = key + '_' + form
    75     # ensure unicode
    75     # ensure unicode
    76     # added .lower() in case no translation are available
    76     # added .lower() in case no translation are available
    77     return unicode(req._(key)).lower()
    77     return unicode(req._(key)).lower()
    78 __builtins__['display_name'] = obsolete('display_name should be imported from cubicweb.schema')(display_name)
    78 __builtins__['display_name'] = deprecated('display_name should be imported from cubicweb.schema')(display_name)
    79 
    79 
    80 def ERSchema_display_name(self, req, form=''):
    80 def ERSchema_display_name(self, req, form=''):
    81     """return a internationalized string for the entity/relation type name in
    81     """return a internationalized string for the entity/relation type name in
    82     a given form
    82     a given form
    83     """
    83     """