Package buildbot :: Package monkeypatches :: Module sqlalchemy2364
[frames] | no frames]

Source Code for Module buildbot.monkeypatches.sqlalchemy2364

 1  # This file is part of Buildbot.  Buildbot is free software: you can 
 2  # redistribute it and/or modify it under the terms of the GNU General Public 
 3  # License as published by the Free Software Foundation, version 2. 
 4  # 
 5  # This program is distributed in the hope that it will be useful, but WITHOUT 
 6  # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
 7  # FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more 
 8  # details. 
 9  # 
10  # You should have received a copy of the GNU General Public License along with 
11  # this program; if not, write to the Free Software Foundation, Inc., 51 
12  # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 
13  # 
14  # Copyright Buildbot Team Members 
15   
16 -def patch():
17 # a fix for http://www.sqlalchemy.org/trac/ticket/2364 18 from sqlalchemy.dialects.sqlite.base import SQLiteDialect 19 old_get_foreign_keys = SQLiteDialect.get_foreign_keys 20 def get_foreign_keys_wrapper(*args, **kwargs): 21 fkeys = old_get_foreign_keys(*args, **kwargs) 22 # foreign keys don't have names 23 for fkey in fkeys: 24 fkey['name'] = None 25 return fkeys
26 SQLiteDialect.get_foreign_keys = get_foreign_keys_wrapper 27