Pyramid database and encapsulation
This I'm sure will be a common task in my application and many other
programmer's, rows are retrieved like so:
@view_config(renderer='json')
def series(request):
rows = DBSession.execute("SELECT * FROM series").fetchall()
Then the rows need to be encoded.
What I'd like to do is put the query inside something that encapsulates
the rows preparing them for encoding or whatever else I may have in store
for the objects in future. I don't think an ORM would suit since I want to
write my SQL raw, so what could I use with Pyramid to do this?
No comments:
Post a Comment