Commit 967bdafe authored by Mattias J Duffy's avatar Mattias J Duffy
Browse files

adding a phone number field to the api

parent 50ed6039
File mode changed from 100644 to 100755
......@@ -29,7 +29,7 @@ class FacilityAdmin(admin.ModelAdmin):
(None, {
'fields': ('facility_name', 'logo', 'facility_category', 'facility_location',
'main_schedule', 'special_schedules',
'facility_product_tags', 'tapingo_url', 'note', 'owners'),
'facility_product_tags', 'tapingo_url','phone_number', 'note', 'owners'),
}),
)
......
......@@ -133,6 +133,11 @@ class Facility(TimeStampedModel):
tapingo_url = models.URLField(blank=True, validators=[RegexValidator(regex='^https:\/\/www.tapingo.com\/',
message='The link is not a valid tapingo link. Example: https://www.tapingo.com/order/restaurant/starbucks-gmu-johnson/',
code='invalid_tapingo_url')])
phone_number = models.CharField(blank=True,max_length=18, validators=[RegexValidator(regex='^\(?([0-9]{3})\)?[-.●]?([0-9]{3})[-.●]?([0-9]{4})$',
message='Invalid phone number ',
code='invalid_phone_number')])
# A comma seperate list of words that neatly an aptly describe the product
# that this facility produces. (ex. for Taco Bell: mexican, taco, cheap)
facility_product_tags = TaggableManager()
......
......@@ -241,6 +241,7 @@ INSTALLED_APPS = (
# Third party apps
'taggit',
'phonenumber_field',
'taggit_serializer',
'rest_framework',
'rest_framework_gis',
......@@ -314,3 +315,7 @@ LOGGING = {
},
}
}
"""
THIRD PARTY CONFIGURATION
"""
PHONENUMBER_DB_FORMAT = "NATIONAL"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment