-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for a customizable fallback mapper #7
Conversation
This feature makes sense to me. 👍 I'm not sure about the setting name, though. I wonder if something like "component_fallback_mapper", "component_mapper", or "default_component_mapper" would be more clear? What do you think? To merge in I'd add docs to Warning, tangent ahead: The use of |
I think I like "default_component_mapper" best... it's also the longest though
I'll take a look at how you write your tests, I haven't touched pytest in ages... Re: tangent
What do you think? I'll change the settings name and get started on the docs |
09230b5
to
65da394
Compare
Let's go with that! I'd rather be explicit than terse. :)
This is a good idea! |
It should start looking somewhat ok. But....
|
The |
ruff 0.7.0 |
I've rebased on main and I'll ignore the 2 ruff errors for now |
@all-contributors please add @nanuxbe for code, tests, and docs |
I've put up a pull request to add @nanuxbe! 🎉 |
Hello,
I'm not sure whether you're accepting pull requests or not. If you're not, feel free to close!
My thinking here is to be able to set a
fallback_mapper
in the settings that defaults todj_angles.mappers.django.map_include
.What one would be able to able to accomplish by switching the fallback mapper is to use their favorite component library as fallback instead of
{% include %}
.So for example, assuming django bird, with the appropriate mapper:
<dj-partial />
would be mapped to{% bird partial %}{% endbird %}
instead of{% include 'partial.html' %}
I'm opening this as draft, as if that's something you'd be interested in, documentation would be needed