Skip to content


Subversion checkout URL

You can clone with
Download ZIP
tree: 29eae58d01
Fetching contributors…

Cannot retrieve contributors at this time

executable file 39 lines (31 sloc) 1.18 kB
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class UserDetails(models.Model):
asterisk_extension = models.CharField(max_length=4)
access_code = models.CharField(max_length=4)
access_message = models.CharField(max_length=2048)
phone_number = models.CharField(max_length=10)
user = models.OneToOneField(User, related_name="details")
def __unicode__(self):
return self.user.username
class CallBack(models.Model):
user = models.ForeignKey(User, related_name="calls")
time = models.DateTimeField()
returned = models.BooleanField(default=False)
def __unicode__(self):
retstr = "User: %d Time: %s Returned: %s" % (, self.time, self.returned)
return retstr
class FailedAuth(models.Model):
method = models.CharField(max_length=4)
data = models.CharField(max_length=4)
time = models.DateTimeField()
def assign(self, user):
if self.method == 'AST':
user.details.access_code =
elif self.method == 'SMS':
user.details.access_message =
def __unicode__(self):
retstr = "ID: %d Time: %s Data: %s" % (, self.time,
return retstr
Jump to Line
Something went wrong with that request. Please try again.