Skip to content

Commit

Permalink
Merge pull request #5 from watchdogpolska/task_log
Browse files Browse the repository at this point in the history
v1.3.02
  • Loading branch information
PiotrIw authored Jun 20, 2024
2 parents 43da1ba + 044c64b commit a0dbad8
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[bumpversion]
commit = True
tag = True
current_version = 1.3.01
current_version = 1.3.02
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+))?
serialize =
{major}.{minor}.{patch}-{release}
Expand Down
2 changes: 1 addition & 1 deletion background_task/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
__version__ = "1.3.01"
__version__ = "1.3.02"

default_app_config = "background_task.apps.BackgroundTasksAppConfig"

Expand Down
45 changes: 39 additions & 6 deletions background_task/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,57 @@ def inc_priority(modeladmin, request, queryset):
for obj in queryset:
obj.priority += 1
obj.save()


inc_priority.short_description = "priority += 1"


def dec_priority(modeladmin, request, queryset):
for obj in queryset:
obj.priority -= 1
obj.save()


dec_priority.short_description = "priority -= 1"


class TaskAdmin(admin.ModelAdmin):
display_filter = ['task_name']
search_fields = ['task_name', 'task_params', ]
list_display = ['task_name', 'task_params', 'run_at', 'priority', 'attempts', 'has_error', 'locked_by', 'locked_by_pid_running', ]
display_filter = ["task_name"]
search_fields = [
"task_name",
"task_params",
]
list_display = [
"task_name",
"task_params",
"run_at",
"priority",
"attempts",
"has_error",
"locked_by",
"locked_by_pid_running",
]
actions = [inc_priority, dec_priority]
list_filter = ["task_name", "has_error", "attempts", "priority"]


class CompletedTaskAdmin(admin.ModelAdmin):
display_filter = ['task_name']
search_fields = ['task_name', 'task_params', ]
list_display = ['task_name', 'task_params', 'run_at', 'priority', 'attempts', 'has_error', 'locked_by', 'locked_by_pid_running', ]
display_filter = ["task_name"]
search_fields = [
"task_name",
"task_params",
]
list_display = [
"task_name",
"task_params",
"run_at",
"priority",
"attempts",
"has_error",
"locked_by",
"locked_by_pid_running",
]
list_filter = ["task_name", "has_error", "attempts", "priority"]


admin.site.register(Task, TaskAdmin)
Expand Down

0 comments on commit a0dbad8

Please sign in to comment.