Project

Profile

Help

Issue #3767

Unable to save models with relation to Content with changeset

Added by bizhang over 1 year ago. Updated 6 months ago.

Status:
CLOSED - NOTABUG
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:

Description

In python we have a relational table that maps classifiers to Python content [0]
There is no current way to create and save this Classifier model when using changesets, since changesets is the thing calling save() on the Content model.

def _build_additions(delta, remote_metadata):
    def generate():
        for entry in remote_metadata:
            classifiers = entry.pop('classifiers', [])
            artifact = models.Artifact(sha256=entry.pop('sha256_digest'))
            package = python_models.PythonPackageContent(**entry)
            content = PendingContent(
                package,
                artifacts={
                    PendingArtifact(model=artifact, url=url, relative_path=entry['filename'])
                })
            for classifier in classifiers:
                temp = python_models.Classifier(name=classifier, python_package_content=package)
                temp.save() #<----------- This doesn't work because package isn't saved yet
            yield content

[0] https://github.com/pulp/pulp_python/blob/f3e01816b7e4e63d75bfb5566a06198809cf2566/pulp_python/app/models.py#L16


Related issues

Related to Pulp - Issue #3812: Pulp3 Content models are not compatible with bulk_save CLOSED - WONTFIX Actions
Blocks Python Support - Issue #3627: As a user, sync includes classifiers NEW Actions

History

#1 Updated by bizhang over 1 year ago

  • Blocks Issue #3627: As a user, sync includes classifiers added

#2 Updated by bizhang over 1 year ago

  • Subject changed from Unable to save Content Unit related models with changeset to Unable to save models with relation to Content with changeset
  • Description updated (diff)

#3 Updated by CodeHeeler over 1 year ago

  • Triaged changed from No to Yes

This might be fixed by 3570: https://pulp.plan.io/issues/3570

#4 Updated by amacdona@redhat.com over 1 year ago

  • Related to Issue #3812: Pulp3 Content models are not compatible with bulk_save added

#5 Updated by dalley 8 months ago

  • Status changed from NEW to CLOSED - NOTABUG

Changesets are dead, long live changesets!

#6 Updated by daviddavis 6 months ago

  • Sprint/Milestone set to 3.0

#7 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3)

Please register to edit this issue

Also available in: Atom PDF