if args and args.get('application_id'):
        s = s.where(Application.id == args.get('application_id'))