+class Confirmation(models.Model):
+ first_name = models.CharField(max_length=100)
+ last_name = models.CharField(max_length=100)
+ email = models.EmailField(max_length=100, unique=True)
+ contact = models.ForeignKey(Contact, null=True)
+ key = models.CharField(max_length=30)
+ confirmed = models.BooleanField(default=False)
+
+ @classmethod
+ def create(cls, first_name, last_name, email, contact=None, key=None):
+ confirmation = cls(
+ contact=contact,
+ key=key if key else make_key(30),
+ first_name=first_name,
+ last_name=last_name,
+ email=email
+ )
+
+ confirmation.save()
+ return confirmation
+
+ def absolute_url(self):
+ return reverse('student_confirmation', args=(self.id, self.key))
+
+