Commit ad3fbe7f authored by David Haynes's avatar David Haynes 🙆
Browse files

Merge branch '37-facility-logo' into '2.1-dev'

Support Facility logos to be served through the api

See merge request srct/whats-open!32
parents ea852337 2447a60e
......@@ -27,7 +27,7 @@ class FacilityAdmin(admin.ModelAdmin):
# We are basically reordering things to look nicer to the user here
fieldsets = (
(None, {
'fields': ('facility_name', 'facility_category', 'facility_location',
'fields': ('facility_name', 'logo', 'facility_category', 'facility_location',
'main_schedule', 'special_schedules',
'facility_product_tags', 'tapingo_url', 'owners'),
......@@ -106,6 +106,11 @@ class Facility(TimeStampedModel):
facility_location = models.ForeignKey('Location',
# A link to the logo image for this Facility
logo = models.URLField('Logo URL', blank=True,
help_text="The absolute URL to the logo image for this Facility.")
# The User(s) that claim ownership over this facility
owners = models.ManyToManyField(User)
......@@ -94,7 +94,7 @@ class FacilitySerializer(serializers.HyperlinkedModelSerializer):
# Choose the model to be serialized
model = Facility
# List the fields that we are serializing
fields = ('slug', 'facility_name', 'facility_location', 'facility_category',
fields = ('slug', 'facility_name', 'logo', 'facility_location', 'facility_category',
'facility_product_tags', 'tapingo_url',
'main_schedule', 'special_schedules',
'modified', )
......@@ -363,13 +363,14 @@ class FacilityViewSet(viewsets.ReadOnlyModelViewSet):
# Facility fields
# Category fields
# Location fields
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