Hi, 

I am new to Django and need some help. My issue is on my web page the data 
is showing up like this: [u'Green'] and I want it to only show Green - 
without the unicode wrapping. Can you please explain why this is happening 
and how do I fix it? 

Here is my code. 

*models.py:*

Class Name(models.Model):

name = models.CharField(_('name'), max_length=100)

number = models.ForeignKey(Number)

*views.py:*

def enter_name(request):

    my_number = request.user.number

    name = Name.objects.filter(pk=my_number).values_list('city', flat=True)

template.html:

{{ name|safe }}

 

Prints on the web page:

[u’Green’]

-- 
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/8287f841-2442-4f57-b46a-ca071fe839a8%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to