Login

Snippets by timbroder

Snippet List

Get admin url for a model

Add this to your model to be able to get their admin change link from anywhere Useful if you want to jump to the admin screen of an object you are looking at on the front end

  • admin
  • url
Read More

Django Admin inline preview

Extend this ModelAdmin to get dynamic inline previews in the list admin also lives here: [http://github.com/broderboy/django-admin-preview](http://github.com/broderboy/django-admin-preview)

  • admin
  • jquery
Read More

Remaining character count in django admin

Want to display the remaining characters on a text field in admin? (based off of maxlength or an override) also lives here: [http://github.com/broderboy/django-admin-remainingcharacters](http://github.com/broderboy/django-admin-remainingcharacters)

  • admin
  • jqeury
  • charactercount
Read More

Override QuerySet.delete() (one way of preventing cascading deletes)

We needed to override the default QuerySet delete function to deal with a client problem that we were facing Yes This is monkey-patching, and probably bad practice but if anyone needs to conditionally override the cascading delete that django does at the application level from a queryset, this is how to do it

  • queryset
  • delete
  • monkey-patch
Read More

timbroder has posted 6 snippets.