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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:52:12+00:00 2026-06-08T20:52:12+00:00

I’m trying to build a web app on App Engine that, at a certain

  • 0

I’m trying to build a web app on App Engine that, at a certain point, I need a function to construct a list property with one member from the distinct groups. I’m able to get this working if I use an Sqlite database and web.py database module to maniputate, I can implement what I need like this:

db = web.database(dbn='sqlite',db=':memory:')
db.query("CREATE TABLE seq_list (seq TEXT, seq_pickle TEXT);")

# do some stuff to the database

def getUnique():
    uniq_entries = db.query("SELECT DISTINCT seq FROM seq_list;")
    if not uniq_sequences:
        for entry in uniq_entries:
            seq_query = db.query("SELECT * FROM seq_list WHERE seq='" + str(entry.seq) +"';")
            seq_obj = pickle.loads(seq_query[0].seq_pickle)
            self.uniq_sequences.append(seq_obj)

I’m having trouble getting this to work in App engine though.

class SeqObj(db.Model):
    seq = db.TextProperty(required = True)
    seq_pickle = db.TextProperty(required = True)

# do some stuff to the database

def getUnique():
    entries = db.GqlQuery("SELECT * FROM SeqObj")
    entries = list(entries)
    if not uniq_sequences:
        unique_entries = set([entry.seq for entry in entries])

        # this prints the unique entries correctly
        print unique_entries

        for entry in unique_entries:
            try:
                 q = "SELECT * FROM SeqObj WHERE seq='%s'"% entry
                 print q
                 seq_query = db.GqlQuery(q)

                 # these are the lines that break it
                 seq_obj = pickle.loads(seq_query[0].seq_pickle)
                 uniq_sequences.append(seq_obj)
                 print entry
            except:
                 pass

The try/except is for showing the print statements. This outputs for some test data:

set([u'DXTMT', u'DIXTX', u'XSXDV', u'XI*MT'])
SELECT * FROM SeqObj WHERE seq='DXTMT'
SELECT * FROM SeqObj WHERE seq='DIXTX'
SELECT * FROM SeqObj WHERE seq='XSXDV'
SELECT * FROM SeqObj WHERE seq='XI*MT'

When I don’t put everything the try catch blocks, I get

IndexError: The query returned fewer than 1 results

I don’t know what’s going wrong because I the unique sequences are returned, the queries look like I expect them too, and I can verify that the entries are in the datastore. Any help is appreciated.

  • 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-08T20:52:14+00:00Added an answer on June 8, 2026 at 8:52 pm

    The problem is that you cannot filter on unindexed properties (TextProperty is unindexed). See https://developers.google.com/appengine/docs/python/datastore/queries#Filtering_on_Unindexed_Properties_Returns_No_Results for details.

    Try using a StringProperty instead if your seq field is known to be less than 500 characters.

    Also in these cases I always suggest to first run the query in the DataStore viewer. It suggests what indexes you need to run the desired query.

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

Sidebar

Related Questions

I need a function that will clean a strings' special characters. I do NOT
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I want to construct a data frame in an Rcpp function, but when I
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.