Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Commit

Permalink
Fixing cyclical imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
davedash committed Mar 4, 2011
1 parent f6604ef commit 01ab88b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions apps/jetpack/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import commonware

from django.db import models
from jetpack.models import PackageRevision

log = commonware.log.getLogger('f.jetpack.managers')
#TODO: Add Library and Addon managers and use them inside Package and views
Expand All @@ -18,13 +17,14 @@ def active(self, viewer=None):
active_q = models.Q(active=True)
notdeleted_q = models.Q(deleted=False)
if viewer:
active_q= active_q | models.Q(author=viewer)
active_q = active_q | models.Q(author=viewer)
return self.filter(notdeleted_q).filter(active_q)

def active_with_deleted(self, viewer=None):
"""Filter out inactive packages, consider owners of packages
depending on deleted packages
"""
from jetpack.models import PackageRevision
active_q = models.Q(active=True)
notdeleted_q = models.Q(deleted=False)
if viewer:
Expand All @@ -42,6 +42,7 @@ def active_with_disabled(self, viewer=None):
"""Filter out inactive packages, consider owners of packages
depending on disabled packages
"""
from jetpack.models import PackageRevision
active_q = models.Q(active=True)
notdeleted_q = models.Q(deleted=False)
if viewer:
Expand All @@ -65,5 +66,3 @@ def addons(self):
def libraries(self):
" return libraries only "
return self.active().filter(type="l")


0 comments on commit 01ab88b

Please sign in to comment.