Hi Graham, I'm afraid that I don't quite follow what you mean by back-references. Could you give a concrete example of the type of situation which you are trying to model?
I sounds a bit like you are modeling the relationships between software packages, and you want to answer the questions: 1. Which packages does this module import? 2. Which other modules import this module? Would this would be the back-references? If the above are the types of relationships that you are trying to track, I'm not sure that you to use a many-to-many relationship (but I could be wrong, I'm not 100% sure of what you are trying to model). Are there ever circular references in the dependency graph? I usually suggest the following article on modeling entity relationships http://code.google.com/appengine/articles/modeling.html (not sure if you've run across this already) and it might contain some helpful advice. Keep in mind that many-to-many relationships which require joins are more expensive than one-to-many or reference-less queries. Happy coding, Jeff On Aug 26, 5:56 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > So I have a a many to any relationship between a Model called > Component and another called Dependency. I have 2 types of this > Dependency where they can Import Package or Export Package. For sake > of reuse, I have created an inheritance where both the many-to-many > relationships derive from Component_Connection. > The problem occurs when I want to back-reference these values from the > Component, so I use collection_name. You should notice that the code > below wont work, because the component is created before the value is > overridden, this is my problem. how to with the least amount of code(I > could just create the component in each subclass with a different name > and defeat the point) > > class Component_Connection(db.Model): > collection_name = "component_connection_set" > connect = db.ReferenceProperty(Dependency) > component = db.ReferenceProperty(Component, collection_name = > collection_name) > > class Component_Import_Package(Component_Connection): > collection_name = "component_import_package_set" > > class Component_Export_Package(Component_Connection): > collection_name = "component_export_package_set" --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---
