My understanding of ERRestRouteExample seems ok.
I can create a new Pet and tie it to a person in ERRestRouteExample:
curl -X POST -d "{ name:'Rover', owner: { type:'Person', id:1 } }"
http://Jesse-Taylers-iMac.local:5999/cgi-bin/WebObjects/RESTExample.woa/ra/Pet.json
I can create a new Person in my own model, but when I try to create a new Post
and tie it to that user, I have either one of two possible troubles:
curl -X POST -d "{ title:'A Title', author: { type:'User', id:1 } }"
http://Jesse-Taylers-iMac.local:5999/cgi-bin/WebObjects/WOMan.woa/ra/Mtly.json
It either produces an error from the EO init while trying to set the author:
setAuthorRelationship((User)
((User)ERCoreBusinessLogic.actor()).localInstanceIn(editingContext()));
Or if I don't use that method, I get an error from validation?
A <b>Mtly</b> must have a <b>Author</b>.
Surely, I am mixing things?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]