Re: getting to know Mr. ERXRoute
Re: getting to know Mr. ERXRoute
- Subject: Re: getting to know Mr. ERXRoute
- From: Jesse Tayler <email@hidden>
- Date: Thu, 30 Dec 2010 14:48:04 -0500
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@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden