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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:44:02+00:00 2026-06-08T04:44:02+00:00

I have a simple NDB model: from google.appengine.ext import ndb import logging from libs

  • 0

I have a simple NDB model:

from google.appengine.ext import ndb
import logging
from libs import Api

class User(ndb.Model):
    oauth_token = ndb.StringProperty(required=False, indexed=False)

    @classmethod
    def update_data(self):
        logging.info("uid = %s, oauth token = %s" % (self.key, self.oauth_token))
        api = Api.Init(self.oauth_token)

In a separate file test.py, I have the following code:

from models import User
from google.appengine.ext import webapp, ndb
import logging

class Test(webapp.RequestHandler):
    def get(self):
        uid = 1
        u = ndb.Key(User, str(uid)).get()
        logging.info("uid = %s, oauth token = %s" % (u.key.string_id(), u.oauth_token))
        u.update_data()

Here’s the output in the log:

INFO     2012-07-22 16:32:42,532 test.py:8] uid = Key('User', '1'), oauth token = xxxxxxxxxxxxxxxxxxx
INFO     2012-07-22 16:32:42,532 user.py:9] uid = ModelKey('__key__'), oath token = StringProperty('oauth_token', indexed=False)

Why am I getting StringProperty('oauth_token', indexed=False) instead of the actual property’s value?

  • 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-08T04:44:04+00:00Added an answer on June 8, 2026 at 4:44 am

    update_data is decorated with @classmethod, which means that self in update_data is a reference to the User class, instead of an instance method. Just remove @classmethod.

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

Sidebar

Related Questions

I have simple class with width and height member fields which define number of
I have a very simple database structure (basically only a user table) with two
I have a custom User model with this classmethod.: @classmethod def by_name(cls, name): u
I have simple custom control that shows a message to user (something like browser's
I have simple table in Sybase -- Creating table 'SimpleText' CREATE TABLE [dbo].[SimpleText] (
I have simple php validation form that is halfway working. If you leave the
I have simple JavaScript snippet: var obrazek = [{nazwa: "Sniadanie", wiek: 100, autor: "Alicja"},{nazwa:
I have simple script with EventMachine, Fibers and faye require faye require em-synchrony require
I have simple database - one table with 6 collumns. 3 of them i
I have simple win service, that executes few tasks periodically. How should I pass

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.