Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Presentation detail link proposal #106

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion symposion/proposals/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ class ProposalBase(models.Model):
kind = models.ForeignKey(ProposalKind, verbose_name=_("Kind"))

title = models.CharField(max_length=100, verbose_name=_("Title"))
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 @@ -163,8 +165,12 @@ def notification_email_context(self):
"kind": self.kind.name,
}

def save(self, *args, **kwargs):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about #110?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#110 is for a slot name. here is for a proposal with same way.

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

def __str__(self):
return self.title
return self.name

reversion.register(ProposalBase)

Expand Down
45 changes: 35 additions & 10 deletions symposion/schedule/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

from symposion.proposals.models import ProposalBase
from symposion.conference.models import Section
from symposion.speakers.models import Speaker


@python_2_unicode_compatible
Expand Down Expand Up @@ -178,25 +177,51 @@ class Meta:
class Presentation(models.Model):

slot = models.OneToOneField(Slot, null=True, blank=True, related_name="content_ptr", verbose_name=_("Slot"))
title = models.CharField(max_length=100, verbose_name=_("Title"))
description = MarkupField(verbose_name=_("Description"))
abstract = MarkupField(verbose_name=_("Abstract"))
speaker = models.ForeignKey(Speaker, related_name="presentations", verbose_name=_("Speaker"))
additional_speakers = models.ManyToManyField(Speaker, related_name="copresentations",
blank=True, verbose_name=_("Additional speakers"))
cancelled = models.BooleanField(default=False, verbose_name=_("Cancelled"))
proposal_base = models.OneToOneField(ProposalBase, related_name="presentation", verbose_name=_("Proposal base"))
section = models.ForeignKey(Section, related_name="presentations", verbose_name=_("Section"))

@property
def proposal(self):
if self.proposal_base_id is None:
return None
return ProposalBase.objects.get_subclass(pk=self.proposal_base_id)

@property
def number(self):
if self.proposal is None:
return None
return self.proposal.number

@property
def proposal(self):
if self.proposal_base_id is None:
def speaker(self):
if self.proposal is None:
return None
return ProposalBase.objects.get_subclass(pk=self.proposal_base_id)
return self.proposal.speaker

@property
def title(self):
if self.proposal is None:
return None
return self.proposal.title

@property
def description(self):
if self.proposal is None:
return None
return self.proposal.description

@property
def abstract(self):
if self.proposal is None:
return None
return self.proposal.abstract

@property
def additional_speakers(self):
if self.proposal is None:
return None
return self.proposal.additional_speakers

def speakers(self):
yield self.speaker
Expand Down