Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Hunter T Jozwiak
whats-open
Commits
967bdafe
Commit
967bdafe
authored
Nov 30, 2017
by
Mattias J Duffy
Browse files
adding a phone number field to the api
parent
50ed6039
Changes
4
Hide whitespace changes
Inline
Side-by-side
startup.sh
100644 → 100755
View file @
967bdafe
File mode changed from 100644 to 100755
whats-open/api/admin.py
View file @
967bdafe
...
...
@@ -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'
),
}),
)
...
...
whats-open/api/models.py
View file @
967bdafe
...
...
@@ -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
()
...
...
whats-open/settings/base.py
View file @
967bdafe
...
...
@@ -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"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment