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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:45:44+00:00 2026-06-17T22:45:44+00:00

Say you have a list of posts with 5 categories. When you do memcache,

  • 0

Say you have a list of posts with 5 categories.
When you do memcache, how should you filter out the categories?

class Post(db.Model):
    title = db.StringProperty(required=True)
    category = db.StringProperty()
    desc = db.StringProperty()

When you do caching:

key = "allpost"
post = Post.all().order('-created')
memcache.set(key, post)

I tried the use filter on cached object. And apparent it wouldn’t work.

cached_post.filter(“category”,”one”)

Is there any function you can do it? Or do you just have to go through the pain to filter all the categories first before caching all the posts.

  • 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-17T22:45:47+00:00Added an answer on June 17, 2026 at 10:45 pm

    You can put named things in memcache and get them out again via their key as a single piece. It looks to me as if you are putting into memcache a incomplete query or model, rather then the results of a query which you could then potentially filter.

    Take a look at NDB, much of the memcaching is done for you with that (not for queries however).

    So you can filter on the data you get from memcache but there are no commands to do in-memcache filtering.

    Have a look at the available functions: https://developers.google.com/appengine/docs/python/memcache/functions

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

Sidebar

Related Questions

Say I have a post and category model, with each post belonging to a
I understand how STI works, in that I have say a Post model that
I have a model object say 'Category'. I allowed users to post Category item.
Say I have a simple forum model: class User(models.Model): username = models.CharField(max_length=25) ... class
Lets say I have a generic list of the the following objects: public class
Let's say I have a model that looks like this: public class Blog {
Say I have a list of member, each of which is a custom object:
Say I have a list of integers: List<int> myInts = new List<int>() {1,2,3,5,8,13,21}; I
Say I have a List like: List<String> list = new ArrayList<>(); list.add(a); list.add(h); list.add(f);
Say we have a list of integers from 0 to 1000: [0, 1, 2,

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.