def announcement(context): try: date_str = unquote(context['request'].COOKIES.get(Announcement.hide_cookie_name)) hidden_date = datetime.strptime(date_str, Announcement.cookie_date_format) except (ValueError, TypeError, AttributeError): hidden_date = None return { 'obj': Announcement.last(hidden_date), 'cookie_name': Announcement.hide_cookie_name, 'date': datetime.now().strftime(Announcement.cookie_date_format) }
def announcement(context): try: date_str = unquote(context['request'].COOKIES.get( Announcement.hide_cookie_name)) hidden_date = datetime.strptime(date_str, Announcement.cookie_date_format) except (ValueError, TypeError, AttributeError): hidden_date = None return { 'obj': Announcement.last(hidden_date), 'cookie_name': Announcement.hide_cookie_name, 'date': datetime.now().strftime(Announcement.cookie_date_format) }
def new_announcement(context): return { 'announcement': Announcement.last(), 'add_content_class': True, }
def announcement(context): return { 'announcement': Announcement.last(), 'add_content_class': False, }
def futureui_announcement(): return { 'announcement': Announcement.last(), }
def announcement(): return { 'obj': Announcement.last() }