橋元です。
さっそくの回答ありがとうございます。
やはりIPythonのバグですかね。
bpython試してみようと思います。
2012年7月25日 12:42 Ian Lewis <ianmle...@gmail.com>:
> イアンです。
>
> これは iPython
> のバグだと思われますね。 自分のアプリケーションや、Pythonや、Djangoにバグがあるわけだはないので、その面は安心してください。 readline
> と iPython
> を最新版に更新したりするとよくなったりはするけど、どうも直らない時もあると思います。そのバグの原因を探して、地味に潰していくしかないと思います。
>
> 最近僕は、iPython より bpython 使っているので、bpython をおすすめします。 内蔵で同じ readline
> に頼っているので、日本語入出力にも細かいバグがあったりしますが、iPython よりは快適に使えると思います。 (manage.py shell
> で使うには、iPythonをアンインストールする必要がありますが)
>
> 2012/7/25 so_hashimoto <so.hashi...@gmail.com>
>
>> こんにちは、橋元と申します。
>>
>> Django 1.4 の manage.py shell で API を触っていて気づいたのですが、
>> CLI上で日本語が文字化けするときとしないときがあります。
>>
>> # Personモデル(例)
>> >>> from myapp.models import Person
>> >>> p = Person.objects.get(id=1)
>>
>> >>> user = {'obj': p, 'id': p.id}
>> >>> user
>> {'id': 1L, 'obj': <Person: 1 讖句� 閨。 (pk=1)>}
>>
>> # idをfloatに変換してみると、文字化けしない
>> >>> user = {'obj': p, 'id': float(p.id)}
>> >>> user
>> {'id': 1.0, 'obj': <Person: 1 橋元 聡 (pk=1)>}
>> >>>
>>
>> ちなみにPersonモデルの__repr__は定義していません。
>>
>> この挙動は既知のものでしょうか?
>> どなたかご存知でしたら、教えてください。
>>
>> --
>> ----------------- http://djangoproject.jp/ -----------------
>> You received this message because you are subscribed to the Google Groups
>> "django-ja" group.
>> To post to this group, send email to django-ja@googlegroups.com
>> To unsubscribe from this group, send email to
>> django-ja-unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/django-ja
>
>
>
>
> --
> Ian
>
> http://www.ianlewis.org/
>
> --
> ----------------- http://djangoproject.jp/ -----------------
> You received this message because you are subscribed to the Google Groups
> "django-ja" group.
> To post to this group, send email to django-ja@googlegroups.com
> To unsubscribe from this group, send email to
> django-ja-unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/django-ja
>
--
----------------- http://djangoproject.jp/
-----------------
You received this message because you are subscribed to the Google Groups
"django-ja" group.
To post to this group, send email to django-ja@googlegroups.com
To unsubscribe from this group, send email to
django-ja-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-ja