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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:52:21+00:00 2026-06-03T09:52:21+00:00

Google App Engine just gave me an error I don’t understand. Given a module

  • 0

Google App Engine just gave me an error I don’t understand. Given a module “X” that contains the file “Car.py” which contains a class “Car”,

and given this block of code:

import X 

class Passenger(db.Model):
  car = db.ReferenceProperty(X.Car.Car)

I get the error:

AttributeError: 'module' object has no attribute 'Car'

But if I change it to:

from X import Car

class Passenger(db.Model):
  car = db.ReferenceProperty(Car.Car)

It works. They look the same to me, but they’re clearly not. What’s the difference?

  • 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-03T09:52:22+00:00Added an answer on June 3, 2026 at 9:52 am

    As Lattyware points out, X is a package, and that’s just the way packages work. Importing the outer level doesn’t automatically give you access to the modules within it. You could do import X.Car if you wanted to refer to the whole thing as X.Car.Car.

    (Also please note Python is not Java: there’s no reason to have each class in a separate file, and even if you do then modules and packages usually have lower case names.)

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

Sidebar

Related Questions

I'm just getting started with a project that combines GWT, Google App Engine and
I'm just starting out with Python for Google App Engine. I have a file
I just started working on a project that will run on google app engine
I just found out that PIL functions on Google App Engine (GAE) are limited
I just ran across this an Google App Engine article that uses that funny
I just created a .jsp file in my google app engine project. How to
My app on google app engine returns content items (just text) and comments on
I'm just getting started with Google App Engine so I'm still learning how to
I created a google app engine project. I just successfully mapped it to a
I've just build a sample application to test out google app engine and google

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.