Patch GopipIndex to sort objects by ‘global’ position
By default, Plone GopipIndex (Get object position in parent Index) sorts results only by objects order in their own folder.
While this works for the most common use cases, the resulting order may look weird if it contains results from multiple folders:
>>> pc = layer['portal']['portal_catalog'] >>> [brain.getPath() for brain in pc(sort_on='getObjPositionInParent')] ['/plone/a/a1', '/plone/b/b1', '/plone/a/a2', '/plone/b/b2', '/plone/a/a3', '/plone/b/b3', '/plone/a', '/plone/b']
This package patches the results to be sorted as follows:
>>> layer['patch']() >>> pc = layer['portal']['portal_catalog'] >>> [brain.getPath() for brain in pc(sort_on='getObjPositionInParent')] ['/plone/a', '/plone/b', '/plone/a/a1', '/plone/a/a2', '/plone/a/a3', '/plone/b/b1', '/plone/b/b2', '/plone/b/b3']
This package may affect the performance of sorting by getObjPositionInParent.
Changelog
1.0.0 (2015-01-07)
First release.
Metadata
Release files for experimental.globalgopipindex 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| experimental.globalgopipindex-1.0.0.zip | 12.6 kB | Without provenance | Details for experimental.globalgopipindex-1.0.0.zip |
Release files / experimental.globalgopipindex-1.0.0.zip
| Download URL | experimental.globalgopipindex-1.0.0.zip |
|---|---|
| Size | 12.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
057722982df5486760d1a5b10cc4e9ef49150525e0dacfb35b3c5b0fb4e78530
|
|
BLAKE2b-256 checksum How to use checksums |
3efbf9bad16e9791c4ed47ac0c07f7e3920d80138f927021234a123f32b5924a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for experimental.globalgopipindex 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.