I'm using the GAE database to store objects of type Supp, which are part of a SuppSet. A SuppSet can have many Supps in it. I'm using the ReferenceProperty model to create the one-to-many relationship between the SuppSet and Supps as follows:
class SuppSet(db.Model):
<stuff>
class Supp(db.Model):
<more stuff>
suppset = db.ReferenceProperty(SuppSet, collection_name='supp_list')
I'm able to delete the Supp from its original SuppSet, but I can't figure out how to change the SuppSet that a Supp points to. I've tried the following with no success:
q = SuppSet.gql("WHERE name = :1", name_of_the_new_SuppSet)
s = q.get()
supp.suppset = s
I've also tried using list manipulation to push the Supp into the new SuppSet's collection_list supp_list, which didn't work.
Any help is much appreciated.