Hi,
I was wondering what is the best way to define new tags which don't
really belong to a specific application.
For example, I would like to create a urlmatch tag:
{% urlmatch "^accouonts/login/$" }
Should only be display the current url matches the specified reg-ex
{% endurlmatch %}
Lookin through the documenation I have found how the define new
tags/filters, but only if the are associated to an application.
I was more thinking about defining middelware which does nothing more
than extending the "defaut" tags.
So I tried this aproach and found out that this will not work since the
newly create `library` is not accessable outside of the `application`
where it is defined in.
So I digged into the code to see how all the other default tags are
defined and found the function `add_to_builtins`. It seems that this
function does exactly what I was looking for.
But before I go ahead with this solution I would like to see if
somebody has a better idea on how the extend the default tags?
Is it using the `add_to_builtins` the way to go?
Is a middleware the way to go or is there a better solution?
Any commets are welcome,
Martin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---