remove django-url-tools in favor of core_tags snippet

This commit is contained in:
Nick Sweeting 2024-10-03 18:25:20 -07:00
parent 3f1a19dd35
commit 89a066da0b
No known key found for this signature in database
3 changed files with 21 additions and 16 deletions

View file

@ -99,7 +99,6 @@ INSTALLED_APPS = [
'django_jsonform', # handles rendering Pydantic models to Django HTML widgets/forms https://github.com/bhch/django-jsonform
'signal_webhooks', # handles REST API outbound webhooks https://github.com/MrThearMan/django-signal-webhooks
'django_object_actions', # provides easy Django Admin action buttons on change views https://github.com/crccheck/django-object-actions
'url_tools', # adds template tags to append/toggle URL parameters https://bitbucket.org/monwara/django-url-tools
# Our ArchiveBox-provided apps
#'config', # ArchiveBox config settings (loaded as a plugin, don't need to add it here)
@ -204,7 +203,6 @@ TEMPLATES = [
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'url_tools.context_processors.current_url',
],
},
},

View file

@ -38,3 +38,9 @@ def result_list_tag(parser, token):
template_name='snapshots_grid.html',
takes_context=False,
)
@register.simple_tag(takes_context=True)
def url_replace(context, **kwargs):
dict_ = context['request'].GET.copy()
dict_.update(**kwargs)
return dict_.urlencode()