Skip to content

Instantly share code, notes, and snippets.

@kyle-eshares
Created June 27, 2016 23:02
Show Gist options
  • Save kyle-eshares/b99455dc27abe5a350a6f94f372eeb30 to your computer and use it in GitHub Desktop.
Save kyle-eshares/b99455dc27abe5a350a6f94f372eeb30 to your computer and use it in GitHub Desktop.
from django.db import models
class AppQueryset(models.QuerySet):
pass
class AppManager(models.Manager):
queryset_class = AppQuerySet
def get_queryset(self):
return self.queryset_class(self.model)
class AppModel(models.Model):
objects = AppManager()
class Meta:
abstract = True
...
from django.views import generic
class View(generic.View):
pass
class TemplateView(generic.TemplateView, View):
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment