Commit 1beb06f0 authored by Renfred Harper's avatar Renfred Harper
Browse files

Fix category model display attributes

parent 6c2ee6b4
from django.contrib import admin from django.contrib import admin
from website.models import Facility, Schedule, OpenTime from website.models import Facility, Category, Schedule, OpenTime
class OpenTimeInline(admin.TabularInline): class OpenTimeInline(admin.TabularInline):
...@@ -12,4 +12,5 @@ class ScheduleAdmin(admin.ModelAdmin): ...@@ -12,4 +12,5 @@ class ScheduleAdmin(admin.ModelAdmin):
admin.site.register(Facility) admin.site.register(Facility)
admin.site.register(Category)
admin.site.register(Schedule, ScheduleAdmin) admin.site.register(Schedule, ScheduleAdmin)
...@@ -8,6 +8,15 @@ class BaseModel(models.Model): ...@@ -8,6 +8,15 @@ class BaseModel(models.Model):
class Category(BaseModel): 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): class Facility(BaseModel):
"""Represents a dining location on campus.""" """Represents a dining location on campus."""
name = models.CharField(max_length=100) name = models.CharField(max_length=100)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment