Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad73 committed Aug 3, 2011
2 parents dff87c8 + 0a40c7e commit bf1d4a9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ecclesia/discussions/models.py
Expand Up @@ -20,6 +20,11 @@ class Meta:
def __unicode__(self):
return u'%s' % self.name

def get_default_discussion_type():
try:
return DiscussionType.objects.get(name="course-of-action")
except:
return None

class Discussion(Presentable):
"""
Expand All @@ -28,7 +33,7 @@ class Discussion(Presentable):
group = models.ForeignKey(Group, editable=False, verbose_name=_('group'), related_name='discussions', help_text=_("The group profile containing this discussion."))
name = models.CharField(_('name'), max_length=50, help_text=_('The name of the discussion.'))
slug = models.SlugField(_('slug'), max_length=500, unique=True, blank=False, help_text=_("The url representation of the discussion's name. No whitespaces allowed - use hyphen/underscore to separate words"))
type = models.ForeignKey(DiscussionType, verbose_name=_('discussion type'), related_name='discussions', help_text=_("The discussion's type."))
type = models.ForeignKey(DiscussionType, default=get_default_discussion_type, verbose_name=_('discussion type'), related_name='discussions', help_text=_("The discussion's type."))
description = models.TextField(_('short description'), max_length=500, null=True, blank=True, help_text=_('A short description of the discussion.'))
# no nesting on this release...
#parent = models.ForeignKey('self', verbose_name=_('parent'), related_name='children', null=True, blank=True, help_text=_('The parent discussion containing this discussion.'))
Expand Down

0 comments on commit bf1d4a9

Please sign in to comment.