I am trying to convert a decimal value from my Django model into a time format of MM:SS:MS.
For example: 97.13 as a decimal value would become 01:37:13.
Is there any easy way to implement this with a raw SQL query in Django? Lets say I have this raw query:
example = Example.objects.raw("""SELECT x.id, x.time FROM your_Table x WHERE x.id = %s""", [id])
Would it be better to execute the raw query and manipulate it in Python? How would I go about that? Could I loop the values e.g.?
for examples in example:
formatted_time = function(examples.time)
Ultimately I'd like to pass my example object (with converted time) to my template.
Thanks in advance.