djangosnippets.org: Latest snippets posted by albertorcfhttps://djangosnippets.org/users/albertorcf/2012-09-05T15:02:18.391108-05:00albertorcfShow logged users - keeping track of users login and logout
2012-09-05T15:02:18.391108-05:00albertorcfhttps://djangosnippets.org/snippets/2808/<p>Showing a list of logged users using the <em>user_logged_in</em> and <em>user_logged_out</em> signals.</p>
<p>See <a href="https://docs.djangoproject.com/en/1.4/topics/auth/#login-and-logout-signals">login and logout signals</a> in Django docs.</p>
Freely redistributableFilter by taggit tags in the admin (Django 1.4)
2012-08-31T14:24:44.364995-05:00albertorcfhttps://djangosnippets.org/snippets/2807/<p>A <em>SimpleListFilter</em> derived class that can be used to filter by taggit tags in the admin.</p>
<p>To use, simply add this class to the <em>list_filter</em> attribute of your ModelAdmin class.</p>
<p>Ex.:</p>
<pre><code>class ItemAdmin(admin.ModelAdmin):
list_display = ('name', 'unit', 'amount')
list_filter = ('unit', TaggitListFilter)
</code></pre>
<p>Based in <a href="https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_filter">ModelAdmin.list_filter documentation</a>.</p>
Freely redistributable