Commit 3178dd30 authored by David Haynes's avatar David Haynes
Browse files

Add tapingo_url attribute to Facility

- optional, enforced with RegexValidator
parent d489d258
......@@ -28,7 +28,8 @@ class FacilityAdmin(admin.ModelAdmin):
fieldsets = (
(None, {
'fields': ('name', 'facility_category', 'facility_location',
'main_schedule', 'special_schedules', 'owners'),
'main_schedule', 'special_schedules',
'tapingo_url', 'owners'),
}),
)
......
......@@ -12,10 +12,12 @@ from __future__ import (absolute_import, division, print_function,
# Python stdlib Imports
import datetime
import re
# Django Imports
from django.db import models
from django.contrib.auth.models import User
from django.core.validators import RegexValidator
# Other Imports
from model_utils.models import TimeStampedModel
......@@ -102,6 +104,11 @@ class Facility(TimeStampedModel):
only for its
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):
"""
......
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