File diff aa6377f4ce88 → d2d2a1b0ecdd
registrasion/models.py
Show inline comments
...
 
@@ -48,24 +48,29 @@ class BadgeAndProfile(models.Model):
 
    def __str__(self):
 
        return "Badge for: %s of %s" % (self.name, self.company)
 

	
 
    @staticmethod
 
    def get_instance(attendee):
 
        ''' Returns either None, or the instance that belongs
 
        to this attendee. '''
 
        try:
 
            return BadgeAndProfile.objects.get(attendee=attendee)
 
        except ObjectDoesNotExist:
 
            return None
 

	
 
    def save(self):
 
        if not self.name_per_invoice:
 
            self.name_per_invoice = self.name
 
        super(BadgeAndProfile, self).save()
 

	
 
    attendee = models.OneToOneField(Attendee, on_delete=models.CASCADE)
 

	
 
    # Things that appear on badge
 
    name = models.CharField(
 
        verbose_name="Your name (for your conference nametag)",
 
        max_length=64,
 
        help_text="Your name, as you'd like it to appear on your badge. ",
 
    )
 
    company = models.CharField(
 
        max_length=64,
 
        help_text="The name of your company, as you'd like it on your badge",
 
        blank=True,