src/pyams_catalog/query.py
changeset 15 551c55958cf3
parent 13 2b20d7a5e7ee
child 21 464671eede98
equal deleted inserted replaced
14:959fc0b26546 15:551c55958cf3
    29     def __init__(self, query):
    29     def __init__(self, query):
    30         self.query = query
    30         self.query = query
    31         self.intids = query_utility(IIntIds)
    31         self.intids = query_utility(IIntIds)
    32 
    32 
    33     def __iter__(self):
    33     def __iter__(self):
    34         query = self.query
       
    35         intids = self.intids
    34         intids = self.intids
    36         if intids is None:
    35         if intids is None:
    37             raise StopIteration
    36             raise StopIteration
       
    37         query = self.query
    38         if isinstance(query, Query):
    38         if isinstance(query, Query):
    39             query = query.execute()
    39             query = query.execute()
    40         if isinstance(query, tuple):
    40         if isinstance(query, tuple):
    41             query = query[1]
    41             query = query[1]
    42         for oid in query:
    42         for oid in query: