schema.py
brancholdstable
changeset 8123 a4e667270dd4
parent 7879 9aae456abab5
child 7894 ad0eeb0f7a8d
--- a/schema.py	Mon Sep 26 18:37:23 2011 +0200
+++ b/schema.py	Fri Dec 09 12:08:27 2011 +0100
@@ -544,10 +544,11 @@
         rschema = self.add_relation_type(ybo.RelationType('identity'))
         rschema.final = False
 
+    etype_name_re = r'[A-Z][A-Za-z0-9]*[a-z]+[A-Za-z0-9]*$'
     def add_entity_type(self, edef):
         edef.name = edef.name.encode()
         edef.name = bw_normalize_etype(edef.name)
-        if not re.match(r'[A-Z][A-Za-z0-9]*[a-z]+[0-9]*$', edef.name):
+        if not re.match(self.etype_name_re, edef.name):
             raise BadSchemaDefinition(
                 '%r is not a valid name for an entity type. It should start '
                 'with an upper cased letter and be followed by at least a '
@@ -665,6 +666,8 @@
     # these are overridden by set_log_methods below
     # only defining here to prevent pylint from complaining
     info = warning = error = critical = exception = debug = lambda msg,*a,**kw: None
+    # to be defined in concrete classes
+    full_rql = None
 
     def __init__(self, expression, mainvars, eid):
         self.eid = eid # eid of the entity representing this rql expression