'Get count of Todo'

def get_todo_count(self, user_id=None):

    if (not user_id):
        user_id = frappe.session.user
    return frappe.db.sql(u"select    count(*)    from    `tabToDo`\n DCTB  DCTB  DCTB where    status='Open'    and    (owner=%s    or    assigned_by=%s)", (user_id, user_id))[0][0]
