tudo depende do seu editor de texto. por exemplo no windows em português do 
brasil normalmente é usado o cp1250 como padrão. mas na hora de salvar o 
seu arquivo você pode escolher salvá-lo como utf-8 (aí no início do código 
vai a correspondente diretiva) se preferir salvar em outro codepage deve 
declarar esse codepage na diretiva  -*- coding: xxxxx -*-.
quando você define os nomes dos códigos de página unicode é possivel nomear 
os "elementos" do seu modelo usando acentuação e os caracteres da nossa 
língua. Estou nos finalmente das "modificações"  sugestões para que o 
tutorial da versão 1.6 contemple algumas explicações adicionais para nós 
que não usamos só a língua inglesa.

# -*- coding: utf-8 -*-


from django.db import models
class Poll(models.Model):
    questão = models.CharField(max_length=200)
    pub_date = models.DateTimeField('data da publicação')
class Choice(models.Model):
    poll = models.ForeignKey(Poll)
    choice_text = models.CharField(max_length=200)
    votes = models.IntegerField(default=0)



Em quarta-feira, 26 de junho de 2013 11h11min20s UTC-3, Jaimerson Leandro 
Amaro de Araújo escreveu:
>
> Uh, I know it`s an encoding problem, I was hoping there was a way of 
> changing default charset for that app.
>
> Em quarta-feira, 26 de junho de 2013 10h16min02s UTC-3, Odin escreveu:
>>
>> Think it's an encode problem. I never use this app but try to add this 
>> line o top of your views file:
>>
>> # -*- coding: utf-8 -*-
>>
>>
>> 2013/6/26 Jaimerson Leandro Amaro de Araújo <jaimers...@gmail.com>
>>
>>> (I posted this on django-admin-tools mail list, but apparently there's 
>>> no one alive there)
>>>
>>>
>>> Hello, I'm stuck in a encoding issue, on the dashboard template. Some of 
>>> my models have fields with non-ascii characters (like "à" or "á"), and when 
>>> I try to load the page, I get the following error:
>>> DjangoUnicodeDecodeError at / 
>>>
>>> 'ascii' codec can't decode byte 0xc3 in position 5: ordinal not in 
>>> range(128).
>>> You passed in <django.utils.functional.__**proxy__ object at 0xb581d98c> 
>>> (<class 'django.utils.functional.__**proxy__'>)
>>>
>>> [...]
>>> Unicode error hint 
>>>
>>> The string that could not be encoded/decoded was: *Conte��do*
>>> Please, advise. 
>>>
>>> -- 
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> 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.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to