Login

Snippets by LLyaudet

Snippet List

Generate and render HTML Table

A set of classes that enables fast and flexible generation of HTML tables from columns definitions and datasets. With classes arguments, it is easy to style it with bootstrap for example.

  • Table
  • HTML
  • Python rendering
Read More

LazyPrimaryKeyRelatedField

When you change dynamicaly the objects manager on your Model class, you may want to have serializers take it into account.

  • DRF
  • PrimaryKeyRelatedField
Read More

CacheInDictManager

This manager use a local (in python dicts) cache for efficiency. It caches get requests and is better used with a context manager. I based my work on this previous snippet : https://djangosnippets.org/snippets/815/

  • caching
  • Django Manager
Read More

EnhancedQuerySet

A proxy for Django queryset attempting to avoid boilerplate code with ifs and avoid bugs when affectation of result is not done.

  • django query set
  • IGNORE_FILTER
Read More

Work around for negation of Q filter

It may save you some time if you're in the case of this link : https://stackoverflow.com/questions/11801363/django-q-with-joins-functioning-incorrectly-bug It worked for me at least.

  • negation
  • Q filter
Read More

LLyaudet has posted 5 snippets.