Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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', )
Source by blog.mounirmesselmeni.de #
 
PREVIOUS NEXT
Tagged: #django #date #format
ADD COMMENT
Topic
Name
5+8 =