Remove OrderedDict implementation as RowProxy is returned

http://docs.sqlalchemy.org/en/rel_0_9/core/connections.html?highlight=rowproxy#sqlalchemy.engine.RowProxy
This commit is contained in:
Stefan Wehrmeyer 2014-01-25 21:22:11 +01:00
parent eff6925af9
commit 0726dd9cf3
2 changed files with 2 additions and 10 deletions

View File

@ -1,9 +1,5 @@
import logging import logging
from itertools import count from itertools import count
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict # Python < 2.7 drop-in
from sqlalchemy.sql import and_, expression from sqlalchemy.sql import and_, expression
from sqlalchemy.schema import Column, Index from sqlalchemy.schema import Column, Index
@ -288,7 +284,7 @@ class Table(object):
rp = self.database.executable.execute(query) rp = self.database.executable.execute(query)
data = rp.fetchone() data = rp.fetchone()
if data is not None: if data is not None:
return OrderedDict(zip(rp.keys(), data)) return data
def _args_to_order_by(self, order_by): def _args_to_order_by(self, order_by):
if order_by[0] == '-': if order_by[0] == '-':

View File

@ -1,9 +1,5 @@
from datetime import datetime, timedelta from datetime import datetime, timedelta
from inspect import isgenerator from inspect import isgenerator
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict # Python < 2.7 drop-in
from sqlalchemy import Integer, UnicodeText, Float, DateTime, Boolean, types, Table, event from sqlalchemy import Integer, UnicodeText, Float, DateTime, Boolean, types, Table, event
@ -50,7 +46,7 @@ class ResultIter(object):
else: else:
# stop here # stop here
raise StopIteration raise StopIteration
return OrderedDict(zip(self.keys, row)) return row
next = __next__ next = __next__