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

  • SEARCH
  • Home
  • 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 8783863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:56:12+00:00 2026-06-13T20:56:12+00:00

I persist such an entity in one RequestHandler and can verify through SDK console:

  • 0

I persist such an entity in one RequestHandler and can verify through SDK console:

class Moment(db.Model):
    user = db.IntegerProperty()
    index = db.IntegerProperty()

EDIT: I previously only included the partial class definition, and didn’t show how I was writing the model. The following is the full example:

class Moment(db.Model):
    user = db.IntegerProperty()
    index = db.IntegerProperty()
    date = db.DateTimeProperty()
    qx = db.FloatProperty()
    qy = db.FloatProperty()
    qz = db.FloatProperty()
    qw = db.FloatProperty()
    latitude = db.FloatProperty()
    longitude = db.FloatProperty()
    image = db.BlobProperty()
    def __init__(self, obj):
        super(Moment,self).__init__()
        self.user = obj['user']
        self.index = obj['index']
        self.date = obj['date']
        self.qx = obj['qx']
        self.qy = obj['qy']
        self.qz = obj['qz']
        self.qw = obj['qw']
        self.latitude = obj['latitude']
        self.longitude = obj['longitude']
        self.image = obj['image']

class UploadHandler(webapp2.RequestHandler):
    def post(self):
        obj = biplist.readPlistFromString(self.request.body)
        Moment(obj).put()

When I try filtered get…

class ServeHandler(webapp2.RequestHandler):
    def get(self):
        params = {}
        params['user'] = int(self.request.get('user'))
        params['index'] = int(self.request.get('index'))
        q = Moment.all()
        q.filter("user =", params['user'])
        q.filter("index =", params['index'])
        print q.get()

I get the following:

ERROR    2012-11-04 06:56:04,846 webapp2.py:1553] __init__() got an unexpected keyword argument 'index'
Traceback (most recent call last):
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 1536, in __call__
    rv = self.handle_exception(request, response, e)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 1530, in __call__
    rv = self.router.dispatch(request, response)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 1278, in default_dispatcher
    return route.handler_adapter(request, response)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 1102, in __call__
    return handler.dispatch()
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 572, in dispatch
    return self.handle_exception(e, self.app.debug)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 570, in dispatch
    return method(*args, **kwargs)
  File "<path>/main.py", line 51, in get
    print q.get()
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/db/__init__.py", line 2102, in get
    return results.next()
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/db/__init__.py", line 2314, in next
    return self.__model_class.from_entity(self.__iterator.next())
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/db/__init__.py", line 1442, in from_entity
    return cls(None, _from_entity=entity, **entity_values)
TypeError: __init__() got an unexpected keyword argument 'index'
INFO     2012-11-04 06:56:04,849 dev_appserver.py:3092] "GET /serve?user=0&index=0 HTTP/1.1" 500 -

However if I do print q.count() instead of print q.get() I will get 1. Seems I’m doing things correctly according to documentation, and I tried suggestions from similar questions I found but to no avail.

SDK v1.7.3

  • 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-13T20:56:13+00:00Added an answer on June 13, 2026 at 8:56 pm

    Inspired by a comment left to my question, and some notion that I was doing something wrong, with the addition of some other similar questions/answers found, I re-evaluated the way I was handling the Model class. It turns out at least the way I was overriding the class constructor, I believe I was breaking something in the way the superclass handles initialization. The following works OK for me now:

    class Moment(db.Model):
        user = db.IntegerProperty()
        index = db.IntegerProperty()
        date = db.DateTimeProperty()
        qx = db.FloatProperty()
        qy = db.FloatProperty()
        qz = db.FloatProperty()
        qw = db.FloatProperty()
        latitude = db.FloatProperty()
        longitude = db.FloatProperty()
        image = db.BlobProperty()
    
    class UploadHandler(webapp2.RequestHandler):
        def post(self):
            obj = biplist.readPlistFromString(self.request.body)
            Moment(user = obj['user'],
                   index = obj['index'],
                   date = obj['date'],
                   qx = obj['qx'],
                   qy = obj['qy'],
                   qz = obj['qz'],
                   qw = obj['qw'],
                   latitude = obj['latitude'],
                   longitude = obj['longitude'],
                   image = obj['image']).put()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an entity class User that contains information such as username, first name,
This question regards how one can effectively create and persist event domain objects on
If I have an entity such as the following: @Entity public class Customer {
If one has a object which can persist itself across executions (whether to a
I'm using hibernate to persist an entity to my database. For the moment it's
How can I get the user and password from such a connectionString in the
I need to delete one entity and create another: @Stateless public class StatelessBean {
I have a parent-child relationship: @Entity @Table(name = user) public final class User {
I am trying to persist a one (Owner) to many (Car) relation with morphia(0.99)/mongoDB(2).
Possible Duplicate: Do NSUserDefaults persist through an Update to an app in the Appstore?

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.