'get list of documents that will be triggered today'

def get_documents_for_today(self):

    docs = []
    diff_days = self.days_in_advance
    if (self.event == u'Days    After'):
        diff_days = (- diff_days)
    for name in frappe.db.sql_list(u'select    name    from    `tab{0}`    where\n DCTB  DCTB  DCTB DATE(`{1}`)    =    ADDDATE(DATE(%s),    INTERVAL    %s    DAY)'.format(self.document_type, self.date_changed), (nowdate(), (diff_days or 0))):
        doc = frappe.get_doc(self.document_type, name)
        if (self.condition and (not frappe.safe_eval(self.condition, None, get_context(doc)))):
            continue
        docs.append(doc)
    return docs
