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
9d4bcae0
Commit
9d4bcae0
authored
Mar 07, 2018
by
Daniel W Bond
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.2-dev' of git.gmu.edu:srct/whats-open into admin-actions
parents
15dd2043
ded1cb8c
Pipeline
#2176
canceled with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
whats-open/api/admin.py
whats-open/api/admin.py
+12
-0
whats-open/api/models.py
whats-open/api/models.py
+1
-1
No files found.
whats-open/api/admin.py
View file @
9d4bcae0
...
...
@@ -96,6 +96,16 @@ class FacilityAdmin(admin.ModelAdmin):
'tapingo_url'
,
'phone_number'
,
'note'
,
'owners'
),
}),
)
autocomplete_fields
=
[
'main_schedule'
,
'special_schedules'
,
]
# despite the name of this method, ("change" seems to imply it would affect modify)
# it is called only when initially creating a model
def
get_changeform_initial_data
(
self
,
request
):
initial_data
=
super
(
FacilityAdmin
,
self
).
get_changeform_initial_data
(
request
)
initial_data
[
'owners'
]
=
[
request
.
user
,
]
return
initial_data
class
OpenTimeInline
(
admin
.
TabularInline
):
"""
...
...
@@ -143,6 +153,8 @@ class ScheduleAdmin(admin.ModelAdmin):
'promote_to_main'
)
}),
)
search_fields
=
[
'name'
,
]
# search terms for autcomplete
ordering
=
[
'name'
,
]
# autocomplete ordering
# https://docs.djangoproject.com/en/1.11/ref/contrib/gis/admin/#osmgeoadmin
OSMGeoAdmin
.
default_lon
=
-
8605757.16502
...
...
whats-open/api/models.py
View file @
9d4bcae0
...
...
@@ -123,7 +123,7 @@ class Facility(TimeStampedModel):
# A link to the logo image for this Facility
logo
=
models
.
URLField
(
'Logo URL'
,
blank
=
True
,
default
=
"https://
imgur.com/q2Phkn9
.png"
,
default
=
"https://
wopen-cdn.dhaynes.xyz/default
.png"
,
help_text
=
"The absolute URL to the logo image for this Facility."
)
# The User(s) that claim ownership over this facility
...
...
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