mirror of
https://github.com/fergalmoran/dss.api.git
synced 2025-12-25 10:49:16 +00:00
14 lines
489 B
Python
Executable File
14 lines
489 B
Python
Executable File
import humanize
|
|
from django.core.management.base import NoArgsCommand
|
|
from spa.models.activity import Activity
|
|
|
|
|
|
class Command(NoArgsCommand):
|
|
def handle_noargs(self, **options):
|
|
try:
|
|
activity = Activity.objects.get(pk=13437)
|
|
if activity is not None:
|
|
date = humanize.naturaltime(activity.date.replace(tzinfo=None))
|
|
print date
|
|
except Exception, ex:
|
|
print "Debug exception: %s" % ex.message |