Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure country can still be looked up on the Supporter record #79

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions models.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,14 @@ class Supporter(models.Model):
def size(self):
return self.band.size if self.band else None

@property
def country(self):
return self.band.country if self.band else None

@property
def country_name(self):
return self.band.country.name if self.band and self.band.country else ''

@property
def level(self):
return self.band.level if self.band else None
Expand Down
1 change: 1 addition & 0 deletions views.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def supporters(request):
supporters = supporter_models.Supporter.objects.filter(
active=True,
display=True,
band__isnull=False,
).order_by(
'band__country', 'name'
)
Expand Down