On Mar 1, 2011, at 5:18 AM, darkblue_b wrote:
> as per the very simple instructions, I wrote a controller function to
> return a few items..
> generic.html and generic.xml work, but generic.json and generic.rss
> fail
> 
>  just learning still, I searched the newsgroup and found
> 
>> Lorin Rivers             Jan 13, 2:26 pm
>> OK, if I specify which columns get returned in my rows, generic.json returns 
>> "no json".
>> If my function returns rows.as_list(), generic.json works, but my 
>> generic.csv breaks.
>> I figured out this, though, which seems to work, but I don't know if it's 
>> wise. Also, it >doesn't seem like it should be necessary.
>> def function():
>> dbset = db()
>> records = dbset.select(db.table.field1, db.table.field2, 
>> orderby=db.table.field1)
>> otherrecords = records.as_list()
>> Then in my generic.csv, I use records and in generic.json I use otherrecords.
>> --
> 
> does this apply ? is this a FAQ?
> I would like to get to authenticated JSON next
> thanks  -Brian
> 


@jonathan: Yes, a more detailed error messages than "no json" would be awesome.

@brian: if the other generics work, then it's probably a non-serializable 
value. In my case, it was a date object. Once I realized that, I converted the 
date to a string and it then worked peachily.


-- 
Lorin Rivers
Mosasaur: Killer Technical Marketing <http://www.mosasaur.com>
<mailto:lriv...@mosasaur.com>
512/203.3198 (m)


Reply via email to