def METHOD_NAME(self, project_name=None):
    session = SessionController()
    query = db.session.query(
        db.Tasks.object_id,
        db.Triggers.project_id,
        db.Triggers.name,
        db.Triggers.database_id,
        db.Triggers.table_name,
        db.Triggers.query_str,
        db.Tasks.last_error,
    )\
        .join(db.Triggers, db.Triggers.id == db.Tasks.object_id)\
        .filter(
            db.Tasks.object_type == self.OBJECT_TYPE,
            db.Tasks.company_id == ctx.company_id,
    )
    project_controller = ProjectController()
    if project_name is not None:
        project = project_controller.get(name=project_name)
        query = query.filter(db.Triggers.project_id == project.id)
    database_names = {
        i['id']: i['name']
        for i in session.database_controller.METHOD_NAME()
    }
    project_names = {
        i.id: i.name
        for i in project_controller.METHOD_NAME()
    }
    data = []
    for record in query:
        data.append({
            'id': record.object_id,
            'project': project_names[record.project_id],
            'name': record.name.lower(),
            'database': database_names.get(record.database_id, '?'),
            'table': record.table_name,
            'query': record.query_str,
            'last_error': record.last_error,
        })
    return data