24 lines
563 B
Python
24 lines
563 B
Python
from django.contrib import admin
|
|
|
|
from .models import Subject
|
|
from .models import SubjectData
|
|
|
|
|
|
class SubjectDataInline(admin.TabularInline):
|
|
model = SubjectData
|
|
extra = 0 # is removes the extra empty forms
|
|
readonly_fields = [
|
|
'name',
|
|
'street',
|
|
'zip_code',
|
|
'city',
|
|
'city_part',
|
|
'created_date',
|
|
]
|
|
can_delete = False # Optional: Prevent deletion in the inline
|
|
|
|
|
|
@admin.register(Subject)
|
|
class SubjectAdmin(admin.ModelAdmin):
|
|
list_display = ['id', 'vat_id']
|
|
inlines = [SubjectDataInline]
|