Skip to content

Instantly share code, notes, and snippets.

@Allwin12
Last active March 5, 2021 16:23
Show Gist options
  • Save Allwin12/2a7d59cde964565bb67f29cadae85ce2 to your computer and use it in GitHub Desktop.
Save Allwin12/2a7d59cde964565bb67f29cadae85ce2 to your computer and use it in GitHub Desktop.
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