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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:46:53+00:00 2026-05-28T07:46:53+00:00

I new in GAE, so if you want to help, please write some details

  • 0

I new in GAE, so if you want to help, please write some details and example.

I’m trying to do two db models, User and Article. Each user can have some article. In sql server it would be:

create table User
(
    id int primary key identity(1,1),
    login nvarchar(50) unique not null,
    password nvarchar(50) not null,
    email nvarchar(50) unique not null,
)

create table Article
(
    userId int references User(id) not null,
    topic nvarchar(50) not null,
    content nvarchar(max) not null
)

In python I try:

class Article(db.Model):
     topic = db.StringProperty(multiline=False)
     content = db.StringProperty(multiline=True)

class User(db.Model):
     login = db.StringProperty()
     email = db.EmailProperty()
     password = db.StringProperty(multiline=False)
     articles = db.ListProperty(int) #here I want to do db.ListProperty(Article), but I can't. So I want to keep here id of article.

And my questions are:

  • how can I provide that login and email will be unique
  • how can I get primary key for User (in sql

     select id from User where login = 'sada' and password = 'sd'
    
  • how can I use this primary key to search user
  • how can I add new article for User, if I want to keep id in User-articles

Maybe it is some better way to do this, gladly I will know a better solution

  • 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-05-28T07:46:54+00:00Added an answer on May 28, 2026 at 7:46 am

    First the Google AppEngine Datastore is not a relational database. This is a completely different paradigm. Maybe you should first have a look at the Datastore Overview documentation or Mastering the datastore.

    Regarding your specific questions:

    1. Unique login and email: you have to check that it does not already exists, because datastore does not provide unique contraints. You can also have a look at this solution: Add a Unique Constraint to Google App Engine. Or you can use Google Accounts.
    2. Primary key for User and Primary key to search user: using Google AppEngine you would get the user directly: user = db.GqlQuery("SELECT * FROM Users WHERE login IS :1", login)
    3. Reference: here is a very good article about it: Modeling entity relationships
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to the GAE, and want to add some sample records to the
I am new to both GAE and PiCould, and have some basic questions when
I am new to memcache of GAE and I need a help in this.
Learning GAE I`ve got some issue. I want to save contact list of my
I'm trying to move my gae webapp project to django non-rel. I'm pretty new
I'm new to programming. I'm using Bottle on GAE. I want to receive and
I'm relatively new to GAE, and I'm having some difficulty understanding the URL mappings.
I'm just starting a new GAE project, and I see they've done some sprucing
I'm new to programming and I'm trying to grasp the concept of the GAE
I'm trying to write a Vaadin application on GAE platform with using JDO, and

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.