I don't want to use the grid so I put the code in models, then in the view wrote: {{=URL('download', music.filename)}} but it still displays as a relative URL not the html5 audio embeded player. I must be missing something. Thank you for the reply Stifan!
On Saturday, January 11, 2014 2:00:15 PM UTC-8, 黄祥 wrote: > > pardon me, don't know what do you want to achieve in here. i think massimo > guide, is show the html5 player in the grid. > consider in this code : > > > # tell web2py that links to music files are to be > # represented as HTML5 audio embedded players > from gluon.contrib.autolinks import expand_one > db.music.filename.represent = lambda v,r: \ > XML(expand_one(URL('download',args=v),{})) > > another suggestion is if you don't want to use grid, just move the code > above in models. and then create the controller and the view it will > automatically create the html5 audio embedded players. > > best regards, > stifan > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.