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
d2a34b57
Commit
d2a34b57
authored
Feb 19, 2019
by
David Haynes
🙆
Browse files
HOTFIX: Add Shopmason requested features
- optional URL on alerts - redo OpenTimeInlineAdmin
parent
7ac9c750
Pipeline
#3955
passed with stage
in 1 minute and 8 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
whats-open/api/admin.py
View file @
d2a34b57
...
...
@@ -145,19 +145,24 @@ class FacilityAdmin(admin.ModelAdmin):
return
initial_data
class
OpenTimeInline
(
admin
.
Stacked
Inline
):
class
OpenTimeInline
(
admin
.
Tabular
Inline
):
"""
A table of time periods that represent an "open time" for a Facility.
https://docs.djangoproject.com/en/1.11/ref/contrib/admin/#django.contrib.admin.TabularInline
"""
# Columns correspond to each attribute in the OpenTime table
model
=
OpenTime
extra
=
1
# 7 days of the week, so only have 7 rows
extra
=
7
# We are basically reordering things to look nicer to the user here
fieldsets
=
(
(
None
,
{
"fields"
:
((
"start_day"
,
"start_time"
),
(
"end_day"
,
"end_time"
))}),
(
None
,
{
'fields'
:
(
(
'start_day'
,
'start_time'
),
(
'end_day'
,
'end_time'
)
),
}),
)
...
...
whats-open/api/migrations/0006_auto_20190219_1729.py
0 → 100644
View file @
d2a34b57
# Generated by Django 2.0.10 on 2019-02-19 22:29
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'api'
,
'0005_auto_20190129_1215'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'alert'
,
name
=
'url'
,
field
=
models
.
URLField
(
blank
=
True
,
verbose_name
=
'Reference URL'
),
),
]
whats-open/api/models.py
View file @
d2a34b57
...
...
@@ -423,7 +423,7 @@ class Alert(TimeStampedModel):
# The text that is displayed that describes the Alert
subject
=
models
.
CharField
(
max_length
=
130
)
body
=
models
.
TextField
()
url
=
models
.
URLField
(
"Reference URL"
,
max_length
=
200
)
url
=
models
.
URLField
(
"Reference URL"
,
max_length
=
200
,
blank
=
True
)
# The date + time that the alert will be start being served
start_datetime
=
models
.
DateTimeField
()
...
...
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