def GetQuery(self, order=None):
    q = ereporter.ExceptionRecord.all()
    q.filter('date =', self.yesterday)
    q.filter('major_version =', self.major_version)
    if self.version_filter.lower() == 'latest':
      q.filter('minor_version =', self.minor_version)
    if order:
      q.order(order)
    return q
Creates a query object that will retrieve the appropriate exceptions.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/ext/ereporter/report_generator.py/ReportGenerator.GetQuery