<commit_before>from django import template
from django.conf import settings

from generic_scaffold import get_url_names

register = template.Library()

@register.simple_tag
def get_url_for_action(prefix, action):
    url = get_url_names(prefix)[action]
    return url

@register.assignment_tag
def set_url_for_action(prefix, action):
    url = get_url_names(prefix)[action]
    return url<commit_msg>Improve templatetag to use either prefix or ...<commit_after>from django import template
from django.conf import settings

from generic_scaffold import get_url_names

register = template.Library()

@register.assignment_tag
def set_urls_for_scaffold(app=None, model=None, prefix=None):
    url_name = get_url_names(app, model, prefix)
    return url_name
{'fraction_non_alphanumeric': 0.07436918990703852, 'fraction_numerical': 0.0, 'mean_word_length': 6.046728971962617, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3134955', 'n_tokens_mistral': 233, 'n_tokens_neox': 233, 'n_words': 61}