Commit 9ce5bb7e authored by David Haynes's avatar David Haynes
Browse files

More descriptive variable name + words

- named product_tags so that it can scale to non food related places
- ie. whatever the facility produces to the consumer can be tagged as
such

Closes #40
parent a35315c2
Pipeline #1411 passed with stage
in 1 minute and 5 seconds
......@@ -28,8 +28,8 @@ class FacilityAdmin(admin.ModelAdmin):
fieldsets = (
(None, {
'fields': ('name', 'facility_category', 'facility_location',
'main_schedule', 'special_schedules', 'tags',
'tapingo_url', 'owners'),
'main_schedule', 'special_schedules',
'facility_product_tags', 'tapingo_url', 'owners'),
}),
)
......
......@@ -109,7 +109,9 @@ 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')])
tags = TaggableManager()
# 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()
def is_open(self):
"""
......
......@@ -86,13 +86,14 @@ class FacilitySerializer(serializers.HyperlinkedModelSerializer):
main_schedule = ScheduleSerializer(many=False, read_only=True)
# Append a serialized Schedule object to represent special_schedules
special_schedules = ScheduleSerializer(many=True, read_only=True)
tags = TagListSerializerField()
# Append a serialized TagList object that represents the product tags for a
# Facility
facility_product_tags = TagListSerializerField()
class Meta:
# Choose the model to be serialized
model = Facility
# List the fields that we are serializing
fields = ('id', 'facility_category', 'facility_location', 'tags',
'tapingo_url', 'main_schedule', 'special_schedules',
'modified', 'name')
fields = ('id', 'facility_category', 'facility_location',
'facility_product_tags', 'tapingo_url', 'main_schedule',
'special_schedules', 'modified', 'name')
......@@ -224,11 +224,11 @@ INSTALLED_APPS = (
# Apps specific for this project go here.
'api',
'rest_framework',
# Third party apps
'taggit',
'taggit_serializer'
'taggit_serializer',
'rest_framework',
)
########## END APP CONFIGURATION
......
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