Next / Previous / Contents / NM Tech homepage

8.6. MyCBC.genCirs(): Generate all circles

The technique used in this and the remaining methods are all pretty basic use of the SQLAlchemy Query class.

mycbc.py
# - - -   M y C B C . g e n C i r s

    def genCirs(self):
        '''Generate all circles, ascending by lat-lon.
        '''
        #-- 1 --
        # [ q  :=  a Session.Query to retrieve all rows of self.Cir ]
        q = self.s.query(self.Cir)

        #-- 2 --
        # [ generate the rows in q ]
        for row in q:
            yield row