Task #1578
closedIncoming searches should be translated by the model
0%
Description
Due to the mongoengine conversion, some database field names had to change, including most fields called "id". Therefore, incoming search criteria objects must be translated from the old field names (to maintain backwards compatibility of the REST api) to the new field names so they can be used to search the database. Currently, this process is done generally in the ModelSerializer class; however, each collection is different enough that translating generally is problematic and full of edge cases.
A function to translate criteria should be defined on each model that has exposed search API endpoint.
Translation should be removed from the custom queryset and should instead be called by the generic search view.
https://github.com/pulp/pulp/blob/a0e637e004518d65ce6374f615ed45c991b12234/server/pulp/server/db/querysets.py#L56
Related issues
Updated by amacdona@redhat.com almost 9 years ago
- Related to Refactor #1555: ModelSerializer translate functions should be public added
Updated by amacdona@redhat.com almost 9 years ago
- Related to Issue #1503: remove Criteria import from serializers added
Updated by amacdona@redhat.com almost 9 years ago
- Related to Issue #1563: Content type ID searches not working added
Updated by amacdona@redhat.com almost 9 years ago
- Related to Issue #1574: These Content type ID searches not working added
Updated by semyers almost 9 years ago
- Related to Issue #1590: Criteria object needs to be updated for use with pymongo 3 added
Updated by bmbouter over 5 years ago
- Status changed from NEW to CLOSED - WONTFIX
Updated by bmbouter over 5 years ago
Pulp 2 is approaching maintenance mode, and this Pulp 2 ticket is not being actively worked on. As such, it is being closed as WONTFIX. Pulp 2 is still accepting contributions though, so if you want to contribute a fix for this ticket, please reopen or comment on it. If you don't have permissions to reopen this ticket, or you want to discuss an issue, please reach out via the developer mailing list.