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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:59:36+00:00 2026-06-15T00:59:36+00:00

I want to have a base class called MBUser that has some predefined properties,

  • 0

I want to have a base class called MBUser that has some predefined properties, ones that I don’t want to be changed. If the client wants to add properties to MBUser, it is advised that MBUser be subclassed, and any additional properties be put in there.

The API code won’t know if the client actually subclasses MBUser or not, but it shouldn’t matter. The thinking went that we could just get MBUser by id. So I expected this to work:

def test_CreateNSUser_FetchMBUser(self):
    from nsuser import NSUser
    id = create_unique_id()
    user = NSUser(id = id)
    user.put()
    # changing MBUser.get.. to NSUser.get makes this test succeed
    get_user = MBUser.get_by_id(id)
    self.assertIsNotNone(get_user)

Here NSUser is a subclass of MBUser. The test fails.

  1. Why can’t I do this?
  2. What’s a work around?
  • 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-15T00:59:37+00:00Added an answer on June 15, 2026 at 12:59 am

    I just discovered GAE has a solution for this. It’s called the PolyModel:

    https://developers.google.com/appengine/docs/python/ndb/polymodelclass

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

Sidebar

Related Questions

I have a base class Foo that has an Update() function, which I want
I have a class called Prescriptions. It has properties that are other classes. So,
I have a Generic Base Class that I want to allow one of two
I have an abstract base class called Curve . There are three classes that
I have a base class that I want to look like this: class B
I have a base class called SpriteSheet which has two children, RotatedSpriteSheet and FlippedSpriteSheet.
I have a base class called Component which has a number of classes derived
I have base class that is called Entity. Then I have two child class
I have a base-class called Element. Some other classes (like Label and Image) both
I want to have a field, defined in a base class, that will affect

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.