File tree Expand file tree Collapse file tree 4 files changed +18
-31
lines changed Expand file tree Collapse file tree 4 files changed +18
-31
lines changed Original file line number Diff line number Diff line change 1
1
# coding: utf-8
2
2
3
3
from quokka .core .app import QuokkaModule
4
- from .views import ExternalBlogListView
5
- from .utils import get_external_blog
4
+ from .views import AggregatedTopicsListView
6
5
7
6
8
7
module = QuokkaModule ("rssaggregator" , __name__ , template_folder = "templates" )
9
- module .add_url_rule ('/rssaggregator/' , view_func = ExternalBlogListView .as_view ('external blogs' ))
10
-
11
- #module.add_app_template_global(get_external_blog)
8
+ module .add_url_rule ('/aggregated-topics/' , view_func = AggregatedTopicsListView .as_view ('aggregated topic' ))
Original file line number Diff line number Diff line change 4
4
< div class ="large-12 columns ">
5
5
< table class ="large-12 ">
6
6
< thead >
7
- < tr > Name</ tr >
8
- < tr > Root URL</ tr >
9
- < tr > Feeds URL</ tr >
7
+ < tr > Title</ tr >
8
+ < tr > Description</ tr >
9
+ < tr > Topic URL</ tr >
10
+ < tr > Date</ tr >
10
11
</ thead >
11
-
12
12
< tbody >
13
- {% for blog in blogs %}
14
- < td > {{ blog.name }}</ td >
15
- < td > {{ blog.root_url }}</ td >
16
- < td > {{ blog.feeds_url }}</ td >
13
+ {% for topic in topics %}
14
+ < td > {{ topic.title }}</ td >
15
+ < td > {{ topic.description }}</ td >
16
+ < td > {{ topic.topic_url }}</ td >
17
+ < td > {{ topic.date }}</ td >
17
18
{% endfor %}
18
19
</ tbody >
19
20
</ table >
Original file line number Diff line number Diff line change 1
1
# coding: utf-8
2
- from .models import ExternalBlogs
2
+ from .models import AggregatedTopic
3
3
4
4
5
- def get_external_blog (** kwargs ):
6
- blogs = ExternalBlogs .objects (** kwargs )
5
+ def get_external_topic (** kwargs ):
6
+ topics = AggregatedTopic .objects (** kwargs )
7
7
8
- return blogs .order_by ('name ' )
8
+ return topics .order_by ('date ' )
9
9
Original file line number Diff line number Diff line change 3
3
4
4
from flask .views import MethodView
5
5
from quokka .core .templates import render_template
6
- from .utils import get_external_blog
6
+ from .utils import get_external_topic
7
7
8
8
9
- class ExternalBlogListView (MethodView ):
9
+ class AggregatedTopicsListView (MethodView ):
10
10
"""
11
11
Show a full list of external blogs
12
12
"""
13
13
14
14
def get (self ):
15
- return render_template ('RSSaggregator/blogs_list.html' , blogs = get_external_blog ())
16
-
17
-
18
- '''class ExternalBlogView(MethodView):
19
- """
20
- Show specific external blog
21
- """
22
-
23
- def get(self, blog_id):
24
- blog = get_external_blog(blog_id=blog_id)
25
- contents = get_author_contents(author)
26
- return render_template('authors/detail.html',author=author, contents=contents)'''
15
+ return render_template ('RSSaggregator/external_topics_list.html' , topics = get_external_topic ())
You can’t perform that action at this time.
0 commit comments