Re: Strings in page in []

2010-03-22 Thread serek
Hi

You have right.
Thanks you very mach!!!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Strings in page in []

2010-03-22 Thread bruno desthuilliers
On Mar 22, 12:26 am, serek  wrote:
> Hi
>
> I use djangoflashhttp://djangoflash.destaquenet.com/
> and after add message to flash
>             request.flash.add('message', 'test')
> and redirect
> i receive
> ['test']
> instead
> test


Well, that's the documented behaviour : using "flash.add('key',
value)", you get a list back for key - so you have to take care of
this in the template code. If you don't want a list, use either
"flash['key'] = value" or "flash('key', value)" - as documented, cf
http://djangoflash.destaquenet.com/usage.html

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Strings in page in []

2010-03-21 Thread Paulo Almeida
It's not a matter of stripping the brackets, the problem is you are getting
a list.

I suppose you would get the result you want with the following code:

{% if flash %}
   {% for key, value in flash.items %}
   
   {% for v in value %}
   {{ v }}
   {% endfor%}
   
   {% endfor %}
{% endif %}

 Is 'value' always just one value? If it is, you can try:

request.flash['key'] = 'value'

  instead of:

request.flash.add('key', 'one')


I haven't used flash, so I don't know if that works, but the documentations
says it works like a plain dict, so I would expect it to not return a list.

- Paulo

On Sun, Mar 21, 2010 at 11:26 PM, serek  wrote:

> Hi
>
> I use djangoflash http://djangoflash.destaquenet.com/
> and after add message to flash
>request.flash.add('message', 'test')
> and redirect
> i receive
> ['test']
> instead
> test
>
> code which display this:
>
> {% if flash %}
>{% for key, value in flash.items %}
>
>{{ value }}
>
>{% endfor %}
> {% endif %}
>
> Does someone know how strip [' and '] in template?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.