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