Try setting the current time in the table's __init__
method. Then self.current_Time
will be set each time the table is initiated, rather than when the table is defined.
class PostTable(tables.Table):
def __init__(self, *args, **kwargs):
super(PostTable, self).__init__(*args, **kwargs)
self.current_Time = datetime.utcnow().replace(tzinfo=utc)
def render_published(self, value,record):
tdelta = self.current_Time - record.published