PiRSquared17 / app-engine-patch

Automatically exported from code.google.com/p/app-engine-patch
0 stars 0 forks source link

DuplicatePropertyError #166

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an app with the following model:

class Bank(db.Model):
  name = db.StringProperty(required=True)

class Client(db.Model):
  bank1 = db.ReferenceProperty(Bank)
  bank2 = db.ReferenceProperty()

What is the expected output? What do you see instead?

This triggers a google.appengine.ext.db.DuplicatePropertyError.
Does not happen obviously with regular appengine SDK. (error also happens 
on older version of app engine patch)

What version of the product are you using? On what operating system?
1.0.2

Please provide any additional information below.

Original issue reported on code.google.com by hyrv...@gmail.com on 17 Jun 2009 at 10:24

GoogleCodeExporter commented 9 years ago
Actually, that code triggers the same exception in webapp. Your reference 
properties 
create conflicting collection_names. Both add "client_set" to Bank (bank2 adds 
it via 
Model). The problem only goes away if you rename bank1 to bank2 and bank2 to 
bank1 
(because then the order in which the collection_names get added is different), 
but 
that's not the real solution (it only explains why you might not have 
reproduced the 
bug outside of app-engine-patch). The real solution is to set a collection_name 
on your 
properties.

Original comment by wkornew...@gmail.com on 18 Jun 2009 at 9:52