schema.py
branchstable
changeset 2201 ddc1f58c8e8b
parent 2157 a4acf959d07e
child 2222 81130047390d
equal deleted inserted replaced
2200:25bb65dc4559 2201:ddc1f58c8e8b
    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.compat import any
    18 from logilab.common.compat import any
    18 
    19 
    19 from yams import BadSchemaDefinition, buildobjs as ybo
    20 from yams import BadSchemaDefinition, buildobjs as ybo
    20 from yams.schema import Schema, ERSchema, EntitySchema, RelationSchema
    21 from yams.schema import Schema, ERSchema, EntitySchema, RelationSchema
    21 from yams.constraints import BaseConstraint, StaticVocabularyConstraint
    22 from yams.constraints import BaseConstraint, StaticVocabularyConstraint
   118     if form:
   119     if form:
   119         key = key + '_' + form
   120         key = key + '_' + form
   120     # ensure unicode
   121     # ensure unicode
   121     # added .lower() in case no translation are available
   122     # added .lower() in case no translation are available
   122     return unicode(req._(key)).lower()
   123     return unicode(req._(key)).lower()
   123 __builtins__['display_name'] = display_name
   124 __builtins__['display_name'] = obsolete('display_name should be imported from cubicweb.schema')(display_name)
   124 
   125 
   125 def ERSchema_display_name(self, req, form=''):
   126 def ERSchema_display_name(self, req, form=''):
   126     """return a internationalized string for the entity/relation type name in
   127     """return a internationalized string for the entity/relation type name in
   127     a given form
   128     a given form
   128     """
   129     """