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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:34:59+00:00 2026-05-27T05:34:59+00:00

I have the following model class. class Human(db.Model): email = db.StringProperty(required=True) date = db.DateTimeProperty(auto_now=True)

  • 0

I have the following model class.

class Human(db.Model):
    email = db.StringProperty(required=True)
    date = db.DateTimeProperty(auto_now=True)
    checksum = db.IntegerProperty(required=True)
    version = db.IntegerProperty(required=True)
    content = blobstore.BlobReferenceProperty(required=True)

Currently, to ensure the uniqueness of email in database level, (Ensure there are no duplicated email in entire database) I am using the following method.

    h = human.Human(key_name='yccheok@yahoo.com', email='yccheok@yahoo.com', checksum=456, version=1281, content=blob_key)

I am not sure this is a good way to do so? Or, is there any other better way?

  • 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-27T05:34:59+00:00Added an answer on May 27, 2026 at 5:34 am

    This is really the only way to do it.

    The email property is probably redundant in this case, since you’re already storing the data in the key name.

    The only other option is to give all of the Human entities the same parent, thus putting them together in an entity group, which will allow you to do updates within a transaction to check for an existing entity with the same email. However, this would prevent you from making more than about 1 change to all of your Human entities (and any of their children) per second, which doesn’t sound bad for a small low-traffic site but will kill scalability.

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

Sidebar

Related Questions

I have the following model structure class User(db.Model) : nickname = db.StringProperty(required=True) fullname =
I have the following model structure: class Container(models.Model): pass class Generic(models.Model): name = models.CharacterField(unique=True)
I have the following model class DNS(models.Model): domain = models.ForeignKey(Domain) host_start = models.CharField(max_length=150, blank=True,
i have following model setup class Category < ActiveRecord::Base has_ancestry :cache_depth => true, :depth_cache_column
I have following model: public class FormularModel { [Required] public string Position { get;
I have the following model: class test_data_urls(models.Model): url = models.CharField(max_length=200, db_index=True) I want to
Say I have the following model: class Person(models.Model): street_address = models.CharField(max_length=50, blank=True) suburb =
I have following model: class Client(models.Model): user = models.OneToOneField(DjangoUser, unique=True) address = models.ForeignKey(Address,blank=True) class
I have the following data model class defined: @PersistenceCapable public class TestSerializableModelObj { @Persistent(serialized=true,
I have a following model: class Car(models.Model): make = models.CharField(max_length=40) mileage_limit = models.IntegerField() mileage

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.