Files
postgres-web/pgweb/util/widgets.py
Magnus Hagander e850a9bf3e Show community account last login and count info on admin page
The collection facility was added in
[200~9e70a4e0c32f8db0178f05dac4c1fca7b317e7c5, but no way was added to
view it. To make it a  bit more useful, add a static set of info on the
user edit page in /admin/ that shows the last login and number of logins
per site.
2020-07-07 12:25:39 +02:00

13 lines
351 B
Python

from django.forms.widgets import Widget
class TemplateRenderWidget(Widget):
def __init__(self, *args, **kwargs):
self.template_name = kwargs.pop('template')
self.templatecontext = kwargs.pop('context')
super().__init__(*args, **kwargs)
def get_context(self, name, value, attrs):
return self.templatecontext