Skip to content

Commit

Permalink
proposalbase: gen name when save
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Miura <[email protected]>
  • Loading branch information
miurahr committed Jul 25, 2015
1 parent 4725195 commit 617b298
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion symposion/proposals/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ class ProposalBase(models.Model):
kind = models.ForeignKey(ProposalKind)

title = models.CharField(max_length=100)
name = models.CharField(max_length=100, editable=False)

description = models.TextField(
_("Brief Description"),
max_length=400, # @@@ need to enforce 400 in UI
Expand Down Expand Up @@ -147,8 +149,12 @@ def notification_email_context(self):
"kind": self.kind.name,
}

def save(self, *args, **kwargs):
self.name = u"%s - %s(%s)" % (self.title, self.speaker.name, self.kind.name)
super(ProposalBase, self).save(*args, **kwargs)

def __unicode__(self):
return u"%s - %s(%s)" % (self.title, self.speaker.name, self.kind.name)
return self.name

reversion.register(ProposalBase)

Expand Down

0 comments on commit 617b298

Please sign in to comment.