Hi!
I am creating a simple application for managing articles. It contains of
several entities:

1) categories
2) sections
3) articles

The code:

class Categoty(models.Model):
    categoty = models.CharField(max_length=200)
    name = models.CharField(max_length = 200, help_text="Имя категории")

    def __unicode__(self):
        return u"Категория %s" %self.name

class Section(models.Model):
    section = models.CharField(max_length=200, unique=True)
    name = models.CharField(max_length=200, blank = True)


    def __unicode__(self):
        return u"%s" %(self.section)


class Article (models.Model):
    # Tiny url
    url = models.CharField(max_length = 30, unique=True, help_text
=u"Уникальный короткий url-tag")
    is_published = models.BooleanField(help_text= u"Необходимо отметить для
того что б статья стала опубликованой на сайте")
    author = models.CharField(max_length = 150, help_text = u"Автор.
Использовать только настоящие имена")
    title = models.CharField(max_length = 200, help_text= u"Заголовок
статьи")
    short_description = models.TextField(max_length = 600, help_text =
u"Врез", verbose_name = u"Врез")
    body = tinymce_models.HTMLField()
    #body  = models.TextField(max_length = 10000)
    pub_date = models.DateTimeField('date_published')



I just added new entity (Category). Synced the database and added new
Category to admin.

Strange when I am adding an article with russian text or Section with
russian name, everything is OK
But when I a trying to add a new category via admin, and use name of it in
russian I am getting this exception:

Warning at /admin/articleManager/categoty/add/

Incorrect string value: '\xD0\xB2\xD0\xB2\xD0\xB2' for column 'name' at row 1

Request Method:POSTRequest URL:
http://127.0.0.1:8000/admin/articleManager/categoty/add/Exception Type:
WarningException Value:

Incorrect string value: '\xD0\xB2\xD0\xB2\xD0\xB2' for column 'name' at row 1

Exception Location:/opt/local/lib/python2.5/warnings.py in warn_explicit,
line 102Python Executable:/opt/local/bin/pythonPython Version:2.5.1Python
Path:['/Users/oleg/jin/categoties/trunk/jin',
'/opt/local/lib/python2.5/site-packages/simplejson-1.7.3-py2.5-macosx-10.3-i386.egg',
'/opt/local/lib/python2.5/site-packages/markdown-1.7-py2.5.egg',
'/opt/local/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-macosx-10.3-i386.egg',
'/opt/local/lib/python2.5/site-packages/HarvestMan-2.0.4betadev-py2.5.egg',
'/opt/local/lib/python2.5/site-packages/web.py-0.31-py2.5.egg',
'/opt/local/lib/python2.5/site-packages/sgmlop-1.1.1_20040207-py2.5-macosx-10.3-i386.egg',
'/opt/local/lib/python25.zip', '/opt/local/lib/python2.5',
'/opt/local/lib/python2.5/plat-darwin', '/opt/local/lib/python2.5/plat-mac',
'/opt/local/lib/python2.5/plat-mac/lib-scriptpackages',
'/opt/local/lib/python2.5/lib-tk', '/opt/local/lib/python2.5/lib-dynload',
'/opt/local/lib/python2.5/site-packages',
'/opt/local/lib/python2.5/site-packages/Numeric',
'/opt/local/lib/python2.5/site-packages/PIL']Server time:Wed, 20 May 2009
00:59:39 -0500

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to