You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
525 B
Python
23 lines
525 B
Python
from django.contrib import admin
|
|
|
|
from .models import MaterialPart, Ownership
|
|
|
|
|
|
# Register your models here.
|
|
class OwnershipInline(admin.StackedInline):
|
|
"""
|
|
This shows the ownership selection directly in the MaterialPart edit
|
|
view
|
|
"""
|
|
model = Ownership
|
|
extra = 0
|
|
|
|
|
|
class MaterialAdmin(admin.ModelAdmin):
|
|
"""Edit view of a MaterialPart"""
|
|
|
|
list_display = ('name', 'buy_date', 'lifetime', 'not_too_old', 'photo')
|
|
inlines = [OwnershipInline]
|
|
|
|
admin.site.register(MaterialPart, MaterialAdmin)
|