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

  • Home
  • SEARCH
  • 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 3950092
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:34:16+00:00 2026-05-20T01:34:16+00:00

This is a follow up to my previous question . I am using the

  • 0

This is a follow up to my previous question.

I am using the same model

class Item(db.Model):
    ...   
    glam = db.StringProperty()
    casual = db.StringProperty()
    speaking = db.StringProperty()

and assume that I have 2 items and 1 is tagged “glam” the other tagged “speaking”.

If I filter like this

    query.filter("glam", "glam")
    query.filter("speaking"), "speaking")

the filter returns none because this looks for 1 item tagged “glam” and “speaking”.

How do I filter for separate items?

Update

Item table may look like this:

         glam    speaking
        -------------------
item1
item2    glam
item3            speaking
item4
item5    glam

I’d like to filter “glam” and “speaking”

  • 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-20T01:34:17+00:00Added an answer on May 20, 2026 at 1:34 am

    With your current schema and the current datastore API, you cannot acheive this with a single query.

    If ‘glam’, ‘casual’, and ‘speaking’ are mutually exclusive, you can use an IN query on a single field:

    class Item(db.Model):
       ...
       tag = db.StringProperty()
    
    query.filter("tag IN", ["glam", "speaking"])
    

    You could also use the experimental Datastore Plus API and make an OR query (which is implemented by merging the results of two queries internally):

    # Note: Your model must be a Datastore Plus model; this may require some restructuring!
    q1 = query.filter("glam =", "glam")
    q2 = query.filter("speaking =", "speaking")
    for result in q1.OR(q2):
        ....
    

    Note that the datastore plus API is still in development, so I’m not sure if these queries are run in parallel yet, but they should be eventually. Additionally, since the Datastore Plus API is still experimental and under development, you may have to change your code in response to API flux. You do get to control when these updates occur though, at least.

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

Sidebar

Related Questions

This is a follow-up to a previous question I had about interfaces. I received
This question is a follow up to my previous question about getting the HTML
This is a more specific question to follow up on [another question that I
This is a follow up question to a previous question I asked about calculating
This is a follow up of the Previous Question It got really complicated so
This is a follow up post of my previous question about BASIC auth over
This is a follow up to a previous question . if I have multiple
this is a follow up to a previous question i asked. i am having
Note: This is a follow-up to an answer on a previous question . I'm
This is basically a follow up question to my previous question found here I'm

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.