Answers for "django admin.py date format"

0

django admin.py date format

def time_seconds(self, obj):
        return obj.timefield.strftime("%d %b %Y %H:%M:%S")

    time_seconds.short_description = 'Precise Time'    

    list_display = ('id', 'time_seconds', )
Posted by: Guest on November-21-2020

Python Answers by Framework

Browse Popular Code Answers by Language