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
John James
whats-open
Commits
9d4bcae0
Commit
9d4bcae0
authored
Mar 07, 2018
by
Daniel W Bond
Browse files
Merge branch '2.2-dev' of git.gmu.edu:srct/whats-open into admin-actions
parents
15dd2043
ded1cb8c
Changes
2
Hide whitespace changes
Inline
Side-by-side
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