Groups
Groups
Sign in
Groups
Groups
Django users
Conversations
About
Send feedback
Help
Time duration in django models
1,596 views
Skip to first unread message
Mohamed Ghoneim
unread,
Aug 9, 2011, 6:32:53 AM
8/9/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
Hey guys,
I am just wondering if there is a time duration field in django models.
what I want to do is a field that takes a time duration in days, hours, mins, seconds and store it into the database.
--
Mohamed Sayed Ghoneim
Scott Gould
unread,
Aug 9, 2011, 8:20:53 AM
8/9/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
Nothing native. I'd store it in seconds, as an int, and let the model
convert to and from a timedelta. Looks like there's a snippet all
ready to go:
http://djangosnippets.org/snippets/1060/
Reply all
Reply to author
Forward
0 new messages