Re: Django-admin-tools unicode problem

2013-06-28 Thread Roberto López López

Hi,

I can perfectly understand Portuguese, but it's not the case for many
users of this mailing list. Please, stick to English...

Cheers,

Roberto



On 06/28/2013 01:35 PM, Sandro Dutra wrote:
> Como o Gilberto postou, pode haver um problema quando o teu editor de
> textos salva o arquivo do template, tente abrir este template pelo
> bloco de notas e ao 'salvar como' deve haver um campo lá embaixo para
> selecionar a 'Codificação', selecione UTF-8 e salve ou tente a
> configuração relativa no editor de textos que está a utilizar, talvez
> isto resolva o problema.
>
> Eu já tive esses problemas quando usava Notepad++, mas tenho utilizado
> PyCharm e não tive mais este tipo de problema, há opções gratuitas que
> devem lidar com isto também, tais como Sublime e Aptana.
>
>
> 2013/6/27 Jaimerson Leandro Amaro de Araújo  >
>
> Cara, o problema é que a exceção tá sendo no template do
> aplicativo, que lê as informações do banco de dados. Alterar os
> arquivos do admin-tools é inviável em termos de portabilidade na
> hora do deploy. O que eu quero saber é se é possível mudar o
> encoding padrão desse app.
>
> Em quarta-feira, 26 de junho de 2013 11h22min18s UTC-3, Odin
> escreveu:
>
> Jaimerson, ainda assim creio que você deva tentar adicionar ao
> topo de suas views e/ou dos módulos usados do admin-tools a
> linha:
>
> # -*- coding: utf-8 -*- ou # -*- coding: iso-8859-1 -*-
>
> Isso permitirá ao Python ler o arquivo no encoding definido.
>
>
> 2013/6/26 Jaimerson Leandro Amaro de Araújo
> 
>
> 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
> 
>
> (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  at 0xb581d98c> ()
>
> [...]
>
>
> 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...@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.
>  

Re: Django-admin-tools unicode problem

2013-06-28 Thread Sandro Dutra
Como o Gilberto postou, pode haver um problema quando o teu editor de
textos salva o arquivo do template, tente abrir este template pelo bloco de
notas e ao 'salvar como' deve haver um campo lá embaixo para selecionar a
'Codificação', selecione UTF-8 e salve ou tente a configuração relativa no
editor de textos que está a utilizar, talvez isto resolva o problema.

Eu já tive esses problemas quando usava Notepad++, mas tenho utilizado
PyCharm e não tive mais este tipo de problema, há opções gratuitas que
devem lidar com isto também, tais como Sublime e Aptana.


2013/6/27 Jaimerson Leandro Amaro de Araújo 

> Cara, o problema é que a exceção tá sendo no template do aplicativo, que
> lê as informações do banco de dados. Alterar os arquivos do admin-tools é
> inviável em termos de portabilidade na hora do deploy. O que eu quero saber
> é se é possível mudar o encoding padrão desse app.
>
> Em quarta-feira, 26 de junho de 2013 11h22min18s UTC-3, Odin escreveu:
>>
>> Jaimerson, ainda assim creio que você deva tentar adicionar ao topo de
>> suas views e/ou dos módulos usados do admin-tools a linha:
>>
>> # -*- coding: utf-8 -*- ou # -*- coding: iso-8859-1 -*-
>>
>> Isso permitirá ao Python ler o arquivo no encoding definido.
>>
>>
>> 2013/6/26 Jaimerson Leandro Amaro de Araújo 
>>
>> 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 

> (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  0xb581d98c> ()
>
> [...]
> 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/**grou**ps/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...@**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.
>
>
>

-- 
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.




Re: Django-admin-tools unicode problem

2013-06-27 Thread Jaimerson Leandro Amaro de Araújo
Cara, o problema é que a exceção tá sendo no template do aplicativo, que lê 
as informações do banco de dados. Alterar os arquivos do admin-tools é 
inviável em termos de portabilidade na hora do deploy. O que eu quero saber 
é se é possível mudar o encoding padrão desse app.

Em quarta-feira, 26 de junho de 2013 11h22min18s UTC-3, Odin escreveu:
>
> Jaimerson, ainda assim creio que você deva tentar adicionar ao topo de 
> suas views e/ou dos módulos usados do admin-tools a linha:
>
> # -*- coding: utf-8 -*- ou # -*- coding: iso-8859-1 -*-
>
> Isso permitirá ao Python ler o arquivo no encoding definido.
>
>
> 2013/6/26 Jaimerson Leandro Amaro de Araújo  >
>
>> 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 
>>>
 (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  
 ()

 [...]
 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...@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.




Re: Django-admin-tools unicode problem

2013-06-27 Thread gilberto dos santos alves
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: x -*-.
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 
>>
>>> (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  
>>> ()
>>>
>>> [...]
>>> 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.




Re: Django-admin-tools unicode problem

2013-06-26 Thread Sandro Dutra
Jaimerson, ainda assim creio que você deva tentar adicionar ao topo de suas
views e/ou dos módulos usados do admin-tools a linha:

# -*- coding: utf-8 -*- ou # -*- coding: iso-8859-1 -*-

Isso permitirá ao Python ler o arquivo no encoding definido.


2013/6/26 Jaimerson Leandro Amaro de Araújo 

> 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 
>>
>>> (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  
>>> ()
>>>
>>> [...]
>>> 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.
>
>
>

-- 
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.




Re: Django-admin-tools unicode problem

2013-06-26 Thread Jaimerson Leandro Amaro de Araújo
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  >
>
>> (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  
>> ()
>>
>> [...]
>> 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.




Re: Django-admin-tools unicode problem

2013-06-26 Thread Sandro Dutra
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 

> (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  
> ()
>
> [...]
> 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+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.
>
>
>

-- 
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.




Django-admin-tools unicode problem

2013-06-26 Thread Jaimerson Leandro Amaro de Araújo
(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  ()

[...]
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+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.




Django-admin-tools unicode problem

2013-06-26 Thread Jaimerson Leandro Amaro de Araújo
(I have posted this on django-admin-tools specific mailing 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  ()

[...]
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+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.