def adjust_priority(view, context, model, name): _href = '/admin/adjust-priority?url=%s&model=%s&id=%s' % ( view.url, model.__class__.__name__, model.id ) _i = lambda icon: html.i(class_="icon %s" % icon, style="margin-right: 5px;")() return html.div()( html.a(href=_href + '&delta=-1')(_i('icon-circle-arrow-up')), html.a(href=_href + '&delta=1')(_i('icon-circle-arrow-down')), )
def format_datetime(self, request, obj, fieldname, *args, **kwargs): return html.div(style='min-width:130px;')( getattr(obj, fieldname).strftime(self.get_datetime_format()) )
def format_datetime(self, request, obj, fieldname, *args, **kwargs): return html.div(style='min-width:130px;')(getattr(obj, fieldname).strftime( self.get_datetime_format()))