Skip to content

Instantly share code, notes, and snippets.

Avatar

Evgeny Denisov eIGato

View GitHub Profile
View models.py
from django.db import models
class AnnotateByMixin():
"""Mixin that allows adding predefined annotations to queryset.
Example:
class DialogQuerySet(AnnotateByMixin, models.QuerySet):
predefined_annotations = {