本文整理汇总了Python中src.common.database.Database.find_coloumn方法的典型用法代码示例。如果您正苦于以下问题:Python Database.find_coloumn方法的具体用法?Python Database.find_coloumn怎么用?Python Database.find_coloumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类src.common.database.Database
的用法示例。
在下文中一共展示了Database.find_coloumn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: home
# 需要导入模块: from src.common.database import Database [as 别名]
# 或者: from src.common.database.Database import find_coloumn [as 别名]
def home(genre = 'comedy'):
#date=Database.find_coloumn(genre+'_last_updated','last_updated_date')
#if Database.count_all(genre+'_last_updated') > 0:
# if date[0]['last_updated_date']!=str(datetime.date.today()):
# update_database(genre)
#else:
# update_database(genre)
#update_database(genre)
print("Site Visited")
t=Database.find_coloumn(genre,"title")
new_title=[None]*30
new_trailer = [None] * 30
new_dates=[None]*30
new_ratings=[None]*30
new_poster_links=[None]*30
i=0
for title in t:
new_title[i]=title['title']
i=i+1
i=0
trailers = Database.find_coloumn(genre,"trailer")
for trailer in trailers:
new_trailer[i]=trailer['trailer']
i=i+1
i=0
release_dates = Database.find_coloumn(genre, "release_date")
for date in release_dates:
new_dates[i] = date['release_date']
i = i + 1
i = 0
ratings = Database.find_coloumn(genre, "rating")
for rating in ratings:
new_ratings[i] = rating['rating']
i = i + 1
i=0
poster_links = Database.find_coloumn(genre, "poster")
for poster_link in poster_links:
new_poster_links[i] = poster_link['poster']
i = i + 1
return render_template('list.html', g_link='https://www.google.com/search?q=',elements=new_title, trailer_links=new_trailer,
genres=genres, current_genre=genre,
release_dates=new_dates,
ratings=new_ratings,
poster_links=new_poster_links)