Re: Add versions.json endpoint with latest release information - Mailing list pgsql-www

From Magnus Hagander
Subject Re: Add versions.json endpoint with latest release information
Date
Msg-id CABUevEw2ayzvAjg=hJyjY2XNHxTwUer3=1KavL2-v+cXtwX5gg@mail.gmail.com
Whole thread Raw
In response to Re: Add versions.json endpoint with latest release information  (Sehrope Sarkuni <sehrope@jackdb.com>)
Responses Re: Add versions.json endpoint with latest release information
List pgsql-www
On Tue, May 4, 2021 at 11:49 PM Sehrope Sarkuni <sehrope@jackdb.com> wrote:
>
> Updated patch is attached with the renamed field.
>
> Rather than use annotate(...), it defines a separate function to convert the Version model into a dict for
serialization.That way the numtree function can be used for the major version (i.e. for 10.0 => 10). I think it ends up
beingcleaner anyway as all the fields in the resulting JSON are listed in one place. 

Thanks, that looks much better, I agree.


> Thanks for updating the sample data. New output is now:

Applied, with a few small changes:

* Didn't pass the pep8 tests we run -- needed some adjustments to
indentations and spacing only
* Made version_to_json return the dict directly instead of building it
incrementally. Probably faster, but the important part being I find
that much more readable.
* renamed eoldate -> eolDate and reldate -> relDate to follow the
pattern Jonathan suggested wrt the latestMinor field

Thanks!

--
 Magnus Hagander
 Me: https://www.hagander.net/
 Work: https://www.redpill-linpro.com/



pgsql-www by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Related Projects
Next
From: Sehrope Sarkuni
Date:
Subject: Re: Add versions.json endpoint with latest release information