aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel@gmail.com>2013-10-28 00:28:16 +0100
committerCédric Bonhomme <kimble.mandel@gmail.com>2013-10-28 00:28:16 +0100
commite43cf71fe33e10ac590878dd3ca5c6ed234f5e95 (patch)
treeb6c959b3f7c97c684be512f35fcc4853e78a424b /pyaggr3g470r
parentSECRET_KEY is set by os.urandom(12). (diff)
downloadnewspipe-e43cf71fe33e10ac590878dd3ca5c6ed234f5e95.tar.gz
newspipe-e43cf71fe33e10ac590878dd3ca5c6ed234f5e95.tar.bz2
newspipe-e43cf71fe33e10ac590878dd3ca5c6ed234f5e95.zip
Sorting of articles seems to be working ;-)
Diffstat (limited to 'pyaggr3g470r')
-rw-r--r--pyaggr3g470r/__init__.py14
-rw-r--r--pyaggr3g470r/feedgetter.py2
-rw-r--r--pyaggr3g470r/models.py2
-rw-r--r--pyaggr3g470r/views.py2
4 files changed, 4 insertions, 16 deletions
diff --git a/pyaggr3g470r/__init__.py b/pyaggr3g470r/__init__.py
index d4079300..3d63d9de 100644
--- a/pyaggr3g470r/__init__.py
+++ b/pyaggr3g470r/__init__.py
@@ -41,24 +41,12 @@ class FeedView(ModelView):
column_filters = ['title', 'link']
column_searchable_list = ('title', 'link')
-
- form_ajax_refs = {
- 'tags': {
- 'fields': ('title', 'link')
- }
- }
class ArticleView(ModelView):
column_filters = ['title', 'link']
column_searchable_list = ('title', 'link')
-
- form_ajax_refs = {
- 'tags': {
- 'fields': ('title', 'link')
- }
- }
admin.add_view(FeedView(Feed))
admin.add_view(ArticleView(Article))
-from pyaggr3g470r import views
+from pyaggr3g470r import views \ No newline at end of file
diff --git a/pyaggr3g470r/feedgetter.py b/pyaggr3g470r/feedgetter.py
index 998e768a..16571294 100644
--- a/pyaggr3g470r/feedgetter.py
+++ b/pyaggr3g470r/feedgetter.py
@@ -148,7 +148,7 @@ class FeedGetter(object):
article_title, description)).start()
"""
feed.articles.extend(articles)
- #feed.articles = sorted(feed.articles, key=lambda t: t.date, reverse=True)
+ feed.articles = sorted(feed.articles, key=lambda t: t.date, reverse=True)
feed.save()
diff --git a/pyaggr3g470r/models.py b/pyaggr3g470r/models.py
index 58b350ea..dfc40b28 100644
--- a/pyaggr3g470r/models.py
+++ b/pyaggr3g470r/models.py
@@ -29,7 +29,7 @@ class Feed(Document):
link = StringField(required=True)
site_link = StringField(required=True)
mail = BooleanField()
- articles = SortedListField(ReferenceField('Article', dbref = False))
+ articles = ListField(ReferenceField('Article', dbref = False))
created_date = DateTimeField(required=True, default=datetime.now)
meta = {
diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py
index f2cfc095..81c60e73 100644
--- a/pyaggr3g470r/views.py
+++ b/pyaggr3g470r/views.py
@@ -59,7 +59,7 @@ def delete(article_id=None):
@app.route('/articles/<feed_id>', methods=['GET'])
def articles(feed_id=None):
feed = models.Feed.objects(id=feed_id).first()
- feed.articles = sorted(feed.articles, key=lambda t: t.date, reverse=True)
+ #feed.articles = sorted(feed.articles, key=lambda t: t.date, reverse=True)
return render_template('articles.html', feed=feed)
@app.route('/favorites/', methods=['GET'])
bgstack15