Some checks reported errors
continuous-integration/drone/push Build was killed
49 lines
1.4 KiB
Python
49 lines
1.4 KiB
Python
from django.contrib import admin
|
|
from .models import Country, GeoScenario, OptScenario
|
|
|
|
|
|
@admin.register(Country)
|
|
class CountryAdmin(admin.ModelAdmin):
|
|
list_display = ('code', 'name')
|
|
search_fields = ('code', 'name')
|
|
ordering = ('name',)
|
|
|
|
|
|
@admin.register(GeoScenario)
|
|
class GeoScenarioAdmin(admin.ModelAdmin):
|
|
list_display = ('name', 'country', 'upload_date', 'geographic_field_name')
|
|
list_filter = ('country', 'upload_date')
|
|
search_fields = ('name', 'country__name')
|
|
readonly_fields = ('upload_date',)
|
|
fieldsets = (
|
|
(None, {
|
|
'fields': (
|
|
'name',
|
|
'country',
|
|
'geographic_field_name',
|
|
'csv_file',
|
|
'upload_date',
|
|
)
|
|
}),
|
|
)
|
|
|
|
|
|
@admin.register(OptScenario)
|
|
class OptScenarioAdmin(admin.ModelAdmin):
|
|
list_display = ('name', 'geo_scenario', 'type_of_waste', 'strategy', 'upload_date')
|
|
list_filter = ('type_of_waste', 'upload_date')
|
|
search_fields = ('name', 'geo_scenario__name', 'strategy')
|
|
readonly_fields = ('upload_date',)
|
|
fieldsets = (
|
|
(None, {
|
|
'fields': (
|
|
'geo_scenario',
|
|
'name',
|
|
'type_of_waste',
|
|
'strategy',
|
|
'optimized_csv',
|
|
'upload_date',
|
|
)
|
|
}),
|
|
)
|