[web2py] Re: switching tabs in built in editor...

2015-11-17 Thread Edward Shave
Ok, so I'm guessing tabs are a web2py feature rather than belonging to the codemirror. So could someone give me a pointer to where in the source a click event is assigned to the tabs. I'd like to switch tabs using ctrl-tab which doesn't appear to do anything else at present. -- Resources: -

[web2py] Re: getting confused when running select on joined tables

2015-11-15 Thread Edward Shave
Nearly forgot to come back, sorry for delay... Switching "&" for "and" fixed my immediate problem and as usual I learnt more interesting stuff from your answer. Many thanks Ed -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

[web2py] getting confused when running select on joined tables

2015-11-14 Thread Edward Shave
I'm sorry if all this is in the book but I can't find it.. I never quite know what to expect when selecting records. Does the book make this clear and I missed it. If not what are the criteria that determine the output format? See below where I was initially using a simplified version (row1),

[web2py] Re: How can I improve this clunky code..!

2015-11-09 Thread Edward Shave
for anyone else like me who didn't recognize this part (f == f.referent for f in db[table_name]._references) Look up Generator Expressions -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] How can I improve this clunky code..!

2015-11-09 Thread Edward Shave
I have some code that works but I feel my ignorance is showing... Using just a table or table-name as input my code compiles a select statement which includes all the fields in the table plus any referenced tables. >>> table.name='entry' >>> table=eval('db.'+table_name) >>>

[web2py] Re: How can I improve this clunky code..!

2015-11-09 Thread Edward Shave
Anthony, What a brilliant answer..!!! Thank you so much. -- 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

[web2py] switching tabs in built in editor...

2015-11-03 Thread Edward Shave
Just wondering if there is a keyboard short-cut for switching tabs in built in editor? -- 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

[web2py] Re: Is it intended that TABLE(rows) makes a table within a table?

2015-10-25 Thread Edward Shave
Seems I overlooked the obvious..! Thanks DenesL :0) -- 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

[web2py] Is it intended that TABLE(rows) makes a table within a table?

2015-10-24 Thread Edward Shave
TABLE(rows) is a nice shorthand way to make a table but I'm getting a table within a table starting as below. ... Is this right? Or should I not be doing this anyway? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: Is it intended that TABLE(rows) makes a table within a table?

2015-10-24 Thread Edward Shave
Thanks Anthony, The reason I was trying TABLE was because I wanted to include a class in the table tag and was thinking this might work... TABLE(rows, _class="fred") taking account of your answer I'm now using... table_as_string = ''+rows.xml(0)[7:] -- Resources: - http://web2py.com -

[web2py] Re: How to update db record using ajax?

2015-10-22 Thread Edward Shave
Thanks a bunch for your very detailed reply. After reading your post I have managed to get a version working just the way I want. Thanks again, Ed -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] How to update db record using ajax?

2015-10-20 Thread Edward Shave
For some reason I just can't seem to get my head round the ajax documentation. I have what I think is a simple goal. Using javascript / jQuery, how do I silently update db.person with the following data? {"id":3, "firstName":"John", "lastName":"Doe"} I appreciate I need to supply a function

[web2py] Re: orderby clause breaking SQLFORM.smartgrid child dialogues

2015-10-17 Thread Edward Shave
Thanks Anthony, your solution worked like a charm, as usual. -- 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

[web2py] orderby clause breaking SQLFORM.smartgrid child dialogues

2015-10-16 Thread Edward Shave
When I set orderby=~db.parent.id the parent grid displays in reverse order as wanted. But now the children list has only a row of buttons on each line. Where has the data gone? I tried setting the orderby clause conditionally like this... if some condition: form.orderby=~db.parent.id

Re: [web2py] Re: Don't laugh but I like the admin editor ;o)

2015-10-13 Thread Edward Shave
Ok, I don't know why it took so long but just in case anyone else out there is as thick as me... Make sure the editor has the focus before using the find and replace feature, otherwise your key presses will be directed to the browser DOH..! -- Resources: - http://web2py.com -

[web2py] Re: class being inserted behind my back..!

2015-10-11 Thread Edward Shave
Nope, that's the whole thing running in a new simple application. I did this so as to eliminate anything else in my code. The controller is simply... def index(): return dict() On Sunday, October 11, 2015 at 9:51:16 AM UTC+1, Leonel Câmara wrote: > > Are you getting this result via ajax? >

Re: [web2py] Re: class being inserted behind my back..!

2015-10-11 Thread Edward Shave
hite; > > Denes > > > On Sunday, October 11, 2015 at 4:58:01 AM UTC-4, Edward Shave wrote: >> >> Nope, that's the whole thing running in a new simple application. >> I did this so as to eliminate anything else in my code. >> >> The controller is simply... >&

Re: [web2py] Re: Don't laugh but I like the admin editor ;o)

2015-10-11 Thread Edward Shave
How embarrassing..! I didn't see them until I read your post. Funny thing is I spent time looking for them and still didn't see them. That dark area at the bottom blends in with my windows 10 taskbar and that together with my eyes being 68 years old are my only excuses. On Sun, Oct 11, 2015 at

Re: [web2py] Re: Don't laugh but I like the admin editor ;o)

2015-10-11 Thread Edward Shave
:37 PM, Anthony <abasta...@gmail.com> wrote: > Which version of web2py, platform, and browser? Find and replace works for > me. > > > On Saturday, October 10, 2015 at 1:41:24 PM UTC-4, Edward Shave wrote: >> >> Seems search and replace doesn't work..! How disap

[web2py] Re: Don't laugh but I like the admin editor ;o)

2015-10-10 Thread Edward Shave
Seems search and replace doesn't work..! How disappointing. -- 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

[web2py] Re: Don't laugh but I like the admin editor ;o)

2015-10-10 Thread Edward Shave
Following Anthiony's links I quickly came across this file... \applications\admin\views\default\editor_shortcuts.html" which contais the following... {{=T("Keyboard shortcuts")}} {{=shortcut('Ctrl+S', T('Save via Ajax'))}} {{=shortcut('Ctrl+F11', T('Toggle

[web2py] class being inserted behind my back..!

2015-10-10 Thread Edward Shave
I make a button including two classes, btn and btn-primary. The button shows up OK but the text looks horrible. Upon inspection I find an extra class (btn-default) has been included..! What's up guys? {{extend 'layout.html'}} This text looks horrible -- Resources: - http://web2py.com -

[web2py] Don't laugh but I like the admin editor ;o)

2015-10-10 Thread Edward Shave
Only thing is I can't find much by way of instructions for it so if anyone can point me in the right direction. I'm particularly interested in search and replace and any short-cut keys... Also any nifty undocumented features you may know about. best regards Ed -- Resources: -

[web2py] Re: How to disable the calendar widget?

2015-10-10 Thread Edward Shave
Wow! Spoilt for choice ;o) Thanks for that Anthony. I continue to be impressed by the standard of replies here. -- 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

[web2py] Re: How to disable the calendar widget?

2015-10-09 Thread Edward Shave
> > >> Thanks a bunch for that. No way would I have figured that out on my own. Thanks again, Ed -- 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

[web2py] How to disable the calendar widget?

2015-10-07 Thread Edward Shave
I want to use a different datetimepicker widget so I need to disable the old one. So far I've commented out the following two lines in web2py_ajax.html... response.files.insert(1,URL('static','css/calendar.css'))

[web2py] How to add new record to drop-down-list?

2015-10-05 Thread Edward Shave
I have a form, SQLFORM.smartgrid (add new record page), containing a drop-down-list connected to a table in the database. It may be the user does not find a suitable item in the list and in this case I would like to allow the option of adding a new item. Seems like this might be a common

[web2py] How to get a totals column in my SQLFORM.grid?

2015-09-29 Thread Edward Shave
I can't find a way to use SUM in my grid. It seems the fields list doesn't allow any kind of expression? I see someone has suggested defining a SQL VIEW as a table in the DAL. I wonder if there's a better way? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: How to get a totals column in my SQLFORM.grid?

2015-09-29 Thread Edward Shave
Thanks, that works. -- 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] Re: Server-side DOM parsing not working for me..!

2015-09-23 Thread Edward Shave
Thanks a bunch Anthony. Your workaround works but after reading what you had to say regards server side dom parsing in the issue you raised, I am now furiously back peddling and moving this stuff clientside. Not a problem as I'm only playing at the moment. Thanks again Ed -- Resources: -

[web2py] Server-side DOM parsing not working for me..!

2015-09-22 Thread Edward Shave
I have a sqlform.grid where I found each row (tr) contains an id, so in the example row below the id="2" 2... I can't work out why the following returns None print grid.element('#2') I also tried grid.element(_id='2') but with the same result -- Resources: - http://web2py.com -

[web2py] Re: how to add style in header of current page?

2015-09-21 Thread Edward Shave
Many thanks for answers. I ended up inserting styles into the block header but in the long run I think appending response.files may be the way to go. I note in retrospect all this stuff is in the book but it took this thread to help me make use of it. one explicit example is worth a thousand

[web2py] how to add style in header of current page?

2015-09-21 Thread Edward Shave
I'm sure this is going to be trivial but I can't seem to find an example... I want to add some styles into the header of just the specific page I'm working on, so not generally wanting to edit layout.htm? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] pre-setting selected item inn dropdown list

2015-09-15 Thread Edward Shave
The following html fragment is generated by SQLFORM.grid (create form) CashSale The following code in my controller action successfully sets the select value = 1. form.element(_id='txn_editor_account_id')['_value'] = 1 But the displayed widget remains blank? What can I do

[web2py] Re: pre-setting selected item in dropdown list

2015-09-15 Thread Edward Shave
Many thanks Leonel for the quick answer which works..! Thanks again, Ed. -- 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

[web2py] Ok, I give in! How do I install jquery plugin, hoverIntent.js

2012-03-16 Thread Edward Shave
I'm a retired client/server (delphi) programmer and am struggling to learn the new stuff as I go.. I downloaded the file *jquery.hoverIntent.js* and placed it in the static/js directory. I added the following line to web2py_ajax.html...

[web2py] Re: Ok, I give in! How do I install jquery plugin, hoverIntent.js

2012-03-16 Thread Edward Shave
to set up hoverIntent). Anthony On Friday, March 16, 2012 9:45:51 AM UTC-4, Edward Shave wrote: I'm a retired client/server (delphi) programmer and am struggling to learn the new stuff as I go.. I downloaded the file *jquery.hoverIntent.js* and placed it in the static/js directory

[web2py] Re: Ok, I give in! How do I install jquery plugin, hoverIntent.js

2012-03-16 Thread Edward Shave
Ok, many thanks for your input. I'll let you know if I find an answer. Thanks again, Ed.

[web2py] Where is base.css referenced?

2012-03-15 Thread Edward Shave
I feel I must be missing something obvious, but despite the references to base.css in the book and the comments in the file itself, I can't find where it is referenced by the welcome app?

[web2py] Re: Where is base.css referenced?

2012-03-15 Thread Edward Shave
models/menu.py:* Thanks for putting me right, Ed On Thursday, 15 March 2012 15:50:49 UTC, Anthony wrote: There is no longer a base.css -- it is now web2py.css. Anthony On Thursday, March 15, 2012 11:44:07 AM UTC-4, Edward Shave wrote: I feel I must be missing something obvious, but despite

[web2py] Re: db.mytable.myfield.represent= ???

2012-03-09 Thread Edward Shave
Hi Anthony, Many thanks for the detailed reply. It seems I had my head on backwards when I penned the question. I should explain I am new to both web2py and python... After reading your reply the scales have lifted from my eyes and all is clear. My only defence for wasting your time is the

[web2py] Re: How to display reference field in sqltable?

2012-03-09 Thread Edward Shave
Many, many thanks for that. I ran your fix and now all is present and correct. Thanks again, Ed On Friday, 9 March 2012 07:01:25 UTC, nick name wrote: On Thursday, March 8, 2012 8:52:34 PM UTC-5, Edward Shave wrote: Many thanks for reply, unfortunately it didn't work in this instance... I

[web2py] Re: How to display reference field in sqltable?

2012-03-08 Thread Edward Shave
March 2012 11:27:14 UTC, Alan Etkin wrote: This should tell web2py to display the name instead of the id in references db.define_table('account', ..., format='%(name)s') You can find more info in the book's chapter 6.5, Record representation On 7 mar, 20:52, Edward Shave ed.sh

[web2py] db.mytable.myfield.represent= ???

2012-03-08 Thread Edward Shave
below is an extract from the book which describes the field represent feature - *represent can be None or can point to a function that takes a field value and returns an alternate representation for the field value. Examples: * *1. 2. 3. 4.* *db.mytable.name.represent = lambda

[web2py] How to display reference field in sqltable?

2012-03-07 Thread Edward Shave
*I have the following table definition...* * * *db.define_table('account', * *Field('name'),* *Field('transfer_acc','reference account'), * *)* * db.account.name.requires = IS_NOT_EMPTY() * * db.account.transfer_acc.requires = IS_IN_DB(db,db.account.id,'%(name)s') ...Note the table

[web2py] Is there a better way to right justify an SQLTABLE column?

2012-02-20 Thread Edward Shave
Currently I am using this db.ledger.amount.represent=lambda value: DIV(value, _style=width 100%; text-align:right;)

[web2py] Re: Is there a better way to right justify an SQLTABLE column?

2012-02-20 Thread Edward Shave
Thanks for pointing out the mistake in the width attribute, seems it's not needed in SQLTABLE, but was in the static mock-up. Being new to this I couldn't see a way to get at the td tag with css. Although I see Anthony has shown a way in another answer

[web2py] Re: Is there a better way to right justify an SQLTABLE column?

2012-02-20 Thread Edward Shave
Many thanks for supplying the right answer, unfortunately I realise now I posed the wrong question. Your right answer was new to me and I can certainly make good use of it. The question should have been... *Is there a better way to right justify numeric fields (more specifically, decimal) in

[web2py] Re: Is there a better way to right justify an SQLTABLE column?

2012-02-20 Thread Edward Shave
change *the*number or order of columns...

[web2py] Re: Is there a better way to right justify an SQLTABLE column?

2012-02-20 Thread Edward Shave
Many thanks again Anthony, I will look into both your suggestions, I may be gone sometime. LOL.

[web2py] Re: menu problem when importing layout

2012-02-16 Thread Edward Shave
Has anyone an answer for this yet?

[web2py] Re: menu problem when importing layout

2012-02-16 Thread Edward Shave
Hi Anthony, In case thodoris isn't around I'm assuming this problem is the same as I ran into when using the layout plugins... Just seems like drop down (sub) menus aren't supported? To see this just upload one into the welcome app. Regards, Ed

[web2py] Re: How to change menu colors?

2012-02-12 Thread Edward Shave
Thanks for that... Also had to make changes to topbar in order to get color across the whole screen.

[web2py] accessing admin via ssh fails with:- admin disabled because unable to access password file

2012-02-12 Thread Edward Shave
Hi, despite being a total novice with little or no experience beyond windows I have managed to install web2py on a webfaction shared server. By substituting my webfaction application listening port into the instructions I found here...

Re: [web2py] accessing admin via ssh fails with:- admin disabled because unable to access password file

2012-02-12 Thread Edward Shave
What you say is very interesting as it caused me to go back to the installation script which contains the following line... python -c from gluon.main import save_password; save_password('${web2py_password}',443) I have no idea where the 443 comes from, but when I renamed the file using my

[web2py] How to change menu colors?

2012-02-11 Thread Edward Shave
Ok, I give in Is there any easy way to change menu colors in the welcome app? If not then what is the recommended hard way? (smile)

[web2py] Re: Anyone deployed web2py on 1and1 shared hosting?

2012-02-08 Thread Edward Shave
Just an update I opened a webfaction account, pointed one of my 1and1 domains to it, and installed web2py by running a single script I found on the webfaction forum... Install web2py with nginx and uwsgihttp://community.webfaction.com/questions/7193/install-web2py-with-nginx-and-uwsgi

[web2py] Anyone deployed web2py on 1and1 shared hosting?

2012-02-05 Thread Edward Shave
If so, would appreciate any pointers. I'm a beginner with little or no experience and don't know where to start... :o)

[web2py] Re: Anyone deployed web2py on 1and1 shared hosting?

2012-02-05 Thread Edward Shave
Yes, thanks for that. I managed to run info.py and there was no mention of mod_python. I couldn't even work out how to copy files to htdocs. Anyway, have decided to move to webfaction where it seems I will have much more control and access. I was just hoping someone may have already done it.

[web2py] How to get a dropdown in self referencing table, create form?

2012-02-02 Thread Edward Shave
I have defined the following self referencing table. db.define_table( 'account', Field('name'), Field('asset','boolean', default=False), *Field('transfer','reference account'),* format = '%(name)s', singular = 'Account', plural = 'Accounts', ) How to get a

[web2py] Re: How to get a dropdown in self referencing table, create form?

2012-02-02 Thread Edward Shave
Found this works following definition db.account.transfer.requires = IS_IN_DB(db,db.account.id,'%(name)s')