Jaymon / prom

A PostgreSQL or SQLite orm for Python
MIT License
22 stars 4 forks source link

Iterator.ifilter gets set to None in __init__ #113

Closed Jaymon closed 3 years ago

Jaymon commented 4 years ago

This means you can't override Iterator.ifilter like this:

class FooIterator(Iterator):
    def ifilter(self, o):
        return True

because ifilter gets set to None when the instance is created, the __init__ method needs to do this:

if ifilter:
    self.ifilter = ifilter

Or just remove:

self.ifilter = None

And modify the _filtered method to try/catch and AttributeError