@with_session
def upgrade_required(session=None):
 old_schemas = session.query(PluginSchema).all()
 if (len(old_schemas) < len(plugin_schemas)):
  return True
 for old_schema in old_schemas:
  if ((old_schema.plugin in plugin_schemas) and (old_schema.version < plugin_schemas[old_schema.plugin][u'version'])):
   return True
 return False

@ with_session def upgrade_required ( session = None ) : old_schemas = session . query ( PluginSchema ) . all ( ) if ( len ( old_schemas ) < len ( plugin_schemas ) ) : return True for old_schema in old_schemas : if ( ( old_schema . plugin in plugin_schemas ) and ( old_schema . version < plugin_schemas [ old_schema . plugin ] [ u'version' ] ) ) : return True return False
returns true if an upgrade of the database is required .