diff options
Diffstat (limited to 'pyaggr3g470r/views.py')
-rw-r--r-- | pyaggr3g470r/views.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py index 65e2459f..d09ff8f4 100644 --- a/pyaggr3g470r/views.py +++ b/pyaggr3g470r/views.py @@ -335,7 +335,7 @@ def index_database(): fastsearch.create_index(user.feeds) flash('Database indexed.', 'success') return redirect(url_for('home')) - + @app.route('/export/', methods=['GET']) @login_required def export_articles(): @@ -353,6 +353,17 @@ def export_articles(): response.headers['Content-Disposition'] = 'attachment; filename='+archive_file_name return response +@app.route('/export_opml/', methods=['GET']) +def export_opml(): + """ + Export all feeds to OPML. + """ + user = models.User.objects(email=g.user.email).first() + response = make_response(render_template('opml.xml', user=user, now=datetime.datetime.now())) + response.headers['Content-Type'] = 'application/xml' + response.headers['Content-Disposition'] = 'attachment; filename=feeds.opml' + return response + @app.route('/search/', methods=['GET']) @login_required def search(): @@ -391,7 +402,7 @@ def management(): flash(str(nb) + " feeds imported.", "success") except Exception as e: flash("Impossible to import the new feeds.", "danger") - + form = AddFeedForm() user = models.User.objects(email=g.user.email).first() |