Re: SQLite, swedish signs

2009-02-10 Thread Karen Tracey
On Tue, Feb 10, 2009 at 2:55 PM, DaSa  wrote:

>
> The traceback:
>
> Environment:
>
> Request Method: POST
> Request URL: http://127.0.0.1:8000/admin/polls/poll/add/
> Django Version: 1.0.2 final
> Python Version: 2.5.3
> [snip]
> File "C:\Python25\Lib\site-packages\django\utils\encoding.py" in
> force_unicode
>  52. s = unicode(str(s), encoding, errors)
>
> Exception Type: UnicodeEncodeError at /admin/polls/poll/add/
> Exception Value: 'ascii' codec can't encode character u'\xe5' in
> position 6: ordinal not in range(128)
>

Your original note showed a model named "MyClass", here you seem to be
dealing with adding a "poll" object.  The line of code you have reached here
implies your Poll class does not have a __unicode__ method, and the fix
would be to add a __unicode__ method to Poll.  However your original note
shows MyClass as having a __unicode__ method, so this traceback isn't very
helpful in identifying what is wrong in your MyClass case, since for the
model you originally showed, you would not have reached this last line of
code.

Karen

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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
-~--~~~~--~~--~--~---



Re: SQLite, swedish signs

2009-02-10 Thread Karen Tracey
On Tue, Feb 10, 2009 at 2:55 PM, DaSa  wrote:

>
> The traceback:
>
> Environment:
>
> Request Method: POST
> Request URL: http://127.0.0.1:8000/admin/polls/poll/add/
> Django Version: 1.0.2 final
> Python Version: 2.5.3
> [snip]
> File "C:\Python25\Lib\site-packages\django\utils\encoding.py" in
> force_unicode
>  52. s = unicode(str(s), encoding, errors)
>
> Exception Type: UnicodeEncodeError at /admin/polls/poll/add/
> Exception Value: 'ascii' codec can't encode character u'\xe5' in
> position 6: ordinal not in range(128)
>

Your original note showed a model named "MyClass", here you seem to be
dealing with adding a "poll" object.  The line of code you have reached here
implies your Poll class does not have a __unicode__ method, and the fix
would be to add a __unicode__ method to Poll.  However your original note
shows MyClass as having a __unicode__ method, so this traceback isn't very
helpful in identifying what is wrong in your MyClass case, since for the
model you originally showed, you would not have reached this last line of
code.

Karen

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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
-~--~~~~--~~--~--~---



Re: SQLite, swedish signs

2009-02-10 Thread DaSa

The traceback:

Environment:

Request Method: POST
Request URL: http://127.0.0.1:8000/admin/polls/poll/add/
Django Version: 1.0.2 final
Python Version: 2.5.3
Installed Applications:
['django.contrib.admin',
 'django.contrib.admindocs',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.markup',
 'mysite.polls',
 'mysite.searchApp',
 'mysite.forum']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware')


Traceback:
File "C:\Python25\Lib\site-packages\django\core\handlers\base.py" in
get_response
  86. response = callback(request, *callback_args,
**callback_kwargs)
File "C:\Python25\Lib\site-packages\django\contrib\admin\sites.py" in
root
  157. return self.model_page(request, *url.split('/',
2))
File "C:\Python25\Lib\site-packages\django\views\decorators\cache.py"
in _wrapped_view_func
  44. response = view_func(request, *args, **kwargs)
File "C:\Python25\Lib\site-packages\django\contrib\admin\sites.py" in
model_page
  176. return admin_obj(request, rest_of_url)
File "C:\Python25\Lib\site-packages\django\contrib\admin\options.py"
in __call__
  191. return self.add_view(request)
File "C:\Python25\Lib\site-packages\django\db\transaction.py" in
_commit_on_success
  238. res = func(*args, **kw)
File "C:\Python25\Lib\site-packages\django\contrib\admin\options.py"
in add_view
  499. self.log_addition(request, new_object)
File "C:\Python25\Lib\site-packages\django\contrib\admin\options.py"
in log_addition
  294. object_repr = force_unicode(object),
File "C:\Python25\Lib\site-packages\django\utils\encoding.py" in
force_unicode
  52. s = unicode(str(s), encoding, errors)

Exception Type: UnicodeEncodeError at /admin/polls/poll/add/
Exception Value: 'ascii' codec can't encode character u'\xe5' in
position 6: ordinal not in range(128)


Thanks!

BR
Daniel
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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
-~--~~~~--~~--~--~---



Re: SQLite, swedish signs

2009-02-07 Thread Karen Tracey
On Sat, Feb 7, 2009 at 6:28 AM, Daniel Sandberg
wrote:

>
> I,am getting the following error message when I,am trying to add a swedish
> sign:
> "'ascii' codec can't encode character u'\xe4' in position 4: ordinal not
> in range(128)"
>

Please include the full traceback that comes with the error.

Karen

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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
-~--~~~~--~~--~--~---



SQLite, swedish signs

2009-02-07 Thread Daniel Sandberg
Hi,
I have problem with saving special signs (a.g.  swedish åäö) in my SQlite
database. When I,am  reading about Django and the SQLite database it sais it
should be possible to use UTF-8 signs. But it does not work for me.

I dont't think it is the database settings that is the problem, because I
have downloaded a forum application where I can use swedish signs.

My classes looks like this:


from django.db import models
import datetime

class myClass(models.Model):
testField1 = models.TextField()
testField2  = models.TextField()

def __unicode__(self):
return self. testField1

*

I,am getting the following error message when I,am trying to add a swedish
sign:
"'ascii' codec can't encode character u'\xe4' in position 4: ordinal not in
range(128)"


I,am using Django 1.0.2.


Plz help me!:)


Best regards
Daniel

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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
-~--~~~~--~~--~--~---