Whoops, you can remove this: data=open(path,'r').read() from the above sample. It is redundant.
On Dec 28, 1:49 pm, "mr.freeze" <nfre...@gmail.com> wrote: > Something like this for 2?: > > At the bottom of admin/controllers/default.py edit function: > > functions=None > if filetype=='python' and request.args>=3: > data=open(path,'r').read() > functions=regex_expose.findall(data) > controller=request.args[2][:-3] > return dict(app=request.args > [0],filename=filename,filetype=filetype,data=data,controller=controller,functions=functions,file_hash=file_hash) > > Then in admin/views/default/edit.html: > > {{if functions:}} > <div style="text-align:left;">exposes > {{=XML(', '.join([A(f,_href=URL(a=app,c=controller,f=f)).xml() for f > in functions]))}} > </div> > {{pass}} > {{if controller and not functions:}} #CHANGED since we are > multipurposing controller variable now > <div style="text-align:right;">[<a href="{{=controller}}">edit > controller</a>]</div> > {{pass}} > > On Dec 28, 11:24 am, "mr.freeze" <nfre...@gmail.com> wrote: > > > On 2, I think you could contain it on a single line for most cases > > and reuse the code that creates the links after the word 'exposes' in > > the admin/design view: > > appadmin.py [ test | edit | delete ] exposes index, insert, download, > > csv, select, update, state > > > On Dec 28, 8:37 am, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > > 1) the ticket page is generated by the restrictederror class in gluon/ > > > resitricted.py > > > If you send me a patch I will include it. > > > > 2) let me think about this. I am afraid it may make the interface to > > > cluttered. > > > What do people think? > > > > Massimo > > > > On Dec 28, 6:56 am, ondrejs <ondrej.s...@gmail.com> wrote: > > > > > Hi all, > > > > > I've started developing some examples in web2py using admin interface > > > > + Ulipad combination. > > > > > The following shortcuts would save a few clicks: > > > > - in the ticket view, where a stacktrace with files is shown, the > > > > names of files that belong to the application could be hyperlinks > > > > - the page for design of a controller has a save button, but perhaps > > > > it could have direct links to try out various functions in the > > > > controller (with arguments?), > > > > > Thanks, > > > > > --Ondrej --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---