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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:51:27+00:00 2026-05-11T10:51:27+00:00

What I want to do is build some mini cms which hold pages with

  • 0

What I want to do is build some mini cms which hold pages with a uri.

The last route in my urls.py points to a function in my views.py, which checks in the datastore if there’s a page available with the same uri of the current request, and if so show the page.

I have a model:

class Page(db.Model):    title = db.StringProperty(required=True)    uri = db.TextProperty(required=True)    created = db.DateTimeProperty(auto_now_add=True)    modified = db.DateTimeProperty(auto_now=True)    content = db.TextProperty()  

In my view:

def show(request):    page = db.GqlQuery('SELECT * FROM Page WHERE uri=:uri', uri=request.path).get()    if page is None:      return http.HttpResponseNotFound()    else:      return respond(request, 'pages_show', {'content': request.path})  

And I’ve added an entity with ‘/work’ as uri to the datastore.

Even when request.path is exactly ‘/work’, the query does not return a match.

Thanks for any advice you can give me!

And yes, i’m a python noob, App Engine is perfect to finally learn the language.

  • 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. 2026-05-11T10:51:28+00:00Added an answer on May 11, 2026 at 10:51 am

    I’ve found the solution!

    The problem lies in the model.

    App engines datastore does not index a TextProperty. Using that type was wrong from the beginning, so i changed it to StringProperty, which does get indexed, and thus which datastore allows us to use in a WHERE clause.

    Example of working model:

       class Page(db.Model):        title = db.StringProperty(required=True)        // string property now       uri = db.StringProperty(required=True)        created = db.DateTimeProperty(auto_now_add=True)        modified = db.DateTimeProperty(auto_now=True)        content = db.TextProperty() 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to build a service which needs to get this data from some
So I want to build some automated guidance for our architecture. I found the
Basically I want to build a website based on some original content, the content
I want to build a workspace with subversion, and I followed some tutorials; Install
I want to build a security related application. I would be storing some important
I want to build some libraries into executables that I need to use with
I want to build some GUI where an image is presented, and the user
I want to ignore some build errors at a specific directory by using maven's
I want to build an application to edit some fields in complex xml documents.
I want to build some thing very similar to the iphone messages app that

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.