[PATCH jsonschema] Implement attributes of Paginable resource as properties

Philippe Pepiot philippe.pepiot at logilab.fr
Wed Jun 20 11:13:10 CEST 2018


On 20/06/2018, Denis Laxalde wrote:
> # HG changeset patch
> # User Denis Laxalde <denis.laxalde at logilab.fr>
> # Date 1529417258 -7200
> #      Tue Jun 19 16:07:38 2018 +0200
> # Node ID 62934d2097acdbbe04182b6070b7e87ac6549dbe
> # Parent  62523c338920edf7f5b6ccd206cff69f20113ec4
> # Available At https://hg.logilab.org/review/cubicweb-jsonschema
> #              hg pull https://hg.logilab.org/review/cubicweb-jsonschema -r 62934d2097ac
> # EXP-Topic paginable-inheritance-mess
> Implement attributes of Paginable resource as properties
> 
> I'm getting into trouble while trying to reuse this class in a multiple
> inheritance context because the proper __init__ method is never called.
> So, let's get rid of __init__ in Paginable and implement 'limit',
> 'offset' and '_has_next' attributes, previously defined in __init__ as
> reified properties. Notice that, since _has_next may be changed (in
> paginate() method), we also need a setter for this property.
> 
> Accordingly, drop super() calls in resource classes inheriting from
> Paginable and mention that this class should be used as a mixin.

Applied, thanks!


More information about the cubicweb-devel mailing list