Actions
Story #6500
closedAdd modelresource to plugin-template
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
It would be good for the plugin-template to include creating a /app/modelresource.py file to help plugin authors play the import/export game. Such a modelresource would have a class defined for everything in models.py or models/, using the following template:
from pulpcore.app.modelresource import QueryModelResource
from PLUGIN.app.models import (
<list models here>,
)
class MODELResource(QueryModelResource):
"""
Resource for import/export of plugin-type_modelname entities.
"""
def set_up_queryset(self):
"""
:return: MODELs specific to a specified repo-version.
"""
return MODEL.objects.filter(pk__in=self.repo_version.content)
class Meta:
model = MODEL
IMPORT_ORDER = [
MODEL-list-in-alfa-order,
]
Updated by dkliban@redhat.com over 3 years ago
- Status changed from NEW to CLOSED - WONTFIX
We will not get to this any time soon. Let's revisit when we have time.
Actions