This repository has been archived on 2025-03-03. You can view files and clone it, but cannot push or open issues or pull requests.
facturio/subjects/admin.py

25 lines
563 B
Python
Raw Permalink Normal View History

2023-12-19 13:49:34 +01:00
from django.contrib import admin
2024-08-16 22:12:49 +02:00
from .models import Subject
from .models import SubjectData
2023-12-19 14:39:59 +01:00
2024-08-16 22:12:49 +02:00
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):
2024-08-16 22:12:49 +02:00
list_display = ['id', 'vat_id']
inlines = [SubjectDataInline]