Skip to content

Commit

Permalink
Add additional package name filters
Browse files Browse the repository at this point in the history
fixes #909
  • Loading branch information
daviddavis committed Oct 5, 2023
1 parent ae959c5 commit 0be33a6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
2 changes: 2 additions & 0 deletions CHANGES/909.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add additional package name filters such as ``name__contains`` and ``name__startswith``.
Check the REST docs for a complete list.
41 changes: 21 additions & 20 deletions pulp_deb/app/viewsets/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from pulpcore.plugin.models import Repository, RepositoryVersion
from pulpcore.plugin.serializers.content import ValidationError
from pulpcore.plugin.viewsets import (
NAME_FILTER_OPTIONS,
ContentFilter,
ContentViewSet,
NamedModelViewSet,
Expand Down Expand Up @@ -180,26 +181,26 @@ class PackageFilter(ContentFilter):

class Meta:
model = models.Package
fields = [
"package",
"source",
"version",
"architecture",
"section",
"priority",
"origin",
"tag",
"essential",
"build_essential",
"installed_size",
"maintainer",
"original_maintainer",
"built_using",
"auto_built_package",
"multi_arch",
"sha256",
"relative_path",
]
fields = {
"package": NAME_FILTER_OPTIONS,
"source": ["exact"],
"version": ["exact"],
"architecture": ["exact"],
"section": ["exact"],
"priority": ["exact"],
"origin": ["exact"],
"tag": ["exact"],
"essential": ["exact"],
"build_essential": ["exact"],
"installed_size": ["exact"],
"maintainer": ["exact"],
"original_maintainer": ["exact"],
"built_using": ["exact"],
"auto_built_package": ["exact"],
"multi_arch": ["exact"],
"sha256": ["exact"],
"relative_path": ["exact"],
}


class PackageViewSet(SingleArtifactContentUploadViewSet):
Expand Down

0 comments on commit 0be33a6

Please sign in to comment.