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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:12:31+00:00 2026-05-13T19:12:31+00:00

Using the following models I am trying to figure out a way to generate

  • 0

Using the following models I am trying to figure out a way to generate a news feed of sorts so that when a user logs in they are presented with a list of upcoming events for bars that they choose to follow. Will I be able to query something like “SELECT * FROM Barevent WHERE parent_bar IN UserprofileInstance.following”? If so will this be efficient?

class Barprofile(db.Model):
    b_user          = db.UserProperty()
    created         = db.DateTimeProperty(auto_now_add=True)
    barname         = db.StringProperty()
    address         = db.PostalAddressProperty()
    zipcode         = db.StringProperty()

class Barevent(db.Model):
    created         = db.DateTimeProperty(auto_now_add=True)
    when            = db.DateProperty()
    starttime       = db.TimeProperty()
    endtime         = db.TimeProperty()
    description     = db.StringProperty(multiline=True)
    parent_bar      = db.ReferenceProperty(Barprofile, collection_name='bar_events')

class Userprofile(db.Model):
    b_user          = db.UserProperty()
    following       = db.ListProperty(db.Key)
  • 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-13T19:12:32+00:00Added an answer on May 13, 2026 at 7:12 pm

    Your model and your query should work fine, and it would not be inefficient. The one thing that you will want to keep in mind is that if Barprofile entities are deleted, you may want to manually remove their keys from the following property of each Userprofile. Having an orphaned Barprofile reference will not break the query, but if you ever use that list for other purposes (such as displaying to a user which bars he or she is subscribed to), you will got an error if you try to query on that key.

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

Sidebar

Related Questions

I am using Rails 3.2. I have following models: Blog Comment User class Blog
I am using models in following way: class UserProfile: # Some Stuff class CompanyProfile(UserProfile):
I'm trying to figure out the best way to save a simple one-to-many relationship
I am trying to figure out what is the best way to handle dependencies
I am trying to create a mapping file for the following Model using Fluent
I am using the following models in my django application and want to query
I have a REST API using Django Tastypie. Given the following code The models
I have the following form: @model Teesa.Models.SearchModel @using (Html.BeginForm(Index, Search, FormMethod.Get, new { id
I am using EntityFramework 4.1. I have the following model: public class User {
I have been trying to figure out how to do this and it seems

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.