mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-01 16:38:13 +08:00
feat: add ru locale and improve translations (#320)
* Add ru locale * fix * fix: remove duplicate * Add field labels and continue ru locale * fix: Add ru gettext for queue columns, short result column, and OrmQ field labels * fix: locale paths in translation files * chore: format code with ruff * chore: format code with ruff * fix: correct time_taken usage in admin Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update django_q/locale/de/LC_MESSAGES/django.po Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update django_q/locale/tr/LC_MESSAGES/django.po Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: clear fuzzy markers --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
from django.contrib import admin
|
||||
from django.db.models.expressions import OuterRef, Subquery
|
||||
from django.template.defaultfilters import truncatechars
|
||||
from django.urls import reverse
|
||||
from django.utils.html import format_html
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
@@ -60,6 +61,10 @@ class TaskAdmin(admin.ModelAdmin):
|
||||
"""Set all fields readonly."""
|
||||
return list(self.readonly_fields) + [field.name for field in obj._meta.fields]
|
||||
|
||||
@admin.display(description=_("Time Taken"))
|
||||
def time_taken(self, obj):
|
||||
return obj.time_taken()
|
||||
|
||||
|
||||
class FailAdmin(admin.ModelAdmin):
|
||||
"""model admin for failed tasks."""
|
||||
@@ -87,6 +92,10 @@ class FailAdmin(admin.ModelAdmin):
|
||||
"""Set all fields readonly."""
|
||||
return list(self.readonly_fields) + [field.name for field in obj._meta.fields]
|
||||
|
||||
@admin.display(description=_("Short result"))
|
||||
def short_result(self, obj):
|
||||
return truncatechars(obj.result, 100)
|
||||
|
||||
|
||||
class ScheduleAdmin(admin.ModelAdmin):
|
||||
"""model admin for schedules"""
|
||||
|
||||
Reference in New Issue
Block a user