21295 Posts in 5734 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 456 Views |
-
JSON request with related records

28 October 2010 at 11:19pm
I'm working on a project and did already developed a few classes interrelated between them. Now I'm working in some ajax requests using JSON.
AFAIK these request return the main object and links to related objects, so we need to perform other requests to get some of the related data. For the sake of efficiency I would like to get, at least, part of the information of related records inside of the first request. Something like a Join query with the related records or part of then in the table view.
My app has an Alert class where issues are stored. Each Alert belongs to a Device:
Alert{Id, Message} *---1 Device {Id, SerialNumber, Name, ...}
So when I list an Alert I would like to see at least the Device name (a property of the Device).
To list Alerts I'm using /api/v1/Alert/.json
Is this possible somehow?
-
Re: JSON request with related records

10 November 2010 at 11:17am
I guess I didn't explain myself correctly. I need to query a class and would like to list the properties of that class and data from related records.
I have a class relationship between "Instalation" class and "Device" class of type one-to-many. I would like to show for each Instalation instance at least the directly related data in the Device class instances. when using the rest api I get the Instalation instance and links to Devices related to this Instalation.
Is there any way to instruct Rest to show the related data as objects instead of links!?
| 456 Views | ||
|
Page:
1
|
Go to Top |

