Project

Profile

Help

Task #1578

closed

Incoming searches should be translated by the model

Added by amacdona@redhat.com about 8 years ago. Updated almost 5 years ago.

Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

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

Related to Pulp - Refactor #1555: ModelSerializer translate functions should be publicCLOSED - CURRENTRELEASEsemyers

Actions
Related to Pulp - Issue #1503: remove Criteria import from serializersCLOSED - WONTFIXActions
Related to Pulp - Issue #1563: Content type ID searches not workingCLOSED - CURRENTRELEASEsemyersActions
Related to Pulp - Issue #1574: These Content type ID searches not workingCLOSED - CURRENTRELEASEamacdona@redhat.comActions
Related to Pulp - Issue #1590: Criteria object needs to be updated for use with pymongo 3CLOSED - CURRENTRELEASEpcreechActions

Also available in: Atom PDF