From 1c417301bf19215d4e5e1e2093a12a45dd68d24c Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 22 Nov 2021 13:57:56 +0530 Subject: [PATCH] Add fieldsets for Persons model --- app/admin.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/app/admin.py b/app/admin.py index cce7f68..be66288 100644 --- a/app/admin.py +++ b/app/admin.py @@ -4,6 +4,44 @@ from .models import * class PersonAdmin(admin.ModelAdmin): search_fields = ['title', 'first_name', 'last_name', 'organisation', 'position', 'country__short_name', 'contact_email'] + fieldsets = ( + (None, { + 'fields': ( + ('mr_mrs', 'title','full_name', 'position'), + ('first_name', 'last_name', 'search_name', 'status'), + ('contact_email', 'email_2', 'skype', 'professional_phone'), + 'organization', + 'personal_url', + 'biography', + 'field_of_expertise', + 'geographic_area_of_expertise') + }), + ('Research Scale', { + 'classes': ('collapse',), + 'fields': ('field_site', 'transect', 'mountain_top', 'mountain_range', 'landscape', 'regional', 'national', + '_global'), + }), + ('Methods and tools', { + 'classes': ('collapse',), + 'fields': ('biological_field_sampling', 'geographic_area_of_expertise', 'data_mining', 'remote_sensing', + 'gis', 'spatial_analysis', 'statistical_analysis', 'modelling', 'assessment', 'meta_analysis', + 'synthesis', 'qualitative_ssm', 'genetic_analyses'), + }), + ('Taxonomic groups', { + 'classes': ('collapse',), + 'fields': ('birds', 'mammals', 'reptiles', 'amphibians', 'fish', 'insects', 'molluscs', 'crustaceans', + 'arachnids', 'angiosperms', 'gymnpsperms', 'fungi', 'algae', 'microbes'), + }), + ('Others', { + 'classes': ('collapse',), + 'fields': ('orcid', 'web_of_science', 'twitter', 'instagram', 'updated', + ('news_letter', 'profile_on_web'), + 'entry_date', + 'country', + 'gmba_function' + ), + }), + ) class ResourceAdmin(admin.ModelAdmin):