Exemple #1
0
 def find_all_pending_approval(enterprise_id):
     return db.get_object_list(Listing,
                               """select l.*
                                 from pvs_listing l, core_status s, core_status_event e, crm_company c, crm_enterprise ent, core_asset a
                                 where l.status_id = s.status_id
                                 and a.fk_type = 'Listing'
                                 and a.fk_id = l.listing_id
                                 and s.event_id = e.event_id
                                 and l.company_id = c.company_id
                                 and c.enterprise_id = ent.enterprise_id
                                 and l.delete_dt is null
                                 and e.short_name not in ('CLOSED', 'OPEN', 'APPROVED', 'DECLINED')
                                 and ent.enterprise_id = '%s' order by l.create_dt""" % enterprise_id)