Passing {% url '' %} to components
#290
Answered
by
alexandremjacques
alexandremjacques
asked this question in
Q&A
|
Hi, I was trying to create a component that would receive an What would be a correct approach to that? I was trying something like bellow. It fails on TIA |
Answered by
alexandremjacques
Jun 11, 2025
Replies: 1 comment 1 reply
|
@alexandremjacques I wonder if this pattern resolves it. {% for seller in sellers %}
<c-layer-btn
accept_location="{% url 'sellers:home' %}"
on_accepted="sellers-list"
size="medium"
icon="ti ti-edit"
text="{% translate 'Editar' %}">
<c-slot name="url">{% url 'sellers:edit' seller.id %}</c-slot>
</c-layer-btn>
{% endfor %} |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Actually, my first approach works fine. Mistakenly I passed
seller.idinstead ofseller.seller_id.Sorry for the confusion.
Thanks for the tip.