Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
whats-open
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
9
Issues
9
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SRCT
whats-open
Commits
f09c84ec
Commit
f09c84ec
authored
Mar 06, 2018
by
Daniel W Bond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
created new method, added to dropdown
parent
5d3b7e43
Pipeline
#2165
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
whats-open/api/admin.py
whats-open/api/admin.py
+10
-1
No files found.
whats-open/api/admin.py
View file @
f09c84ec
...
...
@@ -10,6 +10,7 @@ https://docs.djangoproject.com/en/1.11/ref/contrib/admin/
# Django Imports
from
django.contrib
import
admin
from
django.contrib.gis.admin
import
OSMGeoAdmin
from
django.shortcuts
import
render
# App Imports
from
.models
import
Facility
,
Schedule
,
OpenTime
,
Category
,
Location
,
Alert
...
...
@@ -26,7 +27,15 @@ class FacilityAdmin(admin.ModelAdmin):
facility
.
special_schedules
.
clear
()
self
.
message_user
(
request
,
"Successfully removed special schedules from %d facilities."
%
num
)
actions
=
[
drop_special_schedules
,
]
def
assign_bulk_schedules
(
self
,
request
,
queryset
):
return
render
(
request
,
'bulk_schedules_intermediate.html'
,
context
=
{
'facilities'
:
queryset
,
'schedules'
:
Schedule
.
objects
.
all
()})
assign_bulk_schedules
.
short_description
=
'Assign a schedule to multiple facilities'
# a list of all actions to be added
actions
=
[
drop_special_schedules
,
assign_bulk_schedules
,
]
# Allow filtering by the following fields
list_filter
=
[
'facility_category'
,
'facility_location'
]
...
...
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