From 8bc1fb79ba78899a501f204e0062b0a44c750f49 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Tue, 16 Sep 2014 12:50:30 -0700 Subject: Use the six provided iterator mix-in Instead of having a customized next() and __next__() methods just use the mix-in that six provides and used it to avoid having to declare our own next() compatability function. Change-Id: I1a5fc9bd43783577af879476ca46afcc668185f5 --- oslo/db/sqlalchemy/models.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/oslo/db/sqlalchemy/models.py b/oslo/db/sqlalchemy/models.py index ae01bb3..818c1b4 100644 --- a/oslo/db/sqlalchemy/models.py +++ b/oslo/db/sqlalchemy/models.py @@ -97,7 +97,7 @@ class ModelBase(six.Iterator): return six.iteritems(local) -class ModelIterator(ModelBase): +class ModelIterator(ModelBase, six.Iterator): def __init__(self, model, columns): self.model = model @@ -111,9 +111,6 @@ class ModelIterator(ModelBase): n = six.advance_iterator(self.i) return n, getattr(self.model, n) - def next(self): - return self.__next__() - class TimestampMixin(object): created_at = Column(DateTime, default=lambda: timeutils.utcnow()) -- cgit v1.2.1