Esempio n. 1
0
 def get_timeuntil(self, obj=None):
     if not obj or not obj.id or not obj.next_run:
         return ''
     fmt = get_format('DATETIME_FORMAT')
     dt = obj.next_run
     dt = utils.localtime(dt)
     value = capfirst(dateformat.format(dt, fmt))
     return "%s<br /><span class='mini'>(%s)</span>" % (value, obj.get_timeuntil())
Esempio n. 2
0
 def get_timeuntil(self, obj=None):
     if not obj or not obj.id or not obj.next_run:
         return ''
     fmt = get_format('DATETIME_FORMAT')
     dt = obj.next_run
     dt = utils.localtime(dt)
     value = capfirst(dateformat.format(dt, fmt))
     return format_html("%s<br /><span class='mini'>(%s)</span>" % (value, obj.get_timeuntil()))
Esempio n. 3
0
 def last_run_with_link(self, obj=None):
     if not obj or not obj.id:
         return ''
     fmt = get_format('DATETIME_FORMAT')
     value = None
     try:
         if obj.last_run is not None:
             value = utils.localtime(obj.last_run)
             value = capfirst(dateformat.format(value, fmt))
         log_id = obj.log_set.latest('run_start_datetime').id
         try:
             # Old way
             u = reverse('chroniker_log_change', args=(log_id, ))
         except NoReverseMatch:
             # New way
             u = reverse('admin:chroniker_log_change', args=(log_id, ))
         return '<a href="%s">%s</a>' % (u, value)
     except Exception:
         return value
Esempio n. 4
0
 def last_run_with_link(self, obj=None):
     if not obj or not obj.id:
         return ''
     format = get_format('DATETIME_FORMAT')
     value = None
     try:
         if obj.last_run is not None:
             value = utils.localtime(obj.last_run)
             value = capfirst(dateformat.format(value, format))
         log_id = obj.log_set.latest('run_start_datetime').id
         try:
             # Old way
             url = reverse('chroniker_log_change', args=(log_id,))
         except NoReverseMatch:
             # New way
             url = reverse('admin:chroniker_log_change', args=(log_id,))
         return '<a href="%s">%s</a>' % (url, value)
     except:
         return value
Esempio n. 5
0
 def get_timeuntil(self, obj):
     fmt = get_format('DATETIME_FORMAT')
     next_run = obj.next_run or timezone.now()
     value = capfirst(dateformat.format(utils.localtime(next_run), fmt))
     return "%s<br /><span class='mini'>(%s)</span>" % (value,
                                                        obj.get_timeuntil())
Esempio n. 6
0
 def get_timeuntil(self, obj):
     format = get_format('DATETIME_FORMAT')
     value = capfirst(dateformat.format(utils.localtime(obj.next_run), format))
     return "%s<br /><span class='mini'>(%s)</span>" \
         % (value, obj.get_timeuntil())
Esempio n. 7
0
 def get_timeuntil(self, obj):
     format = get_format('DATETIME_FORMAT')
     value = capfirst(
         dateformat.format(utils.localtime(obj.next_run), format))
     return "%s<br /><span class='mini'>(%s)</span>" \
         % (value, obj.get_timeuntil())
Esempio n. 8
0
 def get_timeuntil(self, obj):
     fmt = get_format('DATETIME_FORMAT')
     next_run = obj.next_run or timezone.now()
     value = capfirst(dateformat.format(utils.localtime(next_run), fmt))
     return "%s<br /><span class='mini'>(%s)</span>" % (value, obj.get_timeuntil())