Verified Commit 626910bb authored by David Haynes's avatar David Haynes 🙆
Browse files

Add optional note field to Facility

- Allows you to send whatever text you want to clients
- Responsibility on admins once again

Closes #63
parent ad3fbe7f
Pipeline #1730 passed with stage
in 1 minute and 35 seconds
...@@ -29,7 +29,7 @@ class FacilityAdmin(admin.ModelAdmin): ...@@ -29,7 +29,7 @@ class FacilityAdmin(admin.ModelAdmin):
(None, { (None, {
'fields': ('facility_name', 'logo', 'facility_category', 'facility_location', 'fields': ('facility_name', 'logo', 'facility_category', 'facility_location',
'main_schedule', 'special_schedules', 'main_schedule', 'special_schedules',
'facility_product_tags', 'tapingo_url', 'owners'), 'facility_product_tags', 'tapingo_url', 'note', 'owners'),
}), }),
) )
......
...@@ -106,6 +106,11 @@ class Facility(TimeStampedModel): ...@@ -106,6 +106,11 @@ class Facility(TimeStampedModel):
facility_location = models.ForeignKey('Location', facility_location = models.ForeignKey('Location',
related_name="facilities") related_name="facilities")
# A note that can be left on a Facility to provide some additional
# information.
note = models.TextField('Facility Note', blank=True,
help_text="Additional information that is sent with this Facility.")
# A link to the logo image for this Facility # A link to the logo image for this Facility
logo = models.URLField('Logo URL', blank=True, logo = models.URLField('Logo URL', blank=True,
default="https://imgur.com/q2Phkn9.png", default="https://imgur.com/q2Phkn9.png",
......
...@@ -95,6 +95,6 @@ class FacilitySerializer(serializers.HyperlinkedModelSerializer): ...@@ -95,6 +95,6 @@ class FacilitySerializer(serializers.HyperlinkedModelSerializer):
model = Facility model = Facility
# List the fields that we are serializing # List the fields that we are serializing
fields = ('slug', 'facility_name', 'logo', 'facility_location', 'facility_category', fields = ('slug', 'facility_name', 'logo', 'facility_location', 'facility_category',
'facility_product_tags', 'tapingo_url', 'facility_product_tags', 'tapingo_url', 'note',
'main_schedule', 'special_schedules', 'main_schedule', 'special_schedules',
'modified', ) 'modified', )
...@@ -365,6 +365,7 @@ class FacilityViewSet(viewsets.ReadOnlyModelViewSet): ...@@ -365,6 +365,7 @@ class FacilityViewSet(viewsets.ReadOnlyModelViewSet):
'facility_name', 'facility_name',
'logo', 'logo',
'tapingo_url', 'tapingo_url',
'note',
'facility_product_tags__name', 'facility_product_tags__name',
# Category fields # Category fields
'facility_category__name', 'facility_category__name',
......
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