Newbie question.
I'm trying to dynamically generate an xspf playlist from a music
database. But I can't figure out how to build a .kid template which
leaves my xml alone.
In controllers.py I do this:
@expose(template="sitmadmin.templates.playlist_album")
def playlist_album(self,id=1) :
album = Album.get(id)
tracks = album.tracks
return dict(tracks=tracks)
In templates/playlist_album.kid I do this (as a test.. I would loop
over "tracks" to get the mp3 paths in a real version)
<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
<trackList>
<track><location>http://localhost:3000/audio/T1.mp3</
location></track>
</trackList>
</playlist>
But (not surprisingly) I don't get XML back. wget
http://localhost:3000/playlist_album/1
yields
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://
www.w3.org/TR/html4/loose.dtd">
<ns1:playlist version="1">
<ns1:trackList>
<ns1:track><ns1:location>http://localhost:3000/audio/T1.mp3</
ns1:location></ns1:track>
</ns1:trackList>
</ns1:playlist>
<br/><br/>Build time: 0.014s, Page size: 0.29KB
Thanks for any advice.
Doug Eck
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---