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
SRCT
whats-open
Commits
3178dd30
Commit
3178dd30
authored
Jun 23, 2017
by
David Haynes
Browse files
Add tapingo_url attribute to Facility
- optional, enforced with RegexValidator
parent
d489d258
Pipeline
#1404
passed with stage
in 1 minute and 4 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
whats-open/api/admin.py
View file @
3178dd30
...
@@ -28,7 +28,8 @@ class FacilityAdmin(admin.ModelAdmin):
...
@@ -28,7 +28,8 @@ class FacilityAdmin(admin.ModelAdmin):
fieldsets
=
(
fieldsets
=
(
(
None
,
{
(
None
,
{
'fields'
:
(
'name'
,
'facility_category'
,
'facility_location'
,
'fields'
:
(
'name'
,
'facility_category'
,
'facility_location'
,
'main_schedule'
,
'special_schedules'
,
'owners'
),
'main_schedule'
,
'special_schedules'
,
'tapingo_url'
,
'owners'
),
}),
}),
)
)
...
...
whats-open/api/models.py
View file @
3178dd30
...
@@ -12,10 +12,12 @@ from __future__ import (absolute_import, division, print_function,
...
@@ -12,10 +12,12 @@ from __future__ import (absolute_import, division, print_function,
# Python stdlib Imports
# Python stdlib Imports
import
datetime
import
datetime
import
re
# Django Imports
# Django Imports
from
django.db
import
models
from
django.db
import
models
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
from
django.core.validators
import
RegexValidator
# Other Imports
# Other Imports
from
model_utils.models
import
TimeStampedModel
from
model_utils.models
import
TimeStampedModel
...
@@ -102,6 +104,11 @@ class Facility(TimeStampedModel):
...
@@ -102,6 +104,11 @@ class Facility(TimeStampedModel):
only for its
only for its
specified duration.
specified duration.
"""
)
"""
)
# URL, if it exists, to the Tapingo page that is associated with this
# facility
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'
)])
def
is_open
(
self
):
def
is_open
(
self
):
"""
"""
...
...
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