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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:38:04+00:00 2026-06-10T10:38:04+00:00

I am using cherrypy and mongo for a small web application. At some point

  • 0

I am using cherrypy and mongo for a small web application. At some point I want to have a method that returns the object id to a template, ‘_id’ if you may, but parseJSON dismisses it completely. I could rewrite my documents and methods but I was wondering if there is another way around this. In python, I return a dictionary like this:

@cherrypy.expose
@cherrypy.tools.auth(level='mortal')
def add(self, **params):
    if cherrypy.request.method == 'POST':
        # do stuff
        return json.dumps(article)

and in jquery I try to parse it (including the _id variable):

$.ajax({
    url: '/org/add',
    type: 'POST',
    data: data,
    dataType:'json',
    success: function(data) {
        alert(data._id);
    error: function() {
        alert('error');
    }
});

all other variables are returned except _id 🙁 can you help me out on this one?

I’m using python 2.7.5 and jquery 1.8 btw.

  • 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-10T10:38:05+00:00Added an answer on June 10, 2026 at 10:38 am

    I tested with this fiddle http://jsfiddle.net/arhea/GME9S/ and it does not remove underscore properties. It must be your backend code not sending it through. But it should not be the javascript.

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

Sidebar

Related Questions

I have a small Python web application using the Cherrypy framework. I am by
Let's say I have some code (using CherryPy) that looks like this: import cherrypy
I am developing a small web application using cherrypy and I would like to
I have a web application written using CherryPy, which is run locally on 127.0.0.1:4321
I'm in the process of building a web application using cherrypy. What template technology
I'm currently writing a small python app that embeds cherrypy and django using py2app.
I have a cherryPy program that returns a page that has an image (plot)
I have some javascript code that loads images dynamically in a web page: imageSrc
quick question: I have created a web server using CherryPy. It requires authentication for
I'm writing an application in python using CherryPy and Jinja as the template system.

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.