Hello,
I'm trying to return some data via JSON to my view. The problem i'm having
is that when i do a left outer join, the JSON has two nested sets of data.
I'm trying to use SlickGrid which doesn't support complex fields like
Set1.Field1 , Set2.Field1, etc...
Is there a way to return a single set of JSON data from my controller when
joining tables?
>From Controller:
rows = db().select(
db.event.eventDesc
,db.event.dateCreated
,db.event.user_id
,db.eventType.eventTypeDesc
,db.eventType.id
,left=db.eventType.on(db.event.eventType==db.eventType.id))
Json recieved by View:
[{"eventType":{"eventTypeDesc":"Maintenance Action Required","id":2},"event"
:{"eventDesc":"Clean out the closet","user_id":1,"dateCreated":"2013-06-06
15:02:25"}}]
Json i would rather receive in View:
{"eventTypeDesc":"Maintenance Action Required","id":2,"eventDesc":"Clean
out the closet","user_id":1,"dateCreated":"2013-06-06 15:02:25"}
Thanks
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.