Skip to content

Commit d8fe519

Browse files
committed
Add custom manager to Group with convenience helper for getting active
WGs(requested by Ryan Cross) - Legacy-Id: 3704
1 parent ca9dd9b commit d8fe519

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

redesign/group/models.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ def __unicode__(self):
2929
class Meta:
3030
abstract = True
3131

32+
class GroupManager(models.Manager):
33+
def active_wgs(self):
34+
return self.get_query_set().filter(type='wg', state__in=('bof','proposed','active'))
35+
3236
class Group(GroupInfo):
37+
objects = GroupManager()
38+
3339
# we keep charter separate
3440
charter = models.OneToOneField('doc.Document', related_name='chartered_group', blank=True, null=True)
3541

0 commit comments

Comments
 (0)