• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python nateusers.FBUser类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: sendDriverEmail

    def sendDriverEmail(self,ride):

        if not ride.driver:
            return
        if choice != "facebook":
            to = ride.driver.email()
        else:
            logging.debug(ride.driver)
            to = FBUser.get_by_key_name(ride.driver)
            logging.debug(to)
        sender = FROM_EMAIL_ADDR
        subject = "New Passenger for your ride"
        p = db.get(ride.passengers[-1])
        user = FBUser.get_by_key_name(p.name)
        body = """
Dear %s,
We wanted to let you know that %s has been added to your ride
from %s to %s on %s.  If you need to contact %s you can do so at %s.

Thanks for being a driver!

Sincerely,

The Rideshare Team
""" % (to.nickname(), user.nickname(), ride.start_point_title, ride.destination_title,
       ride.ToD, user.nickname(), p.contact)

        if choice != "facebook":
            logging.debug(body)
            mail.send_mail(sender,to,subject,body)
        else:
            graph = facebook.GraphAPI(to.access_token)
            logging.debug(graph)
            graph.put_object("me", "feed", message=body)
开发者ID:bnmnetp,项目名称:rideshare_old,代码行数:34,代码来源:main.py


示例2: sendRiderEmail

    def sendRiderEmail(self, ride, to):

        if choice == "facebook":
            to = FBUser.get_by_key_name(to)
            user = self.current_user
            logging.debug(to)
        sender = FROM_EMAIL_ADDR
        subject = "Change in your ride"

        body = """
Dear %s,

We have good news about your request for a ride from %s to %s on %s.
%s has agreed to drive.  You can contact the driver at %s.

Have a safe trip!

Sincerely,

The Rideshare Team
""" % (to.nickname(),  ride.start_point_title, ride.destination_title, ride.ToD,
       user.nickname(), ride.contact)
        if choice != "facebook":
            logging.debug(body)
            mail.send_mail(sender,to.email(),subject,body)
        else:
            graph = facebook.GraphAPI(to.access_token)
            graph.put_object("me", "feed", message=body)
开发者ID:bnmnetp,项目名称:rideshare_old,代码行数:28,代码来源:main.py


示例3: get

  def get(self):

    user = FBUser.get_by_key_name(self.current_user.id)
    aquery = db.Query(College)
    mycollege= aquery.get()

    eventsList = []
    circles = []
    for item in user.circles:
        query = db.Query(Event)
        query.filter("ToD > ", datetime.date.today())
        query.filter("circle =",str(item))
        event_list = query.fetch(limit=100)
        logging.debug(event_list)
        for event in event_list:
          eventsList.append(event.to_dict())
        circles.append(Circle.get_by_id(int(item)))
    path = os.path.join(os.path.dirname(__file__), 'templates/main.html')
    self.response.out.write(str(template.render(path, {
            'event_list': eventsList,
            'circles' : circles,
            'college':mycollege,
            'logout':'/auth/logout',
            'nick':self.current_user.nickname()
            })))
开发者ID:srijib,项目名称:rideshare-2,代码行数:25,代码来源:main.py


示例4: get

 def get(self):
     drivernum = self.request.get('dkey')
     user = FBUser.get_by_key_name(drivernum)
     doRender(self, 'ratedriver.html', {
         'driver': user.nickname(),
         'drivernum':drivernum
     })
开发者ID:bnmnetp,项目名称:rideshare_old,代码行数:7,代码来源:main.py


示例5: post

 def post(self):
     drivernum = self.request.get("driver")
     text = self.request.get("ratetext")
     ooFrating = self.request.get("ooFrating")
     user= FBUser.get_by_key_name(drivernum)
     user.drivercomments.append(text)
     user.numrates = user.numrates + 1
     if user.rating== None:
         user.rating= float(ooFrating)
     else:
         user.rating= user.rating + float(ooFrating)
     user.put()
     doRender(self, "submit.html",{})
     self.redirect("/home")
开发者ID:bnmnetp,项目名称:rideshare_old,代码行数:14,代码来源:main.py


示例6: post

 def post(self):
     aquery = db.Query(College)
     mycollege = aquery.get()  
     drivernum = self.request.get("driver")
     text = self.request.get("ratetext")
     ooFrating = self.request.get("ooFrating") # Out Of Five
     user = FBUser.get_by_key_name(drivernum)
     user.drivercomments.append(text)
     user.numrates = user.numrates + 1
     if user.rating == None:
         user.rating = float(ooFrating)
     else:
         user.rating = user.rating + float(ooFrating)
     user.put()
     doRender(self, "submit.html",{"college",mycollege})
     self.redirect("/home")
开发者ID:srijib,项目名称:rideshare-2,代码行数:16,代码来源:main.py


示例7: get

    def get(self):
        ride_key = self.request.get("key")
        contact = self.request.get("contact")
        numpass = self.request.get("numpass")
        user = self.current_user
        
        ride = Ride.get(ride_key)
        ride.driver = user.id
        ride.drivername = FBUser.get_by_key_name(user.id).nickname()
        ride.contact = contact
        ride.max_passengers = int(numpass)
        ride.put()

        for p in ride.passengers:
            logger = logging.getLogger('MySite')
            logger.info(str(p))
            passenger = Passenger.get(p)
            if passenger.loginType =="google":
              self.sendRiderEmail(ride,passenger.email,"google")
            elif passenger.loginType=="facebook":
              self.sendRiderEmail(ride, passenger.name, "facebook")

        self.response.out.write("OK")
开发者ID:zaschim,项目名称:rideshare,代码行数:23,代码来源:main.py


示例8: post

 def post(self):
   user = FBUser.get_by_key_name(self.current_user.id)
   
   user.circles = self.request.str_params.getall("circle")
   user.put()
   self.redirect("/main")
开发者ID:zaschim,项目名称:rideshare,代码行数:6,代码来源:main.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python client.Client类代码示例发布时间:2022-05-27
下一篇:
Python naoqitools.myGetProxy函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap