Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7070965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:37:49+00:00 2026-05-28T05:37:49+00:00

Ubuntu 10.04.3 LTS mongodb-1.2.2-1ubuntu1.1 django 1.3 mongoengine-0.5.2 pymongo-2.1.2 model: class User(Document): email = StringField(required=True)

  • 0

Ubuntu 10.04.3 LTS
mongodb-1.2.2-1ubuntu1.1
django 1.3
mongoengine-0.5.2
pymongo-2.1.2

model:

class User(Document):
    email = StringField(required=True)
    first_name = StringField(max_length=50)
    last_name = StringField(max_length=50)


class Comment(EmbeddedDocument):
    content = StringField()
    name = StringField(max_length=120)

class Post(Document):
    title = StringField(max_length=120, required=True)
    author = ReferenceField(User)
    tags = ListField(StringField(max_length=30))
    comments = ListField(EmbeddedDocumentField(Comment))

class TextPost(Post):
    content = StringField()

class ImagePost(Post):
    image_path = StringField()

class LinkPost(Post):
    link_url = StringField()

trying to save a Post in which the title has the caracter “é”:

 john = User(email='jdoe@example.com', first_name='John', last_name='Doe')
    john.save()


post1 = TextPost(title='Fun with MongoEnginée', author=john)
post1.content = 'Took a look at MongoEngine today, looks pretty cool.'
post1.tags = ['mongodb', 'mongoengine']
post1.save()

the following exception is thrown:

Traceback (most recent call last):
  File "/home/raton/aptana_work/test/mongo/test1/cobertura/tests.py", line 27, in create_relato
    post1.save()
  File "/home/raton/aptana_work/test/mongo/env/lib/python2.7/site-packages/mongoengine-0.5.2-py2.7.egg/mongoengine/document.py", line 149, in save
    doc = self.to_mongo()
  File "/home/raton/aptana_work/test/mongo/env/lib/python2.7/site-packages/mongoengine-0.5.2-py2.7.egg/mongoengine/base.py", line 648, in to_mongo
    data[field.db_field] = field.to_mongo(value)
  File "/home/raton/aptana_work/test/mongo/env/lib/python2.7/site-packages/mongoengine-0.5.2-py2.7.egg/mongoengine/base.py", line 127, in to_mongo
    return self.to_python(value)
  File "/home/raton/aptana_work/test/mongo/env/lib/python2.7/site-packages/mongoengine-0.5.2-py2.7.egg/mongoengine/fields.py", line 40, in to_python
    return unicode(value)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 19: ordinal not in range(128)

Any help please??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:37:49+00:00Added an answer on May 28, 2026 at 5:37 am

    Try this:

    post1 = TextPost(title=u'Fun with MongoEnginée', author=john)
    post1.content = 'Took a look at MongoEngine today, looks pretty cool.'
    post1.tags = ['mongodb', 'mongoengine']
    post1.save()
    

    The important part is declaring your string as unicode: u‘Fun with MongoEnginée’

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an environment setup on Ubuntu 10.04 LTS to run a Django website
I had an unclean shutdown of MongoDB on Ubuntu 10.04 LTS. Now when I
I am attempting to load user data into an Ubuntu 12.04 LTS AMI (ami-a29943cb,
I'm using django-pyodbc as database backend on Ubuntu 12.04 LTS and MSSQL 2008 on
I am new in ubuntu 12.04 LTS . I want to create list file
First thing is I am on Ubuntu 12.04 LTS. When I type rails s
I am running Ubuntu Server 12.04 LTS as the guest operating system. How many
I'm currently building a ubuntu (10.0.4 LTS) server on a VPS to host a
I'm attempting to make the switch from Windows to ubuntu (am using 12.04 LTS)
I am compiling on Ubuntu 10.04 LTS. The Perforce Python API uses their C++

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.