new admin !
This commit is contained in:
parent
6e993c0e27
commit
8dee36f928
2 changed files with 75 additions and 10 deletions
|
@ -63,8 +63,8 @@ class EquipmentAttributeValueInline(admin.TabularInline):
|
|||
|
||||
|
||||
class CategoryAdmin(admin.ModelAdmin):
|
||||
readonly_fields = ['full_name']
|
||||
list_display = ['name', 'parent', "full_name"]
|
||||
readonly_fields = ['full_name_p']
|
||||
list_display = ['name', 'parent', "full_name_p"]
|
||||
ordering = ['name', 'parent']
|
||||
search_fields = ['name',]
|
||||
|
||||
|
@ -76,8 +76,39 @@ class EquipmentAttributeAdmin(admin.ModelAdmin):
|
|||
|
||||
|
||||
class EquipmentAdmin(admin.ModelAdmin):
|
||||
readonly_fields = ['full_category', 'added_at', 'modified_at',]
|
||||
readonly_fields = ['full_category_p',
|
||||
'added_at',
|
||||
'modified_at',
|
||||
'stock_aviable_p',
|
||||
'ids_aviable_p',
|
||||
'stock_lost_p',
|
||||
'ids_lost_p',
|
||||
]
|
||||
list_display = ['name', 'stock', 'owner', 'category', 'modified_at']
|
||||
fieldsets = (
|
||||
('Général', {
|
||||
'fields': ('name', 'owner', 'stock', )
|
||||
}),
|
||||
('Info stock',
|
||||
{
|
||||
'fields': (
|
||||
'stock_aviable_p',
|
||||
'ids_aviable_p',
|
||||
'stock_lost_p',
|
||||
'ids_lost_p',
|
||||
),
|
||||
}),
|
||||
('Catégorie', {
|
||||
'fields': ('category', 'full_category_p'),
|
||||
}),
|
||||
('Description', {
|
||||
'fields': ('description', 'added_at', 'modified_at',),
|
||||
}),
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
ordering = ['name', 'owner', 'category']
|
||||
inlines = [EquipmentAttributeValueInline,
|
||||
EquipmentDefaultExtraInline,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue