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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:46:40+00:00 2026-06-09T12:46:40+00:00

I have this datastore model: class Person(db.Model): person_name = db.StringProperty(required = True) nacionality =

  • 0

I have this datastore model:

class Person(db.Model):
    person_name = db.StringProperty(required = True)        
    nacionality = db.StringProperty(required = True)
    marital_status = db.StringProperty(required = True)
    profession = db.StringProperty(required = True)
    SSN = db.IntegerProperty(required = True)
    driver_license = db.IntegerProperty(required = True)
    address = db.PostalAddressProperty(required = True)

In this Model, person_name could be something like this: ‘Carl Sagan’ (there is only on property for the entiry name). But when I query it, this way:

    searched_name = 'Carl'
    p = Person.all()
    persons = p.filter('person_name >=', searched_name)

I got, as a result, names which doesn’t begin with ‘Carl’ or neither have ‘Carl’ in any part of the name. If I query this way: persons = p.filter('person_name >=', searched_name) I got none result (even ‘Carl Sagan’ isn’t found). So, I’d like to know: what is the best filter to this kind of query? (quering a complete name property using only the first name)?

  • 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-09T12:46:42+00:00Added an answer on June 9, 2026 at 12:46 pm

    String filter works as it was comparing chars starting beginning of string. You can do something like this:

    p.filter('person_name >=', searched_name)
    p.filter('person_name <', searched_name + u'\ufffd')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this class: class Contract(db.Model): book_number = db.IntegerProperty(required = True) initial_page = db.IntegerProperty(required
I have an existing schema: class Example (db.Model) : row_num = db.IntegerProperty(required=True) updated =
I have a Model in an existing Datastore. Which looks like this: class SomeKind(db.Model):
I have these models: class Assignment(db.Model): title = db.StringPeoperty(required=True) ...other stuff... class TeamScore(db.Model): assignment
I have a model which looks like this: class Example (db.Model) : row_num =
I have the following 2 models in my Google App Engine datastore: class Search(db.Model):
I have a simple model: class MyEntry(db.Model): keyName = db.StringProperty() valuesList = db.StringListProperty() and
I'm using app engine datastore so I have entity like this. @PersistenceCapable public class
I have a model Entry class Entry(db.Model): year = db.StringProperty() . . . and
I have this form: <%= form_tag posts_path, :method => :get, :class => search_nav do

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.