Browse files

Move custom manager to separated module

  • Loading branch information...
1 parent 620e85a commit ab5827bd0440e38771ac430e87d57e58c317b537 @kachayev committed Aug 7, 2011
Showing with 7 additions and 4 deletions.
  1. +6 −0 gearoscope/apps/monitor/managers.py
  2. +1 −4 gearoscope/apps/monitor/models.py
View
6 gearoscope/apps/monitor/managers.py
@@ -0,0 +1,6 @@
+from django.db import models
+
+class LastRevisionManager(models.Manager):
+ def get_query_set(self):
+ return super(LastRevisionManager, self).get_query_set().order_by('-time').values()
+
View
5 gearoscope/apps/monitor/models.py
@@ -1,8 +1,5 @@
from django.db import models
-
-class LastRevision(models.Manager):
- def get_query_set(self):
- return super(LastRevision, self).get_query_set().order_by('-time').values()
+from monitor.managers import LastRevisionManager
class Revision(models.Model):
'''

0 comments on commit ab5827b

Please sign in to comment.