e556554485
For the time being we used custom non-cached SQLAlchemy query. That means the following drawbacks: * each time we access to relationship attribute the SQL query is spawn; * each time we trying to get instance by pk (.get) the SQL query is spawn; Besides the way we get non-cached query is by patching internal SQLAlchemy's Query attribute - '_populate_existing' - which is designed for another purpose. It cause us a lot of troubles because the SQLAlchemy behaves in slightley different way that it's pointed in documentation (for instance, there're much more reasons for implicitly calling .flush()). This commit finally drops this unconvenient NoCacheQuery in favor of standard Query. Change-Id: Ic1b11684dddf970268eedd297e8577c86e750f1e Closes-Bug: #1498382
22 lines
835 B
Python
22 lines
835 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
# Copyright 2013 Mirantis, Inc.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
from nailgun.db.sqlalchemy import db
|
|
from nailgun.db.sqlalchemy import dropdb
|
|
from nailgun.db.sqlalchemy import engine
|
|
from nailgun.db.sqlalchemy import flush
|
|
from nailgun.db.sqlalchemy import syncdb
|