Skip to content

Commit

Permalink
added model
Browse files Browse the repository at this point in the history
  • Loading branch information
Sail338 committed Jul 17, 2018
1 parent 5ffe3ca commit a58edce
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions garfield/lookup/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
from django.db import models
from contacts.models import Contact

# Create your models here.
class Lookup(model.Model):
look_up_date = models.DateTimeField(auto_now_add=True)
officer_phone_number = models.CharField(max_length=12,
db_index=True
blank=False
null=False)
contact_phone_number = models.CharField(max_length=15,
db_index=True,
blank=False,
null=False)

related_contact = models.ManyToOneField(Contact, null=True)

def save(self,force_insert=False,force_update=False,**kwargs):
super(Lookup,self).save(force_insert,force_update)

1 change: 1 addition & 0 deletions garfield/lookup/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from twilio.twiml.messaging_response import MessagingResponse

from contacts.models import Contact
from lookup.models import Lookup
from .decorators import twilio_view
from garfield import local as local
import phonenumbers
Expand Down

0 comments on commit a58edce

Please sign in to comment.