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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:34:07+00:00 2026-05-31T08:34:07+00:00

I have this model: class Entry(db.Model): title = db.StringProperty() url = db.URLProperty() date =

  • 0

I have this model:

class Entry(db.Model):
    title = db.StringProperty()
    url = db.URLProperty()
    date = db.DateTimeProperty(auto_now=True)
    image = db.URLProperty()
    weight = db.IntegerProperty()
    category = db.StringProperty()
    desc = db.TextProperty()

I have lots of entries each day, how do I SELECT only today’s entries by using GGL ?
since query like this does not return any results ( but I know that there is results ):

SELECT * FROM Entry WHERE category = 'news' and date = '2012-03-12' ORDER BY weight DESC
  • 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-31T08:34:09+00:00Added an answer on May 31, 2026 at 8:34 am

    It’s not saved as a string, but as a datetime like object.

    The right-hand side of a comparison can be one of the following:

    • a datetime, date, or time literal, with either numeric values or a
      string representation, in the following forms:

      DATETIME(year, month, day, hour, minute, second)
      DATETIME(‘YYYY-MM-DD HH:MM:SS’)
      DATE(year, month, day)
      DATE(‘YYYY-MM-DD’)
      TIME(hour, minute, second)
      TIME(‘HH:MM:SS’)

    http://code.google.com/appengine/docs/python/datastore/gqlreference.html

    So in your example, use either of these.

    date = DATE('2012-03-12')
    date = DATE(2012,03,12)
    

    For datetime the time is by default set to 00:00, so equality comparison will fail therefore you must use > to compare

    SELECT * FROM Entry WHERE date > DATETIME(yyyy,mm,dd)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this model in django: class JournalsGeneral(models.Model): jid = models.AutoField(primary_key=True) code = models.CharField(Code,
Let's say I have a model like this class Foo(db.Model): id = db.StringProperty() bar
I have this simple model: class Tag(models.Model): title = models.SlugField() created = models.datetime def
I am currently using sorl-thumbnail and have a model. class Entry(models.Model): image = ImageWithThumbnailsField(upload_to='uploads/',
I have the following models: class Tag(models.Model): name = models.CharField(max_length=20) class Entry(models.Model): title =
I have this Task model: class Task < ActiveRecord::Base acts_as_tree :order => 'sort_order' end
I have a model class like this: class Note(models.Model): author = models.ForeignKey(User, related_name='notes') content
I have a class Similar to this public class Model { public TimeSpan Time1
I have this setup in my models: class Author(models.Model): name = models.CharField(max_length=100) class Topic(models.Model):
Okay so I have this mode: class Posts(db.Model): rand1 = db.FloatProperty() #other models here

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.