Thursday, October 10, 2013

Re: Call method of the session template

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 <ricardokamada@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.nh@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 <ricardokamada@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

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+unsubscribe@googlegroups.com.

--
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+unsubscribe@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+unsubscribe@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+unsubscribe@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.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate