Login

Tag "fast"

Snippet List

Caching Decorator

This is a decorator which will gets Django to try the cache before computing the result of a function. It automatically builds the cache key as a hash of the function name and inputs, and allows you to set whatever timeout you want.

  • cache
  • decorator
  • speed
  • caching
  • fast
Read More

fast table flush without raw SQL

Perhaps you don't want to drop a table, but you also want to do something faster than Model.objects.all().delete() but without resorting to raw SQL. This function, clear_tables, will call the sql_flush operation on a list of tables.

  • delete
  • flush
  • fast
Read More

3 snippets posted so far.