#146 Admins and update_all_parcels.py
* extends admin backend
* adds found_in_codelists to KonovaCodeAdmin to see where a KonovaCode can be found in
* improves rendering of after_states and before_states for all AbstractCompensationAdmins
* adds geometry_id to all major datatype admin backends
* adds st_area like calculation to geometry admin backend
* update_all_parcels
* orders geometries by size (small to big) to process smaller geometries first and bigger later
* adds more output to command for a better overview of what is just going on
This commit is contained in:
@@ -21,16 +21,30 @@ class AbstractCompensationAdmin(BaseObjectAdmin):
|
||||
"identifier",
|
||||
"title",
|
||||
"comment",
|
||||
"after_states",
|
||||
"before_states",
|
||||
"list_after_states",
|
||||
"list_before_states",
|
||||
"geometry",
|
||||
]
|
||||
|
||||
def get_readonly_fields(self, request, obj=None):
|
||||
return super().get_readonly_fields(request, obj) + [
|
||||
"after_states",
|
||||
"before_states",
|
||||
"list_after_states",
|
||||
"list_before_states",
|
||||
"geometry",
|
||||
]
|
||||
|
||||
def list_after_states(self, obj):
|
||||
states = obj.after_states.all()
|
||||
states = [str(state) for state in states]
|
||||
states = "\n".join(states)
|
||||
return states
|
||||
|
||||
def list_before_states(self, obj):
|
||||
states = obj.before_states.all()
|
||||
states = [str(state) for state in states]
|
||||
states = "\n".join(states)
|
||||
return states
|
||||
|
||||
|
||||
class CompensationAdmin(AbstractCompensationAdmin):
|
||||
autocomplete_fields = [
|
||||
|
||||
Reference in New Issue
Block a user