No.  You can't pass an argument to a model method from the template.  I see
two options for you:
1.  Rework the method so that the argument is optional, and if the argument
is not provided, the method uses a reasonable default (maybe item.product?).
2. Write a custom template filter that lets you supply an argument


On Thu, Oct 10, 2013 at 3:17 PM, Ricardo Kamada <ricardokam...@gmail.com>wrote:

> I tried numerous times ...
> but if I put that way
> {% 'item.remove_single' item.product %} or {% 'item.remove_single'
> product= item.product %}
> blames this error " Invalid block tag: ''item.remove_single'', expected
> 'empty' ou 'endfor' "
>
> Ricardo
>
>
> 2013/10/10 Bill Freeman <ke1g...@gmail.com>
>
>> The remove method requires an argument.  You're not supplying one (you
>> can't in a template variable reference).
>>
>>
>> On Thu, Oct 10, 2013 at 1:29 PM, Ricardo <ricardokam...@gmail.com> wrote:
>>
>>> Hi, I'm using django carton to shopping cart.
>>> I am not able to call the method remove_single in my template. on line 15
>>> I tried several ways but I can not.
>>> If you can help
>>>
>>> carton      ---> http://pastebin.com/X4FtHRZU
>>> template  ---> http://pastebin.com/0AJYFB1x
>>>
>>> thank you
>>> Ricardo
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>>
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/b67afb27-366b-4570-85a6-58900322fa3e%40googlegroups.com
>>> .
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>  --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/django-users/AzIxhSQpGws/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> django-users+unsubscr...@googlegroups.com.
>>
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAB%2BAj0tPL8y7zBwv8RvaBP29D77dALP84WVv_tbHRd1xELfveg%40mail.gmail.com
>> .
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJTdXTH%2BH0BAqRsnKOpvyX75no01n7aUn7YvLgcOY-_jjVB8Wg%40mail.gmail.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAB%2BAj0vcxejBiG5TEaGNWWiX389ydJgp_WQ7wVaaukF8Ast5sg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to