[schema2sql] inline eschema_attrs method
* not a public API
* doesn't makes things easier to grasp
-> useless
Related to #14050899
--- a/cubicweb/server/schema2sql.py Thu Jun 30 13:25:43 2016 +0200
+++ b/cubicweb/server/schema2sql.py Thu Jun 30 10:47:03 2016 +0200
@@ -101,15 +101,6 @@
return '\n'.join(output)
-def eschema_attrs(eschema, skip_relations):
- attrs = [attrdef for attrdef in eschema.attribute_definitions()
- if not attrdef[0].type in skip_relations]
- attrs += [(rschema, None)
- for rschema in eschema.subject_relations()
- if not rschema.final and rschema.inlined]
- return attrs
-
-
def unique_index_name(eschema, columns):
# keep giving eschema instead of table name for bw compat
table = text_type(eschema)
@@ -144,7 +135,11 @@
w = output.append
table = prefix + eschema.type
w('CREATE TABLE %s(' % (table))
- attrs = eschema_attrs(eschema, skip_relations)
+ attrs = [attrdef for attrdef in eschema.attribute_definitions()
+ if not attrdef[0].type in skip_relations]
+ attrs += [(rschema, None)
+ for rschema in eschema.subject_relations()
+ if not rschema.final and rschema.inlined]
# XXX handle objectinline physical mode
for i in range(len(attrs)):
rschema, attrschema = attrs[i]