-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #185 from EarthSchlange/update_beta_pages
update beta pages
- Loading branch information
Showing
20 changed files
with
561 additions
and
482 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import agagd_core.models as agagd_models | ||
from django.core.exceptions import ObjectDoesNotExist | ||
from django.templatetags.static import static | ||
from django.urls import reverse | ||
from jinja2 import Environment | ||
|
||
|
||
def get_members_name_and_id(value): | ||
""" | ||
Provides jinja2 custom filter which returns | ||
the members information as | ||
"[member's full name] (member_id)". | ||
""" | ||
try: | ||
member = agagd_models.Member.objects.values("full_name", "member_id").get( | ||
pk=value | ||
) | ||
except ObjectDoesNotExist: | ||
raise ("Member {value} does not exist.") | ||
|
||
return f"{member['full_name']} ({member['member_id']})" | ||
|
||
|
||
def environment(**options): | ||
env = Environment(**options) | ||
env.filters["get_members_name_and_id"] = get_members_name_and_id | ||
env.globals.update({"static": static, "url": reverse}) | ||
return env |
Oops, something went wrong.