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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:56:08+00:00 2026-06-08T05:56:08+00:00

Having some issues with merging two GQLQueries in GAE (python). fp_events = db.GqlQuery(SELECT *

  • 0

Having some issues with merging two GQLQueries in GAE (python).

  fp_events = db.GqlQuery("SELECT * FROM Event WHERE firstPlayer=:1", alias).fetch(mylimit)
  sp_events = db.GqlQuery("SELECT * FROM Event WHERE secondPlayer=:1", alias).fetch(mylimit)
  events = fp_events.append(sp_events)

However, when I try to iterate through these events using the for loop for event in events:, I get a TypeError: 'NoneType' object is not iterable error at that line. I suspect that this has something to do with the append I attempt to do, though I’m not entirely sure.

These events also have a datetime property… how could I sort the resulting events list by time, descending? While I could use ORDER BY time DESC in the two queries above, their merger isn’t necessarily guaranteed to be sorted.

I should also mention that the firstPlayer and secondPlayer properties for the Event table are mutually exclusive (no event has both firstPlayer and secondPlayer set to the same player).

Thank-you!

  • 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-08T05:56:09+00:00Added an answer on June 8, 2026 at 5:56 am

    You can use list to convert the iterable objects into Python lists:

    fp_events = db.GqlQuery("SELECT * FROM Event WHERE firstPlayer = :1", alias).fetch(mylimit)
    sp_events = db.GqlQuery("SELECT * FROM Event WHERE secondPlayer = :1", alias).fetch(mylimit)
    

    To combine the two lists, try this:

    fp_events_list = list(fp_events)
    sp_events_list = list(sp_events)
    events = fp_events_list + sp_events_list
    

    I just tried that out in the remote shell against one of my own AppEngine datastores, and it definitely works.

    I’m afraid that in order to get the sorting that you want, you’ll have to use sort them with the sorted builtin:

    sorted_events = sorted(events, key=lambda event: event.time)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having some issues passing commands through to flash from javascript. My code
Having some issues getting this MPMoviePlayerViewController to work. I have two sample URLs pointing
I have been having some issues retrieving JSON data from a WCF service application
I am having some issues receiving UTF-8 XML files back from DHL API. As
I'm having some issues returning unique results from a table that has some repeating
I'm having some issues filling a list in Python. I keep getting a list
Im having some issues with deleting an entry from mongo DB. Im using node-mongodb-native
Having some issues querying back from Mongo on Id when it's a guid. I
Having some issues accessing my param tags from within actionscript. Essentially I have the
I am having some issues with ranking some columns in Oracle. I have two

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.