Commit 18c1f469 authored by Romain Bignon's avatar Romain Bignon

ability to override the flush() method

parent 7f035966
......@@ -654,7 +654,7 @@ class ListElement(AbstractElement):
def __init__(self, *args, **kwargs):
super(ListElement, self).__init__(*args, **kwargs)
self.logger = getLogger(self.__class__.__name__.lower())
self.objects = {}
self.objects = OrderedDict()
def __call__(self, *args, **kwargs):
for key, value in kwargs.iteritems():
......@@ -676,11 +676,15 @@ class ListElement(AbstractElement):
yield obj
if self.flush_at_end:
for obj in self.objects.itervalues():
for obj in self.flush():
yield obj
def flush(self):
for obj in self.objects.itervalues():
yield obj
def check_next_page(self):
if not hasattr(self, 'next_page'):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment