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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:44:40+00:00 2026-05-23T01:44:40+00:00

I have a question model and a response model whos parent is set to

  • 0

I have a question model and a response model whos parent is set to a specific question like such:

class Question(db.Model):
  myQuestion = db.StringProperty()

class Response(db.Model):
  responder = db.ReferenceProperty(reference_class = User, collection_name = 'my_responses')
  myResponse = db.StringProperty()

def createQuestion(self, user, question):
  Question(myQuestion = question, parent = user).put()

def respond(self, user, question, response):
  Response(responder = user, myResponse = response, parent = question).put()

Given a user how do I get all the questions the user has not responded to?

  • 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-23T01:44:41+00:00Added an answer on May 23, 2026 at 1:44 am

    One solution would be to keep a list of questions the user has responded to. You could Keep these lists in the user’s entity group, and use the current month (for example) as the key name.

    class QuestionsAnswered(db.Model):
        answered = db.ListProperty(db.Key)
    

    Set QuestionsAnswered entity’s key-names to the current month (I like ‘201106’, for instnace), and put them in the user’s entity group. This will make fetching the needed seen lists easy.

    To get the list of unseen questions, you could do something like this:

    question_query = Questions.all().order('asked_date')
    questions = questions.fetch(50)
    
    if not questions:
      # return ... nothing to do here
    
    month = questions[0].asked_date.strftime('%Y%m')
    answered_list = QuestionsAnswered.get_by_key_name(month, parent=user)
    
    question_keys = [question.key() for question in questions]
    new_question_keys = set(question_keys) - set(answered_list.answered)
    

    You can extend this to check for the oldest month in the returned questions. You can also extend this to fetch again if not enough questions were returned.

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

Sidebar

Related Questions

Newbie question. I have Django models that look like this: class Video(models.Model): uploaded_by =
As described in another question , I have a set of Model objects and
I have the following model associations: Response->Survey Response->Question Response->Choice Survey->Question Question->Choice I want to
I have a model like this class Ask(models.Model): name = models.CharField(max_length=500) designation = models.CharField(max_length=200,
I have a model Question with a field called userid , before one ask
I have a django app with models as follows: A Question model An Answer
I have a question about the proper, best way to manage the model. I
A simple question: I have a Model-View-Controller setup, with Models accessing a SQL database.
Dynamic Data question: I have 2 fields of type Nullable<DateTime> on my model When
A bit of a newbie question on rails associations. I have a Bug model,

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.