本文整理汇总了Python中walis.utils.http.args_parser.parse函数的典型用法代码示例。如果您正苦于以下问题:Python parse函数的具体用法?Python parse怎么用?Python parse使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了parse函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: get_activities
def get_activities(cls):
args_spec = {
'city_ids': Arg(int, multiple=True, allow_missing=True),
}
city_ids = args_parser.parse(args_spec).get('city_ids', [])
if not city_ids:
city_ids = cls.get_user_city_ids()
today = get_today_date_str()
rest_activities = rst_act_base.query(
begin_date=today, end_date=today, city_ids=city_ids, is_valid=True)
food_activities = food_act_base.query(
begin_date=today, end_date=today, city_ids=city_ids, is_valid=True)
rest_act_result = []
for act in rest_activities:
rest_act_result.append({
'activity_id': act.id,
'activity_name': RestaurantActivityMixin.get_name(act)
})
food_act_result = []
for act in food_activities:
food_act_result.append({
'activity_id': act.id,
'activity_name': act.name
})
return {
'food_activities': food_act_result,
'rest_activities': rest_act_result
}
开发者ID:liuzelei,项目名称:walis,代码行数:32,代码来源:banner.py
示例2: query_receive_by_mobile
def query_receive_by_mobile():
args_spec = {
'mobile':Arg(int)
}
args = args_parser.parse(args_spec)
result = sms_base.query_receive_by_mobile(args['mobile'])
return result
开发者ID:liuzelei,项目名称:walis,代码行数:7,代码来源:sms.py
示例3: is_username_available
def is_username_available():
args = {
'username':Arg(),
}
args_spec = args_parser.parse(args)
available = user_base.is_username_available(args_spec['username'])
return {'available':available}
开发者ID:liuzelei,项目名称:walis,代码行数:7,代码来源:user.py
示例4: get_user_by_mobile
def get_user_by_mobile():
args = {
'mobile':Arg(),
}
arg_spec = args_parser.parse(args)
user = user_base.get_by_mobile(arg_spec['mobile'])
return user or {}
开发者ID:liuzelei,项目名称:walis,代码行数:7,代码来源:user.py
示例5: olpay_income_details
def olpay_income_details(restaurant_id, date):
args = args_parser.parse({
'status': Arg(int, required=False),
})
records, total_num = restaurant_manager.get_olpay_detail(
restaurant_id, date=date, **args)
return {'records': records, 'total_num': total_num}
开发者ID:liuzelei,项目名称:walis,代码行数:7,代码来源:restaurant.py
示例6: set_order_valid
def set_order_valid():
args_spec = {
'order_id': Arg(int),
}
args = args_parser.parse(args_spec)
order_id = args['order_id']
return order_base.set_valid(order_id)
开发者ID:liuzelei,项目名称:walis,代码行数:7,代码来源:audit.py
示例7: set_order_phone_confirmed
def set_order_phone_confirmed():
args_spec = {
'order_id': Arg(int),
'confirmed': Arg(bool),
}
args = args_parser.parse(args_spec)
return order_base.set_phone_confirmed(**args)
开发者ID:liuzelei,项目名称:walis,代码行数:7,代码来源:audit.py
示例8: finish_suspicious_group_auditing
def finish_suspicious_group_auditing():
args_spec = {
'restaurant_id': Arg(int),
'date': Arg(unicode, ),
}
args = args_parser.parse(args_spec)
return order_audit_base.finish_suspicious_group_auditing(**args)
开发者ID:liuzelei,项目名称:walis,代码行数:7,代码来源:audit.py
示例9: filter_suspicious_orders_amount
def filter_suspicious_orders_amount():
args_spec = {
'auditor_id': Arg(int),
'status': Arg(int),
'date': Arg(unicode),
}
args = args_parser.parse(args_spec)
return order_audit_base.filter_suspicious_orders_amount(**args)
开发者ID:liuzelei,项目名称:walis,代码行数:8,代码来源:audit.py
示例10: get_alipay_url
def get_alipay_url():
args_spec = {'batch_id': Arg(int), }
batch_id = args_parser.parse(args_spec)['batch_id']
url_info = get_alipay_html(batch_id)
return {
'url': url_info.url,
'form_data': url_info.form_data
}
开发者ID:liuzelei,项目名称:walis,代码行数:8,代码来源:payment.py
示例11: query_by_area
def query_by_area():
arg_spec = {"city_id": Arg(int), "_area": Arg(list)}
args = args_parser.parse(arg_spec)
points = []
for point_dic in args.get("_area", []):
points.append("{lng},{lat}".format(**point_dic))
return transaction_svc.get_order_trs_by_area(args["city_id"], points)
开发者ID:liuzelei,项目名称:walis,代码行数:8,代码来源:transaction.py
示例12: get_event
def get_event(event_id):
args = args_parser.parse({
'with_name': Arg(bool, allow_missing=True),
'with_records': Arg(bool, allow_missing=True),
})
event = event_service.get_event(event_id, **args)
_format_event(event)
return event
开发者ID:liuzelei,项目名称:walis,代码行数:8,代码来源:event.py
示例13: delete
def delete():
args = args_parser.parse_all()
isprivate=args.get('isprivate',False)
file_hash = args_parser.parse(
{'file_hash': Arg(str), }).get('file_hash')
delete_file(file_hash,isprivate=isprivate)
return ''
开发者ID:liuzelei,项目名称:walis,代码行数:8,代码来源:file.py
示例14: gets
def gets():
arg_spec = {
'city_id': Arg(int, allow_missing=True)
}
args = args_parser.parse(arg_spec)
offset, limit = get_paging_params(db_style=True)
return trs_query_cfg_service.gets(city_id=args.get('city_id'), offset=offset, limit=limit)
开发者ID:liuzelei,项目名称:walis,代码行数:8,代码来源:trs_query_config.py
示例15: query
def query():
args_spec = {
'query':Arg(unicode,default='{}'),
'struct':Arg(unicode,default='{}'),
}
args = args_parser.parse(args_spec)
result = order_query_helper.ess_search2(**args)
return result
开发者ID:liuzelei,项目名称:walis,代码行数:8,代码来源:order_query.py
示例16: put
def put(city_id):
arg_spec = {
'date_from': Arg(str, required=True),
'date_end': Arg(str, required=True),
}
args = args_parser.parse(arg_spec)
return trs_query_cfg_service.add_or_update(city_id,
strptime_to_date(args['date_from']),
strptime_to_date(args['date_end']))
开发者ID:liuzelei,项目名称:walis,代码行数:9,代码来源:trs_query_config.py
示例17: balance_change
def balance_change(restaurant_id):
args = args_parser.parse({
'trade_type': Arg(int, required=False),
'begin_date': Arg(str, required=False),
'end_date': Arg(str, required=False),
})
records, total_num = restaurant_manager.get_balance_change(
restaurant_id, **args)
return {'records': records, 'total_num': total_num}
开发者ID:liuzelei,项目名称:walis,代码行数:9,代码来源:restaurant.py
示例18: set_is_valid
def set_is_valid():
args_spec = {"zone_id": Arg(int), "zone_ids": Arg(default=[]), "is_valid": Arg(bool)}
args = args_parser.parse(args_spec)
zone_id = args["zone_id"]
zone_ids = args["zone_ids"]
if zone_id:
zone_ids.append(zone_id)
zone_base.set_is_valid(zone_ids, args["is_valid"])
return ""
开发者ID:liuzelei,项目名称:walis,代码行数:9,代码来源:zone.py
示例19: put
def put():
args = args_parser.parse({
'restaurant_ids': Arg([], allow_missing=False),
'notice_enabled': Arg(int, allow_missing=True),
'in_charge': Arg(int, allow_missing=True),
})
args['restaurant_ids'] = [int(r) for r in args['restaurant_ids']]
set_notification(**args)
return ''
开发者ID:liuzelei,项目名称:walis,代码行数:9,代码来源:modify_info_notice.py
示例20: olpay_income_records
def olpay_income_records(restaurant_id):
args = args_parser.parse({
'type': Arg(int, required=False),
'begin_date': Arg(str, required=False),
'end_date': Arg(str, required=False),
})
records = restaurant_manager.get_olpay_records(
restaurant_id, **args)
return {'records': records}
开发者ID:liuzelei,项目名称:walis,代码行数:9,代码来源:restaurant.py
注:本文中的walis.utils.http.args_parser.parse函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论