Created
March 5, 2014 09:58
-
-
Save martinsam/9364411 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from datetime import datetime | |
| from django.db.models import Manager | |
| from django.db.models.query import QuerySet | |
| class TodoMixin(object): | |
| def is_done(self): | |
| return self.filter(done=is_true)) | |
| #ecrire ici vos nouvelles méthodes | |
| class TodoQuerySet(QuerySet, PostMixin): | |
| pass | |
| class TodoManager(Manager, TodoMixin): | |
| def get_query_set(self): | |
| return TodoQuerySet(self.model, using=self._db) | |
| class Todo(models.Model): | |
| done = models.BooleanField() | |
| objects = PostManager() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment