Login

Snippets by arthur

Snippet List

remove the annoying "Hold down control..." messages

This function mangles a generated form class to remove the Hold down "Control", or "Command"... messages from the help text. This is really a dirty hack awaiting a proper solution to [Django ticket 9321](http://code.djangoproject.com/ticket/9321). This function can be useful for forms in the admin interface that use custom widgets. Basic usage: class MyModelForm(forms.ModelForm): class Meta: model = MyModel class MyAdmin(admin.ModelAdmin): form = remove_holddown(MyModelForm, ('field1', 'field2'))

  • admin
  • forms
  • hack
  • widget
Read More

Log username in Apache access logs

This is a piece of middleware that reports the logged-in user back to Apache. This should cause the logged-in user to be present in the apache access log. Put it in `settings.MIDDLEWARE_CLASSES` after `AuthenticationMiddleware`. This has been tested with mod_python but does [not work with wsgi](http://groups.google.com/group/modwsgi/browse_thread/thread/8785a99d4ba7ee99).

  • log
  • apache
  • mod_python
Read More

arthur has posted 2 snippets.