Re: [Patch] PGAdmin 4 JSON Handling

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Ronan Dunklau <ronan(dot)dunklau(at)dalibo(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>, Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>
Subject: Re: [Patch] PGAdmin 4 JSON Handling
Date: 2015-04-16 10:40:14
Message-ID: CA+OCxoyOz68-kPXYGZzUwH7sdUdyJT4moJyRkBEkaeQfC3yRLQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

On Thu, Apr 16, 2015 at 11:19 AM, Ronan Dunklau
<ronan(dot)dunklau(at)dalibo(dot)com> wrote:
> Le jeudi 16 avril 2015 15:46:51 Ashesh Vashi a écrit :
>> Hi Ronan,
>>
>> On Thu, Apr 16, 2015 at 2:49 PM, Ronan Dunklau <ronan(dot)dunklau(at)dalibo(dot)com>
>>
>> wrote:
>> > Hello.
>> >
>> > I'm trying to dive into the PGAdmin 4 codebase, and one low hanging fruit
>> > that
>> > I saw was the handling of JSON data.
>> >
>> > The first patch is really trivial, and allows PgAdmin4 to run on system
>> > with
>> > case sensitive filesystems.
>> >
>> > JSON data should be returned to the client using an application/json MIME-
>> > TYPE. Flask already provides an easy way to generate JSON response, with
>> > its
>> > jsonify function.
>> >
>> > This patch does not change anything architecturally, it just ensure that
>> > the
>> > get_nodes method of each hook returns JSONizable objects, instead of
>> > building
>> > them manually.
>> >
>> > Moreover, there was a function already in place to return JSON document
>> > according to a certain layout (everything under "data", with metadata
>> > attached
>> > along the way), which was not used by the ACi tree. This patch also
>> > changes
>> > this format to ensure the json responses returned by the application are
>> > consistent.
>>
>> Thanks for the patches.
>> These changes are already been done in my current development work, which
>> is still a WIP. (Hence - it has not been checked-in/shared.)
>>
>> Thanks any way.

Oh, they are?

> Is there a public branch where I can see this WIP ?

I assume it's all on his laptop. We (the pgAdmin project) have never
published WIP branches that I can recall, except for GSoC projects.

> As for the other proposals regarding the structure of the javascript code and
> the module / hooks API, do you have any comment ?

It's been on my personal TODO for a little while to sort out that code
into a proper OO class hierarchy as you suggest. Is that something you
would like to take a look at Ronan? I won't be touching it for quite a
while as I'm overloaded at the moment (which is why I asked Ashesh to
help out).

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Ashesh Vashi 2015-04-16 10:43:24 Re: [Patch] PGAdmin 4 JSON Handling
Previous Message Ashesh Vashi 2015-04-16 10:28:20 Re: [Patch] PGAdmin 4 JSON Handling