<s> from django . conf import settings <EOL> from django . contrib . auth . models import Group , User <EOL> from django . db import models <EOL> from django . template . defaultfilters import slugify <EOL> from django . utils . translation import ugettext_lazy as _lazy <EOL> from kitsune . sumo . models import ModelBase <EOL> from kitsune . sumo . urlresolvers import reverse <EOL> from kitsune . wiki . parser import wiki_to_html <EOL> class GroupProfile ( ModelBase ) : <EOL> """<STR_LIT>""" <EOL> slug = models . SlugField ( unique = True , editable = False , blank = False , <EOL> null = False , max_length = <NUM_LIT> ) <EOL> group = models . ForeignKey ( Group , related_name = '<STR_LIT>' ) <EOL> leaders = models . ManyToManyField ( User ) <EOL> information = models . TextField ( help_text = u'<STR_LIT>' ) <EOL> information_html = models . TextField ( editable = False ) <EOL> avatar = models . ImageField ( upload_to = settings . GROUP_AVATAR_PATH , null = True , <EOL> blank = True , verbose_name = _lazy ( u'<STR_LIT>' ) , <EOL> max_length = settings . MAX_FILEPATH_LENGTH ) <EOL> class Meta : <EOL> ordering = [ '<STR_LIT>' ] <EOL> def __unicode__ ( self ) : <EOL> return unicode ( self . group ) <EOL> def get_absolute_url ( self ) : <EOL> return reverse ( '<STR_LIT>' , args = [ self . slug ] ) <EOL> def save ( self , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> if not self . slug : <EOL> self . slug = slugify ( self . group . name ) <EOL> self . information_html = wiki_to_html ( self . information ) <EOL> super ( GroupProfile , self ) . save ( * args , ** kwargs ) </s>
