Snippet List
A FileField Widget that displays an image instead of a file path if the current file is an image. Could also be used with sorl.thumbnail to generate thumbnail images.
**Example**
class FileUploadForm(forms.ModelForm):
upload = forms.FileField(widget=AdminThumbnailWidget)
class Meta:
model = FileUpload
class FileUploadAdmin(admin.ModelAdmin):
form = FileUploadForm
admin.site.register(FileUpload, FileUploadAdmin)
- image
- newforms-admin
- widget
- file
- nfa
Add-on for auth app of newforms-admin branch, adding more information about users and their groups at user and group list in admin interface. Also, nice example on customization of contributed django admin apps.
It adds the following to the user list interface: fields for is_superuser and is_staff, last login time; by default, short names of groups user is in (mousehover to see full names)
It adds the following to the to group list interface: list of users in your groups.
To enable, just put it somewhere and import it from your main urls.py:
import useradmin
- admin
- newforms-admin
- customization
- users
- groups
- roles
- information
- nfa
- supervising
2 snippets posted so far.