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

Makes the speakers model pluggable #160

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
SpeakerBase is now inheritance managed
  • Loading branch information
chrisjrn committed Aug 10, 2017
commit fb96611735668b53e96909b485e66b5d60d328b8
11 changes: 11 additions & 0 deletions symposion/speakers/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,23 @@

from django.contrib.auth.models import User

from model_utils.managers import InheritanceManager

from symposion.markdown_parser import parse


@python_2_unicode_compatible
class SpeakerBase(models.Model):
''' Base class for conference speaker profiles. This model is not meant to
be used directly; it merely contains the default fields that every
conference would want. You should instead subclass this model.
DefaultSpeaker is a minimal subclass that may be useful. '''

objects = InheritanceManager()

def subclass(self):
''' Returns the subclassed version of this model '''
return self.__class__.objects.get_subclass(id=self.id)

user = models.OneToOneField(User, null=True, related_name="speaker_profile", verbose_name=_("User"))
name = models.CharField(verbose_name=_("Name"), max_length=100,
Expand Down