Re: plone.jsonapi error?
dieter <[email protected]>
| Newsgroups | gmane.comp.web.zope.plone.user |
|---|---|
| Message-ID | <[email protected]> |
Jose Dinuncio <[email protected]> writes: > I'm testing plone.jsonapi in Plone 4.2.7, and when I try > /@@API/plone/api/1.0/folders > <http://bor.uc.edu.ve:8080/VNC/@@API/plone/api/1.0/folders> > I got an error instead of the listing: > > line 328, in get_batch > "pagesize": batch.pagesize, AttributeError: pagesize" > > In plone/jsonapi/routes/api.py: > > def get_batch(sequence, size, start=0, endpoint=None, complete=False): > """ create a batched result record out of a sequence (catalog > brains) > """ > > batch = Batch(sequence, size, start) > return { > "pagesize": batch.pagesize, > "next": make_next_url(batch), > "previous": make_prev_url(batch), > "page": batch.pagenumber, > "pages": batch.numpages, > "count": batch.sequence_length, > "items": make_items_for([b for b in batch], endpoint, > complete=complete), > } > > But, batch doesn't has pagesize, but size, or has_next or has_previous, > like make_next_url and make_previous_url require. batch has type > Products.CMFPlone.PloneBatch.Batch. Products.CMFPlone-4.2.7's Batch > inherits from ZTUtils.Batch who doesn't have these methods orattributes. When you report about errors, it is helpfull to include the precise error information (best found via the ZMI from the "error_log" object of your Plone site object). Your interpretation of the observed error indicates a version mismatch between "plone.jsonapi" and the "Batch" implementation (or a bug in "plone.jsonapi"). ------------------------------------------------------------------------------ New Year. New Location. New Benefits. New Data Center in Ashburn, VA. GigeNET is offering a free month of service with a new server in Ashburn. Choose from 2 high performing configs, both with 100TB of bandwidth. Higher redundancy.Lower latency.Increased capacity.Completely compliant. http://p.sf.net/sfu/gigenet