merge
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 29 Jun 2009 12:18:59 +0200
changeset 2185 09d0445641e2
parent 2183 9dfa88ac9f49 (diff)
parent 2184 d561b2725144 (current diff)
child 2186 dba8eed12a16
merge
schema.py
--- a/schema.py	Mon Jun 29 11:45:05 2009 +0200
+++ b/schema.py	Mon Jun 29 12:18:59 2009 +0200
@@ -19,8 +19,7 @@
 from yams import BadSchemaDefinition, buildobjs as ybo
 from yams.schema import Schema, ERSchema, EntitySchema, RelationSchema
 from yams.constraints import BaseConstraint, StaticVocabularyConstraint
-from yams.reader import (CONSTRAINTS, RelationFileReader, PyFileReader,
-                         SchemaLoader)
+from yams.reader import CONSTRAINTS, PyFileReader, SchemaLoader
 
 from rql import parse, nodes, RQLSyntaxError, TypeResolverException
 
@@ -857,23 +856,6 @@
 
 # schema loading ##############################################################
 
-class CubicWebRelationFileReader(RelationFileReader):
-    """cubicweb specific relation file reader, handling additional RQL
-    constraints on a relation definition
-    """
-
-    def handle_constraint(self, rdef, constraint_text):
-        """arbitrary constraint is an rql expression for cubicweb"""
-        if not rdef.constraints:
-            rdef.constraints = []
-        rdef.constraints.append(RQLVocabularyConstraint(constraint_text))
-
-    def process_properties(self, rdef, relation_def):
-        if 'inline' in relation_def:
-            rdef.inlined = True
-        RelationFileReader.process_properties(self, rdef, relation_def)
-
-
 CONSTRAINTS['RQLConstraint'] = RQLConstraint
 CONSTRAINTS['RQLUniqueConstraint'] = RQLUniqueConstraint
 CONSTRAINTS['RQLVocabularyConstraint'] = RQLVocabularyConstraint
@@ -885,8 +867,6 @@
     the persistent schema
     """
     schemacls = CubicWebSchema
-    SchemaLoader.file_handlers.update({'.rel' : CubicWebRelationFileReader,
-                                       })
 
     def load(self, config, path=(), **kwargs):
         """return a Schema instance from the schema definition read