hi all: I write a tag "model_as_table_with", used like this in template : <table> {{model_instance | *model_as_table_with*:"real_name,gender,birthdate,}} </table>
problem was raise in my "*model_as_table_with*" function. this following code is ok when I runserver with "manage.py runserver 8000" *col = "<th>%s:</th><td>%s</td>" % (field.name and field.verbose_name, getattr(model_instance, **field**.name)) * but, when I run my project with " apache + mod_python ". it raise this Exception : "Exception=<type 'exceptions.Exception'>,e='ascii' codec can't decode byte 0xe7 in position 4: ordinal not in range(128)" I have to modify the code like this : *col = "<th>%s:</th><td>%s</td>" % (field.name and field.verbose_name, getattr(**model_instance**, **field**.name).encode('utf-8') **)* all of my code files are set to utf-8, why it is still need to *encode('utf-8') ?* why it is OK in "manage.py runserver 8000" ? but it is not OK when "apach + mod_python" thanks . -- 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.