Project

Profile

Help

Task #2298

closed

Task #1873: Plan REST API for 3.0

Add serializer for the repository models.

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

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

100%

Estimated time:
Platform Release:
3.0.0
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
Sprint:
Sprint 10
Quarter:

Description

Write a serializer for each model in repository.py.


Related issues

Blocks Pulp - Task #2310: Add a Publisher ViewSetCLOSED - CURRENTRELEASEttereshc

Actions
Blocks Pulp - Task #2309: Add a Importer ViewSetCLOSED - CURRENTRELEASEipanova@redhat.com

Actions
Blocks Pulp - Task #2308: Add a RepositoryGroup ViewSetCLOSED - CURRENTRELEASEipanova@redhat.com

Actions
Blocks Pulp - Task #2307: Add a Repository ViewSetCLOSED - CURRENTRELEASEamacdona@redhat.com

Actions
Copied to Pulp - Task #2299: Add serializer for the content models.CLOSED - CURRENTRELEASEttereshc

Actions
Actions #1

Updated by jortel@redhat.com about 8 years ago

  • Copied to Task #2299: Add serializer for the content models. added
Actions #2

Updated by amacdona@redhat.com about 8 years ago

  • Blocks Task #2310: Add a Publisher ViewSet added
Actions #3

Updated by amacdona@redhat.com about 8 years ago

Actions #4

Updated by amacdona@redhat.com about 8 years ago

  • Blocks Task #2308: Add a RepositoryGroup ViewSet added
Actions #5

Updated by amacdona@redhat.com about 8 years ago

  • Blocks Task #2307: Add a Repository ViewSet added
Actions #6

Updated by amacdona@redhat.com about 8 years ago

  • Groomed changed from No to Yes
Actions #7

Updated by semyers about 8 years ago

This task cannot be started until the documentation written in #1873 is merged to 3.0-dev.

Actions #8

Updated by mhrivnak about 8 years ago

  • Sprint/Milestone set to 27
Actions #9

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.

Actions #10

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

Revision 4ff2756e | View on GitHub

Finish Repository serializer

Add remaining fields and move fiter_fields back to ViewSet.

closes #2298

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

Actions #11

Updated by amacdona@redhat.com about 8 years ago

  • Status changed from ASSIGNED to POST
Actions #12

Updated by Anonymous about 8 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100
Actions #13

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.

Actions #14

Updated by jortel@redhat.com about 8 years ago

  • Sprint/Milestone changed from 27 to 28
Actions #15

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.
Actions #16

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.

Actions #17

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.

Actions #18

Updated by ttereshc about 8 years ago

  • Status changed from ASSIGNED to POST

Added by Austin Macdonald about 8 years ago

Revision c7b871bc | View on GitHub

Add remaining fields to Importer Serializer

re #2298

Added by Austin Macdonald about 8 years ago

Revision c7b871bc | View on GitHub

Add remaining fields to Importer Serializer

re #2298

Actions #19

Updated by amacdona@redhat.com about 8 years ago

  • Status changed from POST to MODIFIED
  • Platform Release set to 3.0.0
Actions #20

Updated by bmbouter almost 7 years ago

  • Sprint set to Sprint 10
Actions #21

Updated by bmbouter almost 7 years ago

  • Sprint/Milestone deleted (28)
Actions #22

Updated by daviddavis over 5 years ago

  • Sprint/Milestone set to 3.0.0
Actions #23

Updated by bmbouter over 5 years ago

  • Tags deleted (Pulp 3)
Actions #24

Updated by bmbouter about 5 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF