当前位置: 首页>>代码示例>>Python>>正文


Python Event.city方法代码示例

本文整理汇总了Python中models.event.Event.city方法的典型用法代码示例。如果您正苦于以下问题:Python Event.city方法的具体用法?Python Event.city怎么用?Python Event.city使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models.event.Event的用法示例。


在下文中一共展示了Event.city方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: store_event

# 需要导入模块: from models.event import Event [as 别名]
# 或者: from models.event.Event import city [as 别名]
def store_event(data):
    event = Event(id=data['key'])
    event.name = data['name']
    event.short_name = data['short_name']
    event.event_short = data['event_code']
    event.event_type_enum = data['event_type']
    event.year = data['year']
    event.timezone_id = data['timezone']
    event.website = data['website']
    event.start_date = datetime.datetime.strptime(data['start_date'], EVENT_DATE_FORMAT_STR) if data['start_date'] else None
    event.end_date = datetime.datetime.strptime(data['end_date'], EVENT_DATE_FORMAT_STR) if data['end_date'] else None
    event.webcast_json = json.dumps(data['webcasts'])
    event.venue = data['location_name']
    event.city = data['city']
    event.state_prov = data['state_prov']
    event.country = data['country']

    district = store_district(data['district']) if data['district'] else None
    event.district_key = district.key if district else None

    return EventManipulator.createOrUpdate(event)
开发者ID:nwalters512,项目名称:the-blue-alliance,代码行数:23,代码来源:bootstrap.py

示例2: set_event_details

# 需要导入模块: from models.event import Event [as 别名]
# 或者: from models.event.Event import city [as 别名]
 def set_event_details(e_id, name, date, city,  add, descr, host, url, attendees, price, category, source):
     event1 = Event()
     qry = event1.check_event_exist(e_id) or event1.check_event_exist_by_name(name)
     if qry is False:
         event1.id = e_id
         event1.name = name
         event1.date = date
         event1.city = city
         event1.address = add
         event1.description = descr
         event1.host = host
         event1.event_url = url
         event1.source = source
         if (attendees != "Unknown"):
             event1.attendees = attendees
         event1.price = price
         if category is not None:
             event1.category = category
         key = event1.put()
         return key
     else:  # Update existing meetings! It could be changed or canceled!
         qry.name = name
         qry.date = date
         qry.city = city
         qry.address = add
         qry.description = descr
         qry.host = host
         qry.event_url = url
         qry.source = source
         qry.price = price
         if category is not None:
             qry.category = category
         results = Attendings.query(Attendings.event_id == qry.get_by_id(e_id))
         if results is not None:
             qry.attendees = attendees + results.count()
         else:
             qry.attendees = attendees
         qry.put()
开发者ID:ItamarShDev,项目名称:attender-web,代码行数:40,代码来源:DAL.py


注:本文中的models.event.Event.city方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。