django-seconds-field

Store a number of seconds in Django model


Keywords
django, model, field, duration, seconds
License
Other
Install
pip install django-seconds-field==0.1.0

Documentation

https://travis-ci.org/dex4er/django-seconds-field.svg?branch=master https://readthedocs.org/projects/django-seconds-field/badge/?version=latest

django-seconds-field

django-seconds-field provides additional SecondsField type for Django model which stores datetime.timedelta object as a number of seconds in a database's INTEGER type.

Installation

Install with pip or pipenv:

pip install django-seconds-field

Usage

models.py

from django.db import models
from django_seconds_field import SecondsField

class FooBar(models.Model):
    ttl = SecondsField()

Documentation

See http://django-seconds-field.readthedocs.org/

License

Copyright © 2019, Piotr Roszatycki

This software is distributed under the GNU Lesser General Public License (LGPL 3 or greater).