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 8088761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:10:54+00:00 2026-06-05T19:10:54+00:00

Hi everyone and couchdb pros, I have a mapping setup like such: class Product(BaseModel):

  • 0

Hi everyone and couchdb pros,

I have a mapping setup like such:

class Product(BaseModel):
  name= mapping.TextField()
  returned = mapping.DictField(mapping.Mapping.build(
    reason = mapping.TextField(),
    put_back = mapping.BooleanField()
  ))

I have a function called getById that takes an id and returns a product via:

return Product.load(db, id)

I have a problem: When I load a particular product, and try to set the returned dictionary like such:

product = Product.getById("123")
product.returned
>>> {}
product.returned['reason'] = "Test"
product.returned
>>> {}

NOTE:
I only recently modified the model to have the “returned” key. Old product objects which are obtained using getById, does not have the “returned” key in them. Would this make a difference? It shouldn’t right, after all this is a document DB and it should be flexible right?

Why does product.returned still return me an empty dictionary after setting the “reason” attribute?

I did some debugging and realized that the product variable is of the form:

<Product u'f90173026e859c65cfa08496115bf7bf'@u'11-3ea1135ceb6361631cbb08471d15df1e' {u'name': u'Printer', u'subProducts': [], u'company': {u'id': u'HP', u'name': u'Hewlett-Packard'}, u'productType':.......>

What kind of result is this? Is it a view result or is it a document?

Any help is greatly appreciated thanks!

Thanks.

  • 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-06-05T19:10:55+00:00Added an answer on June 5, 2026 at 7:10 pm

    I found the problem. Apparently, couchdb-python does not allow you to “create” new keys in documents that were created using a previous mapping model. You would have to manually add the keys you want to all the documents first before you are able to set values for them.

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

Sidebar

Related Questions

everyone. I have a string like this String message = This is the new
everyone! I have sprite moving by action, what have health bar (progress bar). When
everyone seems interested in building IPhone apps today. Do you have to have an
everyone. Please see example below. I'd like to supply a string to 'schedule_action' method
Everyone at Class too big and hard to add new features is completely unphased
Everyone, I am a newbie to android development. Now I have a question that
everyone, I've started working yesterday on the Euler Project in Clojure and I have
everyone..i want after i type 0203-ED in textfield ...two character behind that text can
everyone The problem is if there exists two exported components which have the same
everyone I got a question , I want to implement a UI , Like

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.