From 990c795296764478c2cb8f61377bbcc829620bbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Luiz=20de=20Oliveira=20Ramos?= Date: Sat, 27 Aug 2016 14:10:59 -0300 Subject: [PATCH] Some comments --- admin.py | 2 +- main.py | 2 +- utils.py | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/admin.py b/admin.py index e5d5a44..dc23b56 100644 --- a/admin.py +++ b/admin.py @@ -14,12 +14,12 @@ class ExternalBlogsAdmin(ModelAdmin): class AggregatedTopicAdmin(ModelAdmin): - roles_accepted = ('admin', 'editor') column_filters = ('title', 'date', 'blog') column_searchable_list = ('title', 'topic_url') column_list = ('title', 'date', 'blog', 'topic_url', 'description') form_columns = ('title', 'date', 'blog', 'topic_url', 'description') +# Register RSSaggregator models to quokka admin page admin.register(ExternalBlogs, ExternalBlogsAdmin, category=_("RSSaggregator"), name=_l("External Blogs")) admin.register(AggregatedTopic, AggregatedTopicAdmin, category=_("RSSaggregator"), name=_l("Aggregated Topics")) diff --git a/main.py b/main.py index 95f2d93..68b7d0d 100644 --- a/main.py +++ b/main.py @@ -3,6 +3,6 @@ from quokka.core.app import QuokkaModule from .views import AggregatedTopicsListView - +# Blueprint endpoints module = QuokkaModule("rssaggregator", __name__, template_folder="templates") module.add_url_rule('/aggregated-topics/', view_func=AggregatedTopicsListView.as_view('aggregated topic')) diff --git a/utils.py b/utils.py index 2b5fc60..6d93bad 100644 --- a/utils.py +++ b/utils.py @@ -3,6 +3,10 @@ def get_external_topic(**kwargs): + ''' + :param kwargs: This function allows kwargs to give filter power for user + :return: AggregatedTopic List + ''' topics = AggregatedTopic.objects(**kwargs) return topics.order_by('date')