mirror of
https://github.com/Hopiu/django-notifications.git
synced 2026-04-19 04:31:03 +00:00
Added docstring for humanize_timestamp method
This commit is contained in:
parent
6faecf5396
commit
8d76da3ff0
1 changed files with 4 additions and 2 deletions
|
|
@ -255,10 +255,12 @@ class Notification(models.Model):
|
|||
|
||||
return timesince_(self.timestamp, now)
|
||||
|
||||
def humanize_timestamp(self, humanize_type):
|
||||
def humanize_timestamp(self, humanize_type='naturalday'):
|
||||
"""
|
||||
Shortcut for the ``humanize``.
|
||||
Return ``today``, ``yesterday``etc.
|
||||
Take a parameter humanize_type. This parameter control the which humanize method use.
|
||||
|
||||
Return ``today``, ``yesterday`` ,``now``, ``2 seconds ago``etc.
|
||||
"""
|
||||
if humanize_type == 'naturalday':
|
||||
from django.contrib.humanize.templatetags.humanize import naturalday
|
||||
|
|
|
|||
Loading…
Reference in a new issue