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

Commit

Permalink
Making slug on GroupPage unique with group.
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanborror committed Jul 5, 2010
1 parent fd46a05 commit 5353402
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion basic/groups/models.py
Expand Up @@ -52,14 +52,17 @@ class GroupPage(models.Model):
""" GroupPage model """
group = models.ForeignKey(Group, related_name='pages')
title = models.CharField(blank=True, max_length=100)
slug = models.SlugField()
slug = models.SlugField(help_text='Used for the page URL.')
body = models.TextField(blank=True)
created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True)

def __unicode__(self):
return self.title

class Meta:
unique_together = (('slug', 'group'),)

@permalink
def get_absolute_url(self):
return ('groups:page', None, {
Expand Down

0 comments on commit 5353402

Please sign in to comment.