Compare commits
2 commits
9dc9daa1e0
...
8e409d1a38
Author | SHA1 | Date | |
---|---|---|---|
8e409d1a38 | |||
808f1d94bb |
2 changed files with 8 additions and 3 deletions
|
@ -105,6 +105,7 @@ class PersonAdmin(admin.ModelAdmin):
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
list_display = ['id', 'full_name', 'organization']
|
list_display = ['id', 'full_name', 'organization']
|
||||||
|
|
||||||
#autocomplete_fields = ['organization']
|
#autocomplete_fields = ['organization']
|
||||||
form = autocomplete_fields_form # adjust width of autocomplete_fields organization
|
form = autocomplete_fields_form # adjust width of autocomplete_fields organization
|
||||||
|
|
||||||
|
@ -112,7 +113,11 @@ class PersonAdmin(admin.ModelAdmin):
|
||||||
ordering = ['full_name']
|
ordering = ['full_name']
|
||||||
actions = [download_csv]
|
actions = [download_csv]
|
||||||
|
|
||||||
|
def get_field_queryset(self, db, db_field, request):
|
||||||
|
queryset = super().get_field_queryset(db, db_field, request)
|
||||||
|
if db_field.name == 'organization':
|
||||||
|
queryset = queryset.order_by('country','organisation_english')
|
||||||
|
return queryset
|
||||||
class ResourceKeywordInline(admin.TabularInline):
|
class ResourceKeywordInline(admin.TabularInline):
|
||||||
autocomplete_fields = ['keyword']
|
autocomplete_fields = ['keyword']
|
||||||
model = ResourceKeyword
|
model = ResourceKeyword
|
||||||
|
|
|
@ -426,11 +426,11 @@ class Organisation(models.Model):
|
||||||
if self.organisation_english:
|
if self.organisation_english:
|
||||||
if self.organisation_2:
|
if self.organisation_2:
|
||||||
name = f"{self.organisation_english} ({self.organisation_2})"
|
name = f"{self.organisation_english} ({self.organisation_2})"
|
||||||
name = f"{self.country}-{self.organisation_english}-{self.organisation_2}-{self.organisation_3}-{self.acronym}"
|
name = f"{self.country} < {self.organisation_english} < {self.organisation_2} < {self.organisation_3} < {self.acronym}"
|
||||||
|
|
||||||
else:
|
else:
|
||||||
name = f"{self.organisation_english}"
|
name = f"{self.organisation_english}"
|
||||||
name = f"{self.country}-{self.organisation_english}-{self.organisation_2}-{self.organisation_3}-{self.acronym}"
|
name = f"{self.country} < {self.organisation_english} < {self.organisation_2} < {self.organisation_3} < {self.acronym}"
|
||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue