Skip to content

Commit

Permalink
Merge pull request #30 from GESIS-Methods-Hub/improve-admin
Browse files Browse the repository at this point in the history
Add bulk actions to admin interface
  • Loading branch information
rgaiacs committed Aug 21, 2023
2 parents dd3dcb0 + 2a5a0ae commit 0b5b497
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
2 changes: 1 addition & 1 deletion andrew/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.5.2"
__version__ = "1.6.0"
2 changes: 1 addition & 1 deletion cms/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.5.2"
__version__ = "1.6.0"
23 changes: 21 additions & 2 deletions cms/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,24 @@

from .models import Collection, Content

admin.site.register(Collection)
admin.site.register(Content)

@admin.register(Collection)
class CollectionAdmin(admin.ModelAdmin):
list_display = ("__str__", "abstract")
list_filter = ("parent_collection", )


@admin.action(description='Enable Content',)
def enable_content(modeladmin, request, queryset):
queryset.update(enable = True)

@admin.action(description='Disable Content',)
def diseble_content(modeladmin, request, queryset):
queryset.update(enable = False)

@admin.register(Content)
class ContentAdmin(admin.ModelAdmin):
list_display = ("web_address", "filename")
list_filter = ("collection", )

actions = (enable_content, diseble_content)
4 changes: 2 additions & 2 deletions helm/andrew-django-admin/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.5.2
version: 1.6.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.5.2"
appVersion: "1.6.0"

0 comments on commit 0b5b497

Please sign in to comment.