All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Removed readonly on image_urls so URLs can be changed in admin. Added list_editable for day_of_year and color_hex for quick edits. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
30 lines
890 B
Python
30 lines
890 B
Python
from django.contrib import admin
|
|
|
|
from .models import Mineral
|
|
|
|
|
|
@admin.register(Mineral)
|
|
class MineralAdmin(admin.ModelAdmin):
|
|
list_display = ('name', 'formula', 'day_of_year', 'color_hex', 'category')
|
|
list_filter = ('category', 'crystal_system')
|
|
search_fields = ('name', 'formula')
|
|
list_editable = ('day_of_year', 'color_hex')
|
|
fieldsets = (
|
|
(None, {
|
|
'fields': ('name', 'formula', 'day_of_year'),
|
|
}),
|
|
('Appearance', {
|
|
'fields': ('color_hex', 'color_description', 'image_urls'),
|
|
}),
|
|
('Properties', {
|
|
'fields': ('category', 'crystal_system', 'mohs_hardness',
|
|
'luster', 'streak', 'specific_gravity'),
|
|
}),
|
|
('Text', {
|
|
'fields': ('description', 'history'),
|
|
}),
|
|
('Links', {
|
|
'fields': ('wikipedia_url',),
|
|
}),
|
|
)
|