Skip to content

Commit

Permalink
cove_rdls/templatetags/validator_table.py: Add template tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Ed (ODSC) committed Sep 4, 2023
1 parent b19ed73 commit 6377b3d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cove_rdls/templatetags/validator_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,19 @@
@stringfilter
def property_name(value):
return value.split("/")[0]


@register.filter
def start_end(value):
if isinstance(value, list):
if value[-1] == "start" or value[-1] == "end":
return True
return False


@register.filter
def links_rel(value):
if isinstance(value, list):
if len(value) > 1 and "links" in value and value[-1] == "rel":
return True
return False

0 comments on commit 6377b3d

Please sign in to comment.