Excellent !!

On Tuesday, April 23, 2024 at 2:31:01 PM UTC-6 snide...@gmail.com wrote:

> I've long been bugged by going through the appadmin controller to do 
> database maintenance and not having the focus be anywhere useful.  I think 
> I even have a comment about that somewhere in the forum.
>
> I finally figured out a way to fix that ... the following change puts the 
> focus on the query box of the table admin form.  Line numbers are from the 
> 2.22.5 release, but should be close for other recent versions.
>
> File:  .../web2py/applications/myapp/*controllers/appadmin.py:*
> lines 226-230 before:
>     form = FORM(TABLE(TR(T('Query:'), '', INPUT(_style='width:400px',
>                 _name='query', _value=request.vars.query or '', 
> _class='form-control',
>                 requires=IS_NOT_EMPTY(
>                     error_message=T('Cannot be empty')))), TR(T('Update:'),
>                 INPUT(_name='update_check', _type='checkbox',
>
> lines 226-231 now:
>     form = FORM(TABLE(TR(T('Query:'), '', INPUT(_style='width:400px',
>                 _name='query', _value=request.vars.query or '', 
> _class='form-control',
>                 requires=IS_NOT_EMPTY(
>                     error_message=T('Cannot be empty')), 
> _autofocus="autofocus")),TR(T('Update:'),
>                                                                           
>                       INPUT(_name='update_check', _type='checkbox',
>                 value=False), INPUT(_style='width:400px',
>
> Note that this is really one big line ... I didn't spend a lot time trying 
> to add escapes to unwrap and reformat the long worm.
>
> I find this little change really helps my work flow on the app where I use 
> appadmin the most.  You may, of course, prefer to add a task-specific 
> controller elsewhere in the app or in a script, but appadmin queries are 
> fairly flexible, and that's often where I figure out what the task-specific 
> details are.
>
> Dave S
> /dps
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/3a0f6c25-7160-4f0d-b549-20026edd69cen%40googlegroups.com.

Reply via email to