Project

Profile

Help

Story #2672

closed

As a user, I can associate content with repositories using the content API

Added by semyers about 7 years ago. Updated about 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:
Sprint:
Quarter:

Description

Now that we've got a plugin with "real" content types (pending completion of #2454), we're able to do some tinkering around in the API to see what works and what doesn't.

So far, the only thing I've found that doesn't work via the API is attempting to associate a content unit with repositories when creating content units. The "repositories" field is current exposed and writable, but attempting to create a unit with references to repositories results in an error like this:

AttributeError at /api/v3/content/file/

Cannot set values on a ManyToManyField which specifies an intermediary model. Use pulp.RepositoryContent's Manager instead.

This is true, the addition of the "updated" timestamp field to the explicitly defined RepositoryContent model means that we lose the ability to use the 'add' and 'remove' method on the related manager:
https://docs.djangoproject.com/en/1.8/topics/db/models/#intermediary-manytomany

It would be pretty nice to be able to handle this association right on the content unit, and not have to expose RepositoryContent in the API directly, since that's an unfriendly workflow (create repo, create content, associate content with repo vs. create repo, create content associate with repo, and similar usability benefits for adding a repo to a content unit's list of repos).


Related issues

Related to Pulp - Story #2873: As an authenticated user, I can associate a Content unit with a RepositoryCLOSED - CURRENTRELEASE

Actions

Also available in: Atom PDF