Search Results

Search found 2 results on 1 pages for 'rvandervort'.

Page 1/1 | 1 

  • Google App Engine : PolyModel + SelfReferenceProperty

    - by rvandervort
    Is a PolyModel-based class able to be used as a SelfReferenceProperty ? I have the below code : class BaseClass(polymodel.PolyModel): attribute1 = db.IntegerProperty() attribute2 = db.StringProperty() class ParentClass(BaseClass): attribute3 = db.StringProperty() class ChildClass(BaseClass): parent = SelfReferenceProperty(collection_name = 'children') p = ParentClass() p.attribute1 = 1 p.attribute2 = "Parent Description" p.attribute3 = "Parent additional data" p.put() c = ChildClass() c.attribute1 = 5 c.attribute2 = "Child Description" c.parent = p.key() c.put() I execute this code and check the datastore via the development server's admin interface. The parent instance is saved to the datastore class = 'BaseClass,ParentClass', but the child is not. There is no error output to the browser (debug is turned on) and nothing in the launcher's log for my app. Is this possible to do ?

    Read the article

  • Many-to-Many Relationship (with properties) in Google App Engine for Java

    - by rvandervort
    I understand from the official documentation on unowned relationships that the app must use sets of Key objects on either side of the relationship. This makes perfect sense. Coming from many years of RDBM-style programming, though, I'm pretty confused about how I can model properties of that relationship itself. For example, if I have entities Category and Entry in my many-to-many relationship and would like to persist a dateAdded property, or some other data that are only relevant when both sides of the relationship are known. I suppose it would be possible to create a third class : CategoryEntry that links the two, but this seems like a kludge. What is the proposed way to model this kind of situation ?

    Read the article

1