Created
February 22, 2011 10:39
-
-
Save jgorset/838488 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Call(models.Model): | |
call_at = models.DateTimeField() | |
contestant = models.OneToOneField(Contestant) | |
confirmed = models.BooleanField() | |
def confirm(self): | |
self.confirmed = True | |
self.save() | |
def save(self, *args, **kwargs): | |
if not self.id: | |
created = True | |
call = super(Call, self).save(*args, **kwargs) | |
if created: | |
# Dispatch an SMS requesting confirmation that this phone | |
# number is in fact the contestant's phone number. | |
message = OutgoingSMS.objects.create( | |
recipient = self.contestant.phone_number, | |
sender = 'Bademiljø', | |
message = '-' | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment