Appengine JDO dataclasses to python model

Posted by M.A. Cape on Stack Overflow See other posts from Stack Overflow or by M.A. Cape
Published on 2010-03-23T03:05:23Z Indexed on 2010/03/23 3:11 UTC
Read the original article Hit count: 222

Filed under:

Does anyone have tried to implement an app in GAE having both java and python?

I have an existing app and my front end is in java. Now I want to use the existing datastore to be interfaced by python. My problem is i don't know how to define the relationships and model that would be equivalent to the one in java. I have tried the one-to-many relationship in python but when stored in the datastore, the fields are different than the one-to-many of java.

My data classes are as follows. //one-to-many owned

Parent Class

public class Parent{

    @PrimaryKey
    @Persistent
    private String unitID;
    //some other fields...


    @Persistent
    @Order(extensions = @Extension(vendorName="datanucleus", key="list-ordering", value="dateCreated desc"))
    private List <Child>  child;

    //methods & constructors were omitted


}

Child

public class Child{

    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key uId;

    @Persistent
    private String name;

    /* etc... */

}

© Stack Overflow or respective owner

Related posts about google-app-engine