Two-way referenced relations do not work with sqlalchemy interface
Use this simple schema
{
"user": {
"_help": "user model",
"name": {
"type": "string",
"index": true,
"nullable": false
},
"groups": {
"type": "relation",
"rel": "group",
"identifier": "basic"
}
},
"group": {
"name": {
"type": "string",
"index": true,
"nullable": false
},
"users": {
"type": "relation",
"rel": "user",
"identifier": "basic"
}
}
}
The idea here is to use the relation between tables in both entities. This simply does not work, when I try to create a user
$ ./client user create --name joe
INFO: create: {u'name': 'joe'}
ERROR: Error creating backref 'groups' on relationship 'Group.users': property of that name exists on mapper 'Mapper|User|user'
the full stack trace on the server side is in a comment since there does not seem to be enough space here.