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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:58:19+00:00 2026-05-13T16:58:19+00:00

I just have a hunch about this. But if feels like I’m doing it

  • 0

I just have a hunch about this. But if feels like I’m doing it the wrong way. What I want to do is to have a db.StringProperty() as a unique identifier. I have a simple db.Model, with property name and file. If I add another entry with the same “name” as one already in the db.Model I want to update this.

As of know I look it up with:

template = Templates.all().filter('name = ', name)

Check if it’s one entry already:

if template.count() > 0:

Then add it or update it. But from what I’ve read .count() is every expensive in CPU usage.

Is there away to set the “name” property to be unique and the datastore will automatic update it or another better way to do this?

..fredrik

  • 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-13T16:58:20+00:00Added an answer on May 13, 2026 at 4:58 pm

    You can’t make a property unique in the App Engine datastore. What you can do instead is to specify a key name for your model, which is guaranteed to be unique – see the docs for details.

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

Sidebar

Related Questions

I just have a test. Config jndi in $CATALINA_HOME/conf/context.xml like below: <Resource name=jdbc/db auth=Container
I just have this issue with reading from a network stream in C#. Since
I just have a few questions about programmatically adding controls in aspx . After
I just have an XP machine, and i want to play around using CC.NET.
I just have a quick question about how to get the length of a
I just have a handful of Strings that I would like to obfuscate/hide against
Just have a quick question about the GAC I created an assembly Awesome.DLL. Had
I just have development experience in .Net and Windows... And now I really want
I have just have my app approved in the App Store, but only devices
I just have begun with Perl and I want to write my own script

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.