forked from edwardchalstrey1/seshat
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d9e331e
commit e34593e
Showing
1 changed file
with
0 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +0,0 @@ | ||
from django import template | ||
|
||
register = template.Library() | ||
|
||
|
||
@register.filter | ||
def get_attributes(obj): | ||
""" | ||
A custom filter to get all attributes of an object in a template. | ||
Args: | ||
obj (object): The object to get attributes from. | ||
Returns: | ||
dict: A dictionary of the object's attributes. | ||
""" | ||
return vars(obj) | ||
|
||
|
||
@register.filter | ||
def zip_lists(a, b): | ||
""" | ||
A custom filter to zip two lists together in a template. | ||
Args: | ||
a (list): The first list to zip. | ||
b (list): The second list to zip. | ||
Returns: | ||
zip: A zip object of the two lists. | ||
""" | ||
return zip(a, b) | ||