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
W
whats-open
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
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
Jay J Kim
whats-open
Commits
1beb06f0
Commit
1beb06f0
authored
May 18, 2014
by
Renfred Harper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix category model display attributes
parent
6c2ee6b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
whats-open/website/admin.py
whats-open/website/admin.py
+2
-1
whats-open/website/models.py
whats-open/website/models.py
+10
-1
No files found.
whats-open/website/admin.py
View file @
1beb06f0
from
django.contrib
import
admin
from
website.models
import
Facility
,
Schedule
,
OpenTime
from
website.models
import
Facility
,
Category
,
Schedule
,
OpenTime
class
OpenTimeInline
(
admin
.
TabularInline
):
...
...
@@ -12,4 +12,5 @@ class ScheduleAdmin(admin.ModelAdmin):
admin
.
site
.
register
(
Facility
)
admin
.
site
.
register
(
Category
)
admin
.
site
.
register
(
Schedule
,
ScheduleAdmin
)
whats-open/website/models.py
View file @
1beb06f0
...
...
@@ -6,7 +6,16 @@ class BaseModel(models.Model):
last_modified
=
models
.
DateTimeField
(
'Last Modified'
,
auto_now
=
True
)
class
Category
(
BaseModel
):
name
=
models
.
CharField
(
max_length
=
100
)
name
=
models
.
CharField
(
max_length
=
100
)
class
Meta
:
verbose_name
=
"category"
verbose_name_plural
=
"categories"
# Sort by name in admin view
ordering
=
[
'name'
]
def
__unicode__
(
self
):
return
self
.
name
class
Facility
(
BaseModel
):
"""Represents a dining location on campus."""
...
...
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