Last active
March 5, 2021 16:23
-
-
Save Allwin12/2a7d59cde964565bb67f29cadae85ce2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import timedelta | |
from django.contrib import admin | |
from myapp.models import CronTask | |
class CronTaskAdmin(admin.ModelAdmin): | |
list_display = ['name', 'get_ist'] | |
list_filter = ['name'] | |
def get_ist(self, obj): | |
return obj.time + timedelta(minutes=330) | |
get_ist.short_description = 'Time in (IST)' | |
admin.site.register(CronTask, CronTaskAdmin) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment