# HG changeset patch # User Sylvain Thénault # Date 1467276423 -7200 # Node ID e6acdea9616c86a77b8571981aa50b078d7e3f89 # Parent 8ed625765a5cab49a03f18172f5aad675241b88a [schema2sql] inline eschema_attrs method * not a public API * doesn't makes things easier to grasp -> useless Related to #14050899 diff -r 8ed625765a5c -r e6acdea9616c cubicweb/server/schema2sql.py --- 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]