Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@aliases endpoint should support filtering by date (from, to) #1792

Open
tisto opened this issue Jun 15, 2024 · 4 comments
Open

@aliases endpoint should support filtering by date (from, to) #1792

tisto opened this issue Jun 15, 2024 · 4 comments
Assignees

Comments

@tisto
Copy link
Member

tisto commented Jun 15, 2024

PR for adding aliases: #1398

The @Aliases endpoint allows to filter by path:

http://localhost:8080/Plone/++api++/@aliases&q=/de/ft/my-path

However, there is no way to filter by a date range. This is something the ClassicUI controlpanel allows. I propose to add two new parameters (from, to) to be able to filter for a date range:

http://localhost:8080/Plone/++api++/@aliases&q=/de/ft/my-path&from=2021-11-04&to=2022-01-01

@stevepiercy
Copy link
Contributor

For new parameter names, Plone REST API uses start and end attributes for event content types, instead of from and to.

https://6.docs.plone.org/plone.restapi/docs/source/endpoints/content-types.html#event

I don't feel strongly about parameter names, but I think consistency is helpful.

@tisto
Copy link
Member Author

tisto commented Jun 15, 2024

@stevepiercy good point! Consistency is indeed crucial. I was under the assumption that plone.app.querystring and zcatalog use from/to. Seems ZCatalog uses just a query tuple without specifying a name for those parameters though.

However, I am not sure if the Event content type is sufficient for the argument. Those are attributes of the Event content type in Plone not necessarily the way date ranges are queried.

In any case. I am undecided and would appreciate more people to chime in. @davisagli @thet @sneridagh maybe?

@stevepiercy
Copy link
Contributor

Indeed, there may be many instances of date range parameters, and I lack familiarity with the code base to be authoritative. Someone with more familiarity than I should chime in.

Also hopefully interpretation of the two date parameters would allow the omission of one or the other parameter, effectively allowing a minimum or maximum date without an upper or lower bound.

@Faakhir30
Copy link
Contributor

I see that these start and end filter params are not supported by RedirectControlPanal in plone/ProductCMFPlone.

Another solution could be dealing with this filtering in plone.restapi directly once we get a response from RedirectControlPanel, but as other params like query are being dealt with in Products.CMFPlone, so I'll be adding there first, then will integrate these params here in plone.restapi also.

I am open to suggestions. Thanks, @tisto @stevepiercy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants