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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:14:49+00:00 2026-05-17T19:14:49+00:00

Ok. I’m working with GAE. And i want create something like this: I have

  • 0

Ok. I’m working with GAE. And i want create something like this:

I have types “group” “topic” “tag”:

  1. each “group” can have as many
    “topics” as needed

  2. each “topic” can have as many “tags”
    as needed

  3. each “group” can have as many “tags”
    as needed

it’s something like circle.

right now i have something like this:

class TopicGroup(db.Model):
    value = db.StringProperty(required=True)

class Topic(db.Model):
    title = db.StringProperty(required=True)
    group = db.ReferenceProperty(TopicGroup, 'group', 'topics', required=True)

class TopicTag(db.Model):
    topic = db.ReferenceProperty(Topic, 'topic', 'tags', required=True)
    group = db.ReferenceProperty(TopicGroup, 'group', 'tags', required=True)
    value = db.StringProperty(required=True)

but this is no good (in my model “topic” can have only one tag, but i nead “topic” to have as many tags as needed)

well i already have a crack in my head… is there someone who could help?

  • 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-17T19:14:50+00:00Added an answer on May 17, 2026 at 7:14 pm

    Many-to-many joins can be implemented as join tables (or Relationship Models). In the solution below, there is a model that holds all of the tags that are applied to individual Groups (GroupTags) and a model that holds the tags that are applied to Topics (TopicTags).

    Decoupling the Tag itself from references to the Tag allows you to do things like change the spelling of a tag without needing to update every Group or Topic to which that Tag is applied.

    Also, this model takes good advantage of the fact that AppEngine creates automatic backreferences on entities that have other entities referencing them. In the models below, a Group entity will have a property called topics that is a query that will fetch all Topic entities who’s group reference points to that Group. Similarly, each Group gets a tags property from the GroupsTags model that gives it all of the Tag entities that belong to it. Every Tag entity gets a groups and topics property that is a query for all of the entities of those types that have the give Tag assigned, making searching by tag (a very typical operation) quite simple.

    It’s a very powerful and flexible approach to modeling systems such as yours.

    class Group(db.Model):
        # All of my group-specific data here.
    
    class Topic(db.Model):
        title = db.StringProperty(required=True)
        group = db.ReferenceProperty(Group, collection='topics')
        # other topic-specific data here.
    
    class Tag(db.Model):
        text = db.StringProperty(required=True)
    
    class GroupTags(db.Model):
        group = db.ReferenceProperty(Group, collection='tags')
        tag = db.ReferenceProperty(Tag, collection='groups')
    
    class TopicTags(db.Model):
        topic = db.ReferenceProperty(Topic, collection='tags')
        tag = db.ReferenceProperty(Tag, collection='topics')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have some data like this: 1 2 3 4 5 9 2 6
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.