Beispiel #1
0
def upload_all():
    def category_init_func(row):
        c = Category(row['name'])
        c.id = row['id']
        return c
    def post_init_func(row):
        # this is lessons learned that relation needs an object not a string
        c = Category.query.filter_by(name=row['category']).first()
        p = Post(row['title'], row['body'], c, row['pub_date'])
        return p
    request.save_book_to_database(field_name='file', session=db.session,
                                  tables=[Category, Post],
                                  initializers=[category_init_func, post_init_func])
    return excel.make_response_from_tables(db.session, [Category, Post], "xls")
Beispiel #2
0
def doexport():
    return excel.make_response_from_tables(db.session, [Category, Post], "xls")
def doexport():
    return excel.make_response_from_tables(db.session, [Category, Post], "xls")
Beispiel #4
0
def exportRest():
    return excel.make_response_from_tables(session, [Restaurant], "xls")
Beispiel #5
0
def doexport():
    return excel.make_response_from_tables(db.session, [custinfo], "xls")
Beispiel #6
0
def doexport():
    return excel.make_response_from_tables(db.session, [custinfo], "xls")