示例#1
0
文件: views.py 项目: pvieytes/osweb
def home_view(request):
    context_dict = {}
    news = ManageBlog.get_news_blog()
    context_dict['news'] = news[:settings.NUM_HOME_NEWS]
    context_dict['SLIDE_TIMER'] = settings.SLIDE_TIMER
    projects = ManageProject.get_frontpage_projects()
    random.shuffle(projects)
    context_dict['projects'] = projects[:settings.NUM_HOME_PROJECTS]
    context_dict['tab_home'] = True
    return render_to_response('home.html', context_dict, context_instance=RequestContext(request))
示例#2
0
文件: views.py 项目: pvieytes/osweb
def live_view(request):
    context_dict = {}
    context_dict['tab_live'] = True
    context_dict['num_tweets'] = settings.NUM_TWEETS
    context_dict['twitter_user'] = settings.TWITTER_USER
    
    tweets = ManageTwitter.get_tweets()
    context_dict['tweets'] = tweets
    
    posts = ManageBlog.get_all_blogs()
    context_dict['posts'] = posts
    context_dict['slice_num_post'] = "0:%s" % settings.NUM_LIVE_POSTS
    context_dict['slice_recent_post'] = "0:%s" % settings.NUM_LIVE_RECENT_POSTS
    #context_dict['slice_characters_per_post'] = "0:%s" % 500
    return render_to_response('main/live.html', context_dict, context_instance=RequestContext(request))
示例#3
0
 def handle_noargs(self, **options):
     ManageTwitter.update_tweets_cache()
     ManageBlog.update_blogs_cache()
示例#4
0
 def handle_noargs(self, **options):
     ManageBlog.update_blogs_cache()