Task #2298
closedTask #1873: Plan REST API for 3.0
Add serializer for the repository models.
100%
Description
Write a serializer for each model in repository.py.
Related issues
Updated by jortel@redhat.com about 8 years ago
- Copied to Task #2299: Add serializer for the content models. added
Updated by amacdona@redhat.com about 8 years ago
- Blocks Task #2310: Add a Publisher ViewSet added
Updated by amacdona@redhat.com about 8 years ago
- Blocks Task #2309: Add a Importer ViewSet added
Updated by amacdona@redhat.com about 8 years ago
- Blocks Task #2308: Add a RepositoryGroup ViewSet added
Updated by amacdona@redhat.com about 8 years ago
- Blocks Task #2307: Add a Repository ViewSet added
Updated by semyers about 8 years ago
This task cannot be started until the documentation written in #1873 is merged to 3.0-dev.
Updated by semyers about 8 years ago
This task should be considered complete when all serializers for a given models module are defined in a corresponding serializers module.
The serializers defined should expose fields "native" (defined directly on a model or in its superclasses) to the model being represented, including Generic Key/Value types (Config/Notes/Scratchpad). Relations to other models should be included where possible, but the available serializer base classes and fields may be insufficient, so only the "native" fields should be required.
This task is among several similar tasks to stub out serializers for our existing models. Please spread the work around so we gain more team-wide knowledge around these serializers. If you have any questions, ask me. Common issues and their resolutions will be added to the pulp 3.0 rest-api development guide.
Updated by amacdona@redhat.com about 8 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to amacdona@redhat.com
Added by Austin Macdonald about 8 years ago
Added by Austin Macdonald about 8 years ago
Revision 4ff2756e | View on GitHub
Finish Repository serializer
Add remaining fields and move fiter_fields back to ViewSet.
closes #2298
Updated by amacdona@redhat.com about 8 years ago
- Status changed from ASSIGNED to POST
Updated by Anonymous about 8 years ago
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
Applied in changeset pulp|4ff2756e1de7a66ac303747a2b34bcdd9cd230f9.
Updated by amacdona@redhat.com about 8 years ago
- Status changed from MODIFIED to ASSIGNED
PR was only for repository model, the story is for all models in the repos module, resetting to assigned.
Updated by jortel@redhat.com about 8 years ago
- Sprint/Milestone changed from 27 to 28
Updated by ttereshc about 8 years ago
Is the following correct?
- We do not need serializer for ContentAdaptor model because its fields will be serialized in Importer/Publisher serializers.
- We do not need serializer for RepositoryContent model because we won't access this model directly, it is a through model. We are going to set relations specified in it via ContentViewset and read this info via RepositoryViewset or ContentViewset.
Updated by semyers about 8 years ago
ttereshc wrote:
Is the following correct?
- We do not need serializer for ContentAdaptor model because its fields will be serialized in Importer/Publisher serializers.
Maybe true! If it's useful to create an abstract ContentAdaptor to define the fields that should be included on all Model subclasses, though, then it makes sense to create a similar serializer that only gets used abstractly by all ContentAdaptorSerializer subclasses. Since all ContentAdaptors have at least a name and 0 or more related repositories, I think it may be worthwhile to have a ContentAdaptorSerializer.
- We do not need serializer for RepositoryContent model because we won't access this model directly, it is a through model. We are going to set relations specified in it via ContentViewset and read this info via RepositoryViewset or ContentViewset.
I'm not really sure how best to handle this. I have some ideas, I think Austin has some other ideas, but I think the best thing right now might be to leave it out, and figure out how to work in the timestamp stored on this through model later. From an API standpoint, I think we definitely want to be able to filter repository content by this timestamp, and we'll definitely want to include it in some view, somewhere. I'm just not sure about the specifics, and think this is an easy enough one to do that we can avoid having to do it right now.
Updated by ttereshc about 8 years ago
Since all ContentAdaptors have at least a name and 0 or more related repositories, I think it may be worthwhile to have a ContentAdaptorSerializer.
I agreed initially but now I am thinking that maybe it makes sense to have those common fields specified in each ContentAdaptor, this way we will be able to be more specific in the `help_text`: "name of the importer" or "name of the publisher" rather than just "name of the content adaptor". So I will leave this one as well. It should be very easy to create it and refactor importer/publisher later if needed.
Updated by ttereshc about 8 years ago
- Status changed from ASSIGNED to POST
Importer serializer https://github.com/pulp/pulp/pull/2806
Publisher serializer https://github.com/pulp/pulp/pull/2808
RepositoryGroup serializer https://github.com/pulp/pulp/pull/2813
Added by ttereshc about 8 years ago
Revision a7979bae | View on GitHub
Add RepositoryGroup serializer
Added by ttereshc about 8 years ago
Revision a7979bae | View on GitHub
Add RepositoryGroup serializer
Added by Austin Macdonald almost 8 years ago
Revision c7b871bc | View on GitHub
Add remaining fields to Importer Serializer
re #2298
Added by Austin Macdonald almost 8 years ago
Revision c7b871bc | View on GitHub
Add remaining fields to Importer Serializer
re #2298
Updated by amacdona@redhat.com almost 8 years ago
- Status changed from POST to MODIFIED
- Platform Release set to 3.0.0
Updated by bmbouter almost 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Finish Repository serializer
Add remaining fields and move fiter_fields back to ViewSet.
closes #2298