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
9bb565bc
Commit
9bb565bc
authored
Nov 03, 2017
by
David Haynes
🙆
Browse files
Merge branch '63-facility-note' into '2.1-dev'
Add optional note field to Facility See merge request
!33
parents
ad3fbe7f
626910bb
Pipeline
#1732
passed with stage
in 1 minute and 38 seconds
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
whats-open/api/admin.py
View file @
9bb565bc
...
@@ -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'
),
}),
}),
)
)
...
...
whats-open/api/models.py
View file @
9bb565bc
...
@@ -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"
,
...
...
whats-open/api/serializers.py
View file @
9bb565bc
...
@@ -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'
,
)
whats-open/api/views.py
View file @
9bb565bc
...
@@ -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'
,
...
...
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