Skip to content

Commit

Permalink
Adding a branch based of master
Browse files Browse the repository at this point in the history
  • Loading branch information
yashwanthbabu committed Sep 11, 2014
1 parent 78c1ea9 commit 6824834
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tavern/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

class NonEmptyGroupManager(models.Manager):

def get_queryset(self):
def non_empty_groups(self):
"""
Filters out tavern groups which contain no members
Filters out tavern groups which contain atlease one member
"""
return super(NonEmptyGroupManager, self).get_queryset().exclude(members=None)

Expand All @@ -35,8 +35,7 @@ class TavernGroup(models.Model):
related_name="tavern_groups")
slug = models.SlugField(max_length=50)

objects = models.Manager()
with_members = NonEmptyGroupManager()
objects = NonEmptyGroupManager()

def get_absolute_url(self):
return reverse("tavern_group_details", kwargs={"slug": self.slug})
Expand Down Expand Up @@ -91,7 +90,7 @@ class Event(models.Model):
location = models.TextField(null=True, blank=True)

attendees = models.ManyToManyField(User, through="Attendee",
related_name="events_attending")
related_name="events_attending")
slug = models.SlugField(max_length=250)

creator = models.ForeignKey(User)
Expand Down

0 comments on commit 6824834

Please sign in to comment.