<reponame>mamalmaleki/maktab-community<filename>departments/admin/rooms.py<gh_stars>0
from django import forms
from django.contrib import admin

from departments import models


class RoomForm(forms.ModelForm):
    class Meta:
        fields = '__all__'
        model = models.Room


class RoomAdmin(admin.ModelAdmin):
    form = RoomForm
    fields = (('department', 'code'), 'address')
    #           'department', 'description', 'prerequisites')

    list_display = ('id', 'department', 'code',)
    list_editable = ('department', 'code',)

    search_fields = ('code', 'department__title')

from django import forms
from django.contrib import admin

from departments import models


class RoomForm(forms.ModelForm):
    class Meta:
        fields = '__all__'
        model = models.Room


class RoomAdmin(admin.ModelAdmin):
    form = RoomForm
    fields = (('department', 'code'), 'address')
    #           'department', 'description', 'prerequisites')

    list_display = ('id', 'department', 'code',)
    list_editable = ('department', 'code',)

    search_fields = ('code', 'department__title')
#           'department', 'description', 'prerequisites')