Re: little_pger.py (a thin layer a tad above SQL and psycopg2) - Mailing list psycopg

From Rory Campbell-Lange
Subject Re: little_pger.py (a thin layer a tad above SQL and psycopg2)
Date
Msg-id 20121219171215.GA15802@campbell-lange.net
Whole thread Raw
In response to Re: little_pger.py (a thin layer a tad above SQL and psycopg2)  ("A.M." <agentm@themactionfaction.com>)
List psycopg
On 19/12/12, A.M. (agentm@themactionfaction.com) wrote:
>
> On Dec 19, 2012, at 11:53 AM, Rory Campbell-Lange wrote:
>
> > On 19/12/12, A.M. (agentm@themactionfaction.com) wrote:
> >> ...I, too, have been looking for something lightweight and quick which
> >> would allow nearly-automatic JSON generation from database rows. The
> >> trickier part is recursing a model attribute tree which always leads
> >> me back to SQLAlchemy.
> >
> > Since psycopg can return namedtuples and simplejson serialises
> > namedtuples, this should not be a difficult thing to do.
>
>
> That doesn't help when there are columns or subselects which need to
> become part of a one-to-many or many-to-many relationship represented
> as arrays attached to the main model in JSON. That is what I meant by
> "recursing the model attribute tree".

Ah -- we do that sort of thing in the database.


psycopg by date:

Previous
From: "A.M."
Date:
Subject: Re: little_pger.py (a thin layer a tad above SQL and psycopg2)
Next
From: Adrian Klaver
Date:
Subject: Repository