@@ -58,24 +58,31 @@ class AttendeeProfileBase(models.Model):
objects = InheritanceManager()
@classmethod
def name_field(cls):
'''
Returns:
The name of a field that stores the attendee's name. This is used
to pre-fill the attendee's name from their Speaker profile, if they
have one.
return None
def attendee_name(self):
if type(self) == AttendeeProfileBase:
real = AttendeeProfileBase.objects.get_subclass(id=self.id)
else:
real = self
return getattr(real, real.name_field())
def invoice_recipient(self):
A representation of this attendee profile for the purpose
of rendering to an invoice. This should include any information
that you'd usually include on an invoice. Override in subclasses.
# Manual dispatch to subclass. Fleh.
slf = AttendeeProfileBase.objects.get_subclass(id=self.id)
# Actually compare the functions.