Skip to content

Commit

Permalink
Prepend Content model hierarchy with _
Browse files Browse the repository at this point in the history
Prepend all pulpcore model fields in the Content model hierarchy with _
and do the same for all plugins reliant on them.

Required PR: pulp/pulp#3798

re #4206
https://pulp.plan.io/issues/4206
  • Loading branch information
CodeHeeler committed Jan 3, 2019
1 parent f251566 commit f6c14a6
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 7 deletions.
2 changes: 0 additions & 2 deletions .travis/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ flake8 --config flake8.cfg || exit 1
# Run migrations.
export DJANGO_SETTINGS_MODULE=pulpcore.app.settings
export PULP_CONTENT_HOST=localhost:8080
pulp-manager migrate auth --noinput
pulp-manager makemigrations pulp_app --noinput
pulp-manager makemigrations pulp_python
pulp-manager migrate --noinput

Expand Down
2 changes: 1 addition & 1 deletion pulp_python/app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def artifact(self):
"""
Return the artifact id (there is only one for this content type).
"""
return self.artifacts.get().pk
return self._artifacts.get().pk

def __str__(self):
"""
Expand Down
4 changes: 2 additions & 2 deletions pulp_python/app/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def create(self, validated_data):
return PythonPackageContent

class Meta:
fields = tuple(set(core_serializers.ContentSerializer.Meta.fields) - {'artifacts'}) + (
fields = tuple(set(core_serializers.ContentSerializer.Meta.fields) - {'_artifacts'}) + (
'filename', 'packagetype', 'name', 'version', 'metadata_version', 'summary',
'description', 'keywords', 'home_page', 'download_url', 'author', 'author_email',
'maintainer', 'maintainer_email', 'license', 'requires_python', 'project_url',
Expand All @@ -239,7 +239,7 @@ class MinimalPythonPackageContentSerializer(PythonPackageContentSerializer):
"""

class Meta:
fields = tuple(set(core_serializers.ContentSerializer.Meta.fields) - {'artifacts'}) + (
fields = tuple(set(core_serializers.ContentSerializer.Meta.fields) - {'_artifacts'}) + (
'filename', 'packagetype', 'name', 'version', 'artifact'
)
model = python_models.PythonPackageContent
Expand Down
1 change: 0 additions & 1 deletion pulp_python/app/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class PythonPackageContentFilter(platform.ContentFilter):
class Meta:
model = python_models.PythonPackageContent
fields = {
'type': ['exact', 'in'],
'name': ['exact', 'in'],
'author': ['exact', 'in'],
'packagetype': ['exact', 'in'],
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from setuptools import setup, find_packages

requirements = [
'pulpcore-plugin==0.1.0b14',
'pulpcore-plugin==0.1.0b16',
'pkginfo',
'packaging',
]
Expand Down

0 comments on commit f6c14a6

Please sign in to comment.