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


Python event.Event类代码示例

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


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

示例1: test_show_event

   def test_show_event(self):
      event = Event()
      event.put()

      path = "/events/" + str(event.key().id())

      response = self.testapp.get(path)
      self.assertEqual(200, response.status_int)
开发者ID:JoaoVasques,项目名称:AEISTMobile-Backoffice,代码行数:8,代码来源:test_event.py

示例2: get

 def get(self, id):
     event = Event.mc_get(id)
     if event.id and event.zsite_id == self.current_user_id:
         if event.cid == EVENT_STATE_INIT:
             return self.redirect('/po/event/%s'%id)
         return self.render(event=event)
     self.redirect('/po/event')
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:7,代码来源:po_event.py

示例3: get

    def get(self, id):
        user_id = self.current_user_id
        po = self._po(user_id, id)

        if po is None:
            return
        po_zsite_id = po.zsite_id

        if po_zsite_id and po_zsite_id != self.zsite_id:
            return self.redirect(
                '%s/po/edit/%s'%(link(po_zsite_id), id)
            )
        cid = po.cid
        if cid == CID_EVENT_FEEDBACK:
            self.event = Event.mc_get(po.rid)

        if cid == CID_NOTE:
            template = 'ctrl/zsite/po/note.htm'
        else:
            template = 'ctrl/zsite/po/po.htm'
        self.render(
            template,
            po=po,
            cid=po.cid,
            pic_list=pic_list_edit(user_id, id)
        )
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:26,代码来源:po.py

示例4: _event

 def _event(self, id):
     o = Event.mc_get(id)
     if o and o.state > EVENT_STATE_RM:
         if o.zsite_id == self.zsite_id:
             return o
         return self.redirect(link(o.zsite_id)+self.request.path)
     return self.redirect('/')
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:7,代码来源:event.py

示例5: query_by_code

def query_by_code(code):
    try:
        event = Event.get(Event.code == code)
        result = shortcuts.model_to_dict(event)
    except peewee.DoesNotExist:
        result = {}
    return result
开发者ID:zy4290,项目名称:qilaihi.club,代码行数:7,代码来源:event.py

示例6: post

 def post(self, id):
     current_user_id = self.current_user_id
     event = Event.mc_get(id)
     txt = self.get_argument('txt', '')
     if event and event.can_admin(current_user_id) and txt:
         po_event_notice_new(current_user_id, id, txt)
     self.finish('{}')
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:7,代码来源:event.py

示例7: get

        def get(self, *args):
            event = Event.get_by_id(long(args[0]))

            if event:
                event.delete()

            self.redirect('/events')
开发者ID:AEIST,项目名称:old-AEISTMobile-Backoffice,代码行数:7,代码来源:EventController.py

示例8: test_edit_event

	def test_edit_event(self):
		event = Event(name="Event", description="Description1", location="Lisbon", date="2013-04-28", time="13:00", linkFacebook="http://www.facebook.com")
		event.put()
		ident = event.key().id()
		params = {
			'name': "New event",
			'description': "Description2",
			'location': "Porto",
			'date': "2013-04-28",
			'time': "22:00",
			'facebook_link': "http://www.google.com"
		}

		path = "/events/edit/" + str(event.key().id())
		response = self.testapp.post(path, params)

		event = Event.get_by_id(ident)

		self.assertEqual(1, Event.all().count())
		self.assertEqual(302, response.status_int)
		self.assertEqual("New event", event.name)
		self.assertEqual("Description2", event.description)
		self.assertEqual("Porto", event.location)
		self.assertEqual("2013-04-28", event.date)
		self.assertEqual("22:00", event.time)
		self.assertEqual("http://www.google.com", event.linkFacebook)
开发者ID:AEIST,项目名称:old-AEISTMobile-Backoffice,代码行数:26,代码来源:test_event.py

示例9: post

 def post(self):
     args = event_parser.parse_args()
     newEvent = Event(
         tag = args.tag,
         name = args.name,
         description = args.description,
         venue = Venue.query.get_by_name(args.venue["name"]),
         time = args.time,
         date = args.date,
         image = args.image,
         gests = map(lambda gest: gest["username"], args.gests),
         requirement = map(lambda req: Requirement(name=req["name"],quantity=req["quantity"]), args.requirement),
         capacity = args.capacity,
         visibility = Visibility.query.get(args.visibility),
         owner = currentUser()
     )
     newEvent.save()
     log.info("Crea un Evento con: {'tag':'%s'}" % newEvent.tag)
     return newEvent, 201
开发者ID:arq1nnySu,项目名称:enjoy-events-back,代码行数:19,代码来源:eventService.py

示例10: test_new_event

   def test_new_event(self):
      params = {
         'name': "Event",
         'description': "Description",
         'local': "Lisbon",
         'date': "2013-04-27",
         'time': "21:00",
         'facebook_link': "http://www.facebook.com"
      }

      response = self.testapp.post('/events/new', params)
      self.assertEqual(1, Event.all().count())
开发者ID:JoaoVasques,项目名称:AEISTMobile-Backoffice,代码行数:12,代码来源:test_event.py

示例11: event_weekly

def event_weekly(begin):
    mail = weekly_mail_pop()
    event_list = Event.where(state=EVENT_STATE_BEGIN).where('id>%s', begin)
    if event_list:
        last_id = event_list[-1].id
        event_li = event_city_list(event_list)
        for i in ormiter(Zsite, 'cid=%s and state>=%s' % (CID_USER, ZSITE_STATE_ACTIVE)):
            event_weekly_mail(i, event_li, mail)
            #print i.id
            #sys.stdout.flush()
            time.sleep(0.01)
        return last_id
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:12,代码来源:event_weekly.py

示例12: test_new_event

	def test_new_event(self):
		params = {
			'name': "Event",
			'description': "Descrição",
			'location': "Lisbon",
			'date': "2013-04-27",
			'time': "21:00",
			'facebook_link': "http://www.facebook.com"
		}

		self.testapp.post('/events/new', params)

		results = Event.all().fetch(1, 0)
		event = results[0]

		self.assertEqual(1, Event.all().count())
		self.assertEqual("Event", event.name)
		self.assertEqual(u"Descrição", event.description)
		self.assertEqual("Lisbon", event.location)
		self.assertEqual("2013-04-27", event.date)
		self.assertEqual("21:00", event.time)
		self.assertEqual("http://www.facebook.com", event.linkFacebook)
开发者ID:AEIST,项目名称:old-AEISTMobile-Backoffice,代码行数:22,代码来源:test_event.py

示例13: get

    def get(self, id):
        po = self.po(id)
        if po is None:
            return

        zsite_id = self.zsite_id
        user_id = self.current_user_id
        can_admin = po.can_admin(user_id)
        can_view = po.can_view(user_id)

        if can_view and user_id:
            self.mark()

        cid = po.cid
        if cid == CID_PRODUCT:
            return self.redirect(po.user.link)

        if cid == CID_EVENT:
            zsite_tag_id = tag_name = None
            event = Event.mc_get(id)
            if event.state <= EVENT_STATE_TO_REVIEW:
                tag_link = '/event/to_review'
            else:
                tag_link = '/event'
        elif cid == CID_EVENT_NOTICE:
            zsite_tag_id = tag_name = None
            tag_link = '/%s'%po.rid
        else:
            zsite_tag_id, tag_name = zsite_tag_id_tag_name_by_po_id(po.user_id, id)
            if zsite_tag_id:
                tag_link = '/tag/%s' % zsite_tag_id
            else:
                tag_link = '/po/cid/%s'%cid

        prev_id, next_id = po_prev_next(
            po, zsite_tag_id
        )

        buzz_reply_hide(user_id,po.id)

        return self.render(
            self.template,
            po=po,
            can_admin=can_admin,
            can_view=can_view,
            zsite_tag_id=zsite_tag_id,
            prev_id=prev_id,
            next_id=next_id,
            tag_name=tag_name,
            tag_link=tag_link
        )
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:51,代码来源:po_view.py

示例14: test_delete_event

   def test_delete_event(self):
      event = Event()
      event.put()
      self.assertEqual(1, Event.all().count())

      path = "/events/delete/" + str(event.key().id())

      response = self.testapp.get(path)
      self.assertEqual(0, Event.all().count())
开发者ID:JoaoVasques,项目名称:AEISTMobile-Backoffice,代码行数:9,代码来源:test_event.py

示例15: query_fulltext_code

def query_fulltext_code(code):
    pinyin = Pinyin()
    initials = []
    for letter in pinyin.get_initials(code, splitter=' ').lower().split(' '):
        if letter.isalpha():
            initials.append(letter * 4)
    logging.debug(initials)
    analysed_code = pinyin.get_pinyin(code, splitter=u' ') + ' ' + ' '.join(initials)
    logging.debug(analysed_code)
    clause = "MATCH(`codepinyin`, `codepinyininitials`) AGAINST (%s)"
    query = yield dbutil.do(Event.select(SQL('*, ' + clause + ' AS similarity', analysed_code)).where(
        SQL(clause, analysed_code)).limit(4).dicts)
    events = [event for event in query]
    logging.debug(events)
    return events
开发者ID:zy4290,项目名称:qilaihi.club,代码行数:15,代码来源:event.py


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