Oh, I also realize you are meaning to set the 'a' property on B,
which is usually good modelling practice.  So, you need to do:

     b = B(parent=a, a=a)

On Oct 24, 4:16 am, log1 <[email protected]> wrote:
> Hello,
>
> This is my problem:
>
> class A(db.Model):
>   up = db.IntegerProperty(default=0, required=True)
>   down = db.IntegerProperty(default=0, required=True)
>
>   def move(self, direction):
>     a = A.get(self.key())
>
>     def txn(a, direction):
>       if direction == "up":
>         a.up  += 1
>       else:
>         a.down += 1
>       a.put() # OK
>       b = B(a=a)
>       b.put() # Cannot operate on different entity groups in a
> transaction???
>
>     db.run_in_transaction(txn, a, direction)
>
> class B(db.Model):
>   a =  db.ReferenceProperty(A, collection_name='a_b')
>
> Can somebody tell me what I'm doing wrong?
> Thanks
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to