diff options
| author | Paolo Melchiorre <paolo@melchiorre.org> | 2022-12-25 17:04:59 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-25 10:04:59 -0600 |
| commit | a59d6f55baca966cee3b6f31416fe8e6c42721ad (patch) | |
| tree | 5558c10922be8a921dbcb46e47b4dd374724df08 /foundation | |
| parent | 5b58b15c2113a28c2edc452ad6d04c8915acf148 (diff) | |
Fixed #1293 -- Modernize to Django 3.2/Python 3.8 (#1294)
Diffstat (limited to 'foundation')
| -rw-r--r-- | foundation/admin.py | 3 | ||||
| -rw-r--r-- | foundation/models.py | 8 |
2 files changed, 4 insertions, 7 deletions
diff --git a/foundation/admin.py b/foundation/admin.py index 64212909..4606a264 100644 --- a/foundation/admin.py +++ b/foundation/admin.py @@ -20,11 +20,10 @@ class BoardMemberAdmin(admin.ModelAdmin): list_select_related = True raw_id_fields = ("account",) + @admin.display(ordering="account__last_name") def full_name(self, obj): return obj.account.get_full_name() - full_name.admin_order_field = "account__last_name" - @admin.register(models.NonBoardAttendee) class NonBoardAttendeeAdmin(admin.ModelAdmin): diff --git a/foundation/models.py b/foundation/models.py index ad36ea28..4366ae8b 100644 --- a/foundation/models.py +++ b/foundation/models.py @@ -47,9 +47,7 @@ class BoardMember(models.Model): ) def __str__(self): - return "{} ({} - {})".format( - self.account.get_full_name(), self.office, self.term.year - ) + return f"{self.account.get_full_name()} ({self.office} - {self.term.year})" class NonBoardAttendee(models.Model): @@ -66,7 +64,7 @@ class NonBoardAttendee(models.Model): verbose_name_plural = "Non-board attendees" def __str__(self): - return "{} ({})".format(self.name, self.role) + return f"{self.name} ({self.role})" class Meeting(models.Model): @@ -142,7 +140,7 @@ class ApprovedGrant(models.Model): ordering = ("entity",) def __str__(self): - return "{}: {}".format(self.entity, self.amount) + return f"{self.entity}: {self.amount}" class ApprovedIndividualMember(models.Model): |
