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


Python Datum.title方法代码示例

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


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

示例1: post

# 需要导入模块: from v2ex.picky import Datum [as 别名]
# 或者: from v2ex.picky.Datum import title [as 别名]
  def post(self):
    self.session = Session()
    if CheckAuth(self) is False:
      return DoAuth(self, '/writer/settings')
    Datum.set('site_domain', self.request.get('site_domain'))
    Datum.set('site_domain_sync', self.request.get('site_domain_sync'))
    Datum.set('site_name', self.request.get('site_name'))
    Datum.set('site_author', self.request.get('site_author'))
    Datum.set('site_slogan', self.request.get('site_slogan'))
    Datum.set('site_analytics', self.request.get('site_analytics'))
    if self.request.get('site_default_format') not in CONTENT_FORMATS:
      Datum.set('site_default_format', 'html')
    else:
      Datum.set('site_default_format', self.request.get('site_default_format'))

    Datum.set('twitter_consumer_key',  self.request.get('twitter_consumer_key'))
    Datum.set('twitter_consumer_secret', self.request.get('twitter_consumer_secret'))
    Datum.set('twitter_access_token_key', self.request.get('twitter_access_token_key'))
    Datum.set('twitter_access_token_secret', self.request.get('twitter_access_token_secret'))

    q = db.GqlQuery("SELECT * FROM Datum WHERE title = 'twitter_sync'")
    if q.count() == 1:
      twitter_sync = q[0]
    else:
      twitter_sync = Datum()
      twitter_sync.title = 'twitter_sync'
    twitter_sync.substance = self.request.get('twitter_sync')
    if twitter_sync.substance == 'True':
      twitter_sync.substance = 'True'
    else:
      twitter_sync.substance = 'False'
    twitter_sync.put()
    Datum.set('feed_url', self.request.get('feed_url'))
    themes = os.listdir(os.path.join(os.path.dirname(__file__), 'tpl', 'themes'))
    if self.request.get('site_theme') in themes:
      Datum.set('site_theme', self.request.get('site_theme'))
    else:
      Datum.set('site_theme', 'default')
    memcache.delete('mentions_twitter')
    self.redirect('/writer/settings')
开发者ID:beta4better,项目名称:picky,代码行数:42,代码来源:writer.py

示例2: post

# 需要导入模块: from v2ex.picky import Datum [as 别名]
# 或者: from v2ex.picky.Datum import title [as 别名]
 def post(self):
     self.session = Session()
     if CheckAuth(self) is False:
         return DoAuth(self, "/writer/settings")
     Datum.set("site_domain", self.request.get("site_domain"))
     Datum.set("site_domain_sync", self.request.get("site_domain_sync"))
     Datum.set("site_name", self.request.get("site_name"))
     Datum.set("site_author", self.request.get("site_author"))
     Datum.set("site_slogan", self.request.get("site_slogan"))
     Datum.set("site_analytics", self.request.get("site_analytics"))
     if self.request.get("site_default_format") not in CONTENT_FORMATS:
         Datum.set("site_default_format", "html")
     else:
         Datum.set("site_default_format", self.request.get("site_default_format"))
     Datum.set("twitter_account", self.request.get("twitter_account"))
     Datum.set("twitter_password", self.request.get("twitter_password"))
     q = db.GqlQuery("SELECT * FROM Datum WHERE title = 'twitter_sync'")
     if q.count() == 1:
         twitter_sync = q[0]
     else:
         twitter_sync = Datum()
         twitter_sync.title = "twitter_sync"
     twitter_sync.substance = self.request.get("twitter_sync")
     if twitter_sync.substance == "True":
         twitter_sync.substance = "True"
     else:
         twitter_sync.substance = "False"
     twitter_sync.put()
     Datum.set("feed_url", self.request.get("feed_url"))
     themes = os.listdir(os.path.join(os.path.dirname(__file__), "tpl", "themes"))
     if self.request.get("site_theme") in themes:
         Datum.set("site_theme", self.request.get("site_theme"))
     else:
         Datum.set("site_theme", "default")
     memcache.delete("mentions_twitter")
     self.redirect("/writer/settings")
开发者ID:94smart,项目名称:picky,代码行数:38,代码来源:writer.py


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