示例#1
0
    def district_feeds():
        if g.user.is_anonymous():
            abort(401)

        legislator = RegionController.legislator_of(g.user.address_id)
        district_feeds = UserController.district_feeds(legislator)
        district_feeds = district_more.query(district_feeds,  _from=request.args.get('before', None))
        district_feeds['html'] = render_template('district-feeds.html',
                legislator=legislator,
                district_feeds=district_feeds)
        del district_feeds['feeds']
        return jsonify(district_feeds)
示例#2
0
    def mypage():
        if g.user.is_anonymous():
            abort(401)

        legislator = RegionController.legislator_of(g.user.address_id)
        district_feeds = UserController.district_feeds(legislator)
        district_feeds = district_more.query(district_feeds)
        keyword_feeds = UserController.keyword_feeds(g.user)
        keyword_feeds = keyword_more.query(keyword_feeds)
        return render_template('mypage.html',
                legislator=legislator,
                district_feeds=district_feeds,
                keyword_feeds=keyword_feeds)