forked from gestorpsi/gestorpsi
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Aiming to filter whether current user is scheduled to an apointment when the agenda has a restricted view. Signed-off-by: Carlos Oliveira <carlospecter@gmail.com> Signed-off-by: Cristovao Frinhani <cristovao.frinhani@gmail.com> Signed-off-by: Vinicius Rangel <vinirmv23@gmail.com>
- Loading branch information
Showing
3 changed files
with
17 additions
and
2 deletions.
There are no files selected for viewing
Empty file.
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,15 @@ | ||
from django import template | ||
|
||
register = template.Library() | ||
|
||
@register.filter(name='in_list') | ||
def in_list(value, arg): | ||
value = list(value) | ||
arg = list(arg) | ||
|
||
for el1 in value: | ||
for el2 in arg: | ||
if el1.name == el2.person.name: | ||
return True | ||
|
||
return False |
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