jmdc_export_csv.py 439 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
from pyramid.response import Response
from pyramid.view import view_config
from sqlalchemy.exc import DBAPIError

from jmdc_app.models.star_info import StarInfo

@view_config(route_name='jmdc_export_csv', renderer='../templates/jmdc_export_csv.jinja2')
def jmdc_export_csv(request):

    session = request.dbsession
Guillaume Mella's avatar
Guillaume Mella committed
11
    request.response.content_type = 'text/plain'
12
13
14
15

    stars = session.query(StarInfo).all()

    return { 'stars': stars }