Skip to content

Commit

Permalink
api(admin): adiciona e config as models a página
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusvrs committed Nov 6, 2023
1 parent dd86d33 commit cb650a2
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion api/api/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
from django.contrib import admin
from .models import Department, Discipline, Class

# Register your models here.

@admin.register(Department)
class DepartmentAdmin(admin.ModelAdmin):
list_display = ['code', 'year', 'period']
search_fields = ['code']
ordering = ['year', 'period']


@admin.register(Discipline)
class DisciplineAdmin(admin.ModelAdmin):
list_display = ['name', 'code']
search_fields = ['name', 'code']
ordering = ['name']


@admin.register(Class)
class ClassAdmin(admin.ModelAdmin):
list_display = ['discipline', 'classroom', 'schedule']
search_fields = ['discipline__name']
ordering = ['discipline__name']

0 comments on commit cb650a2

Please sign in to comment.