示例#1
0
	def timesince(self, now=None):
		from django.utils.timesince import timesince as timesince_

		time_now = datetime.now()
		time_elapsed = timesince_(self.created, now).split(', ')[0]
		
		return time_elapsed
示例#2
0
 def timesince(self, now=None):
     """
     Shortcut for the ``django.utils.timesince.timesince`` function of the
     current timestamp.
     """
     from django.utils.timesince import timesince as timesince_
     return timesince_(self.timestamp, now)
示例#3
0
文件: models.py 项目: dithua/collato
 def timesince(self, now=None):
     """
     Shortcut for the ``django.utils.timesince.timesince`` function of the
     current timestamp.
     """
     from django.utils.timesince import timesince as timesince_
     return timesince_(self.timestamp, now)
    def timesince(self, now=None):
        """
        Returns time since comment was made.

        :param now: baseline datetime instance.
        :rtype: str.
        """
        from django.utils.timesince import timesince as timesince_
        return timesince_(self.created, now)
    def timesince(self, now=None):
        """
        Returns time since activity occured as a string.

        :param now: baseline datetime instance.
        :rtype: str.
        """
        from django.utils.timesince import timesince as timesince_
        return timesince_(self.created, now)
示例#6
0
 def timesince(self, current_time=None):
     """
     src: https://github.com/django-notifications/django-notifications/blob/master/notifications/models.py
     Shortcut for the ``django.utils.timesince.timesince`` function of the
     current timestamp.
     """
     if now is None:
         current_time = datetime.now()
     return timesince_(self.created, current_time)
示例#7
0
文件: models.py 项目: sull/noddymix
 def timesince(self, now=None):
     """
     Description: Get time since this activity instance was created.
                  Effectively a shortcut for django.utils.timesince.timesince
                
     Arguments:   - now: datetime.datetime instance to start time comparison
     Return:     (str) nicely formatted time e.g. "10 minutes"
     
     Author:      Nnoduka Eruchalu
     """
     from django.utils.timesince import timesince as timesince_
     return timesince_(self.date_added, now)
示例#8
0
 def timesince(self, now=None):
     """
     Description: Get time since this activity instance was created.
                  Effectively a shortcut for django.utils.timesince.timesince
                
     Arguments:   - now: datetime.datetime instance to start time comparison
     Return:     (str) nicely formatted time e.g. "10 minutes"
     
     Author:      Nnoduka Eruchalu
     """
     from django.utils.timesince import timesince as timesince_
     return timesince_(self.date_added, now)
示例#9
0
	def subtribe_audio_project_timesince(self, now=None):
		time_now = datetime.now()
		time_elapsed = timesince_(self.created, now).split(', ')[0]
		
		return time_elapsed
示例#10
0
	def audio_inspiration_timesince(self, now=None):
		time_now = datetime.now()
		time_elapsed = timesince_(self.created, now).split(', ')[0]
		
		return time_elapsed
示例#11
0
	def comment_timesince(self, now=None):
		time_now = datetime.now()
		time_elapsed = timesince_(self.created, now).split(', ')[0]
		
		return time_elapsed
示例#12
0
 def timesince(self, now=None):
     from django.utils.timesince import timesince as timesince_
     return timesince_(self.timestamp, now)
示例#13
0
文件: models.py 项目: guoku/guoku-sns
 def timesince(self, now=None):
     from django.utils.timesince import timesince as timesince_
     return timesince_(self.timestamp, now)
示例#14
0
 def timesince(self, now=None):
     return timesince_(self.timestamp, now)
示例#15
0
 def timesince(self, now=None):
     """
     Shortcut for the ``django.utils.timesince.timesince`` function of created.
     """
     from django.utils.timesince import timesince as timesince_
     return timesince_(self.created, now)
示例#16
0
文件: models.py 项目: GuanchengFu/fyp
 def timesince(self, now=None):
     """
     Return the time from timestamp to now.
     """
     from django.utils.timesince import timesince as timesince_
     return timesince_(self.timestamp, now)
示例#17
0
	def project_timesince(self, now=None):
		from datetime import datetime, timedelta
		time_now = datetime.now()
		time_elapsed = timesince_(self.created, now).split(', ')[0]
		
		return time_elapsed