[web2py] Azure Connection

2019-10-29 Thread Mark Billion
So, my connection string is: db = 
DAL('mysql://user:p...@my-server.database.windows.net/myDb',pool_size=5).

I get no connectivity.  Any help would be appreciated!  

-- 
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/5a0c18d7-b218-4cc7-8513-28cce9f6e3d0%40googlegroups.com.


[web2py] ADA DECISION

2019-10-08 Thread Mark Billion
All ~ Long time asker here (thanks Anthony and Massimo for all your patient 
responses).  

FWIW, I did want to drop everyone a line about the Dominos Supreme Court 
appeal (Im a lawyer by trade).  The Court of Appeals for the 9th Circuit 
(it's basically the western quarter of the US per here 
) 
has held that all business websites must be ADA compliant or you could wind 
up paying substantial attorney's fees to the person suing you.  This may or 
may not hold in other parts of the country and frankly, we don't really 
know what the requirements are at this time, especially for entirely 
virtual businesses.  That said, it is always good practice to be AA 
complaint with the *Web Content Accessibility Guidelines (WCAG) 2.0.  *

*Please note, this is not legal advice but just a pay it forward note from 
someone who got a lot of help on these forums!*

*Mark*

-- 
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/c373a033-9763-4c5c-b8b7-ee4267704395%40googlegroups.com.


Re: [web2py] Re: Classes: Iteration of Row Objects & Updating

2018-06-09 Thread Mark Billion
Anthony -- I havent met you, but I certainly owe you a beer.  Thank you for
all of your help.

On Fri, Jun 8, 2018 at 10:47 PM, Anthony  wrote:

> On Friday, June 8, 2018 at 5:49:07 PM UTC-4, Mark Billion wrote:
>>
>> Ive checked the docs and am sure I am missing it, but can someone please
>> confirm or deny: If I iterate a row class attribute via another class
>> method, updates applied by that method will will update the underlying row
>> attribute?
>>
>> For example:
>>
>> __init__:
>>  self.dbobj = db(db.foo.bar>0).select()
>>
>> def abc:
>>  for x in self.dbobj:
>>  x.attribute = "a"
>>
>> My question is whether the self.dbobj attribute characteristic is now set
>> to "a" for all records until the object is either destroyed or reupdated.
>>
>
> Yes.
>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/RpxqxmK4bCU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Mark M. Billion
1904 N. Lincoln
Wilmington, DE 19806
302.416.2199

-- 
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/d/optout.


[web2py] Classes: Iteration of Row Objects & Updating

2018-06-08 Thread Mark Billion
Ive checked the docs and am sure I am missing it, but can someone please 
confirm or deny: If I iterate a row class attribute via another class 
method, updates applied by that method will will update the underlying row 
attribute?

For example:

__init__:
 self.dbobj = db(db.foo.bar>0).select()

def abc:
 for x in self.dbobj:
 x.attribute = "a"

My question is whether the self.dbobj attribute characteristic is now set 
to "a" for all records until the object is either destroyed or reupdated.  
I know I could test it, but I was wondering if there was a definitive 
answer...

-- 
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/d/optout.


Re: [web2py] Re: auth.messages.subject

2018-01-25 Thread Mark Billion
This was awesome and Marcelo's answer was perfect (yours, as always
Anthony, is spot on too).

On Thu, Jan 25, 2018 at 12:53 PM, Anthony <abasta...@gmail.com> wrote:

> There is no auth.messages.subject. However, there are more specific
> auth.messages for particular types of emails sent by Auth. You can find
> them listed at http://web2py.com/books/default/chapter/29/09/access-
> control#Auth-Settings-and-messages or https://github.com/web2py/
> web2py/blob/623f3b99477eb97ffadb20d6f7cb3da398253c9c/gluon/tools.py#L1537
> (they all end in "_subject").
>
> Anthony
>
>
> On Wednesday, January 24, 2018 at 1:47:50 PM UTC-5, Mark Billion wrote:
>>
>> So, this does not work.  Any way to set the subject line? (maybe Im just
>> missing it)
>>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/ZYx1n9c6dNE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Mark M. Billion
1904 N. Lincoln
Wilmington, DE 19806
302.416.2199

-- 
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/d/optout.


[web2py] Re: auth.messages.subject

2018-01-24 Thread Mark Billion
Sorry, that covers gen emails not the auth section as far as I can see

On Wednesday, January 24, 2018 at 1:50:04 PM UTC-5, Marcelo Huerta wrote:
>
> El miércoles, 24 de enero de 2018, 15:47:50 (UTC-3), Mark Billion escribió:
>>
>> So, this does not work.  Any way to set the subject line? (maybe Im just 
>> missing it)
>>
>
> http://web2py.com/books/default/chapter/29/08/emails-and-sms#Sending-emails
>  
>

-- 
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/d/optout.


[web2py] auth.messages.subject

2018-01-24 Thread Mark Billion
So, this does not work.  Any way to set the subject line? (maybe Im just 
missing it)

-- 
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/d/optout.


[web2py] Styling the Sign Up Page

2017-08-14 Thread Mark Billion
I have Jquery that works fine to style the user/login page

$( document ).ready(function() {
$(":submit").addClass( "btn btn-default" );

$(".btn").css('margin-right', '10px');
$(".w2p_fl").attr('align', 'right');
$( "form>table" ).prepend( '' )
});


But I cant for the life of me get it to apply when I hit the sign up 
button.  This is what Im using, but Ive also tried form and even document 
dot change

$(".form-sign").change(function(){
$(":submit").addClass( "btn btn-default" );

$(".btn").css('margin-right', '10px');
$(".w2p_fl").attr('align', 'right');
//$( "form>table" ).prepend( 'table" ).prepend( '' )

Any thoughts?

-- 
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/d/optout.


[web2py] redirect if registration is pending

2017-07-25 Thread Mark Billion
Dumb question and Im sure that there is an answer that Im missing, but when 
in doubt

App requires registration to be approved and if its not, it redirects to 
the home screen and flashes the standard message.  If I want to redirect a 
login where the user is pending approval to a different page, what is the 
code for that?

ie, something like: auth.settings.register_pending__next = 'foo'

Any thoughts?

-- 
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/d/optout.


[web2py] Jquery Decision Tree

2016-12-08 Thread Mark Billion
Im really looking just for some suggestions of particularly light weight 
ones

-- 
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/d/optout.


[web2py] Nginx & The Welcome App

2016-07-13 Thread Mark Billion
Nginx redirects my users from the website to the 
website/welcome/indexmy app is t4.  Ive tried to configure the Web2py 
sites enabled to fix it, but it fails.  Here is the w2p sites enabled 
fileany thoughts would be much appreciated.


server {
listen  80;
server_name $hostname;
###to enable correct use of response.static_version
#location ~* ^/(\w+)/static(?:/_[\d]+\.[\d]+\.[\d]+)?/(.*)$ {
#alias /home/www-data/web2py/applications/$1/static/$2;
#expires max;
#}
###

###if you use something like myapp = dict(languages=[en, it, jp], 
default_language=en) in your routes.py
#location ~* ^/(\w+)/(en|it|jp)/static/(.*)$ {
#alias /home/www-data/web2py/applications/$1/;
#try_files static/$2/$3 static/$3 =404;
#}
###
location ~* ^/(\w+)/static/ {
root /home/www-data/web2py/applications/t4;
#remove next comment on production
#expires max;
### if you want to use pre-gzipped static files (recommended)
### check scripts/zip_static_files.py and remove the comments
# include /etc/nginx/conf.d/web2py/gzip_static.conf;
###
}
location / {
#uwsgi_pass  127.0.0.1:9001;
uwsgi_pass  unix:///tmp/web2py.socket;
include uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWAREnginx/$nginx_version;

###remove the comments to turn on if you want gzip compression 
of your pages
# include /etc/nginx/conf.d/web2py/gzip.conf;
### end gzip section

### remove the comments if you use uploads (max 10 MB)
#client_max_body_size 10m;
###
}
}
server {
listen 443 default_server ssl;
server_name $hostname;
ssl_certificate /etc/nginx/ssl/web2py.crt;
ssl_certificate_key /etc/nginx/ssl/web2py.key;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_ciphers 
ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA;
ssl_protocols SSLv3 TLSv1;
keepalive_timeout70;
location / {
#uwsgi_pass  127.0.0.1:9001;
uwsgi_pass  unix:///tmp/web2py.socket;
include uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWAREnginx/$nginx_version;
###remove the comments to turn on if you want gzip compression 
of your pages
# include /etc/nginx/conf.d/web2py/gzip.conf;
### end gzip section
### remove the comments if you want to enable uploads (max 10 
MB)
#client_max_body_size 10m;
###
}
## if you serve static files through https, copy here the section
## from the previous server instance to manage static files

}

-- 
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/d/optout.


[web2py] Segfault/Selenium/Web2py/Permissions

2016-07-03 Thread Mark Billion
I have a script that posts data to a third party form via PhantomJS.  It 
runs just fine on selenium in the python shell and when I run it in the W2P 
shell (python web2py.py -S *app* -M).  The problem is that when I call it 
from the controller via a click, I get this traceback.

I am assuming that the process is somehow interfering with itself but Ive 
spent 24 hours googling and found nothing.  Anyone have any thoughts?




1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.

Traceback (most recent call last):
  File "/home/www-data/web2py/gluon/restricted.py", line 227, in restricted
exec ccode in environment
  File "/home/www-data/web2py/applications/t4/controllers/default.py" 
, line 
5172, in 
  File "/home/www-data/web2py/gluon/globals.py", line 412, in 
self._caller = lambda f: f()
  File "/home/www-data/web2py/gluon/tools.py", line 3774, in f
return action(*a, **b)
  File "/home/www-data/web2py/applications/t4/controllers/default.py" 
, line 
4891, in file_now
driver = webdriver.PhantomJS(service_args=['--ignore-ssl-errors=true', 
'--ssl-protocol=TLSv1'])
  File 
"/usr/local/lib/python2.7/dist-packages/selenium/webdriver/phantomjs/webdriver.py",
 line 52, in __init__
self.service.start()
  File 
"/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.py", 
line 86, in start
self.assert_process_still_running()
  File 
"/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.py", 
line 99, in assert_process_still_running
% (self.path, return_code)
WebDriverException: Message: Service phantomjs unexpectedly exited. Status code 
was: -11






from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException
import unittest, time, re
from selenium.webdriver.support import expected_conditions as EC


driver = webdriver.PhantomJS(service_args=['--ignore-ssl-errors=true', 
'--ssl-protocol=TLSv1'])
driver.get(*website*)
driver.find_element_by_name("login").clear()
driver.find_element_by_name("login").send_keys(*thing1*)
driver.find_element_by_name("key").clear()
driver.find_element_by_name("key").send_keys(*thing2*)
driver.find_element_by_name("redaction").click()
driver.find_element_by_name("button1").click()
driver.find_element_by_link_text("Bankruptcy").click()
driver.find_element_by_link_text("Case UpLoad").click()
#driver.find_element_by_name("case_1").clear()
driver.find_element_by_name("case_1").send_keys(hardpath+dox.case_information)
#driver.find_element_by_name("file_1").clear()
driver.find_element_by_name("file_1").send_keys(hardpath+dox.petition)
#driver.find_element_by_name("file_1_MTX").clear()
driver.find_element_by_name("file_1_MTX").send_keys(hardpath+dox.creditors)
#driver.find_element_by_name("configured_file_1").clear()
driver.find_element_by_name("configured_file_1").send_keys(hardpath+dox.ccc)
driver.find_element_by_name("button1").click()
driver.find_element_by_name("button1").click()

print driver.page_source

return driver.page_source

-- 
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/d/optout.


[web2py] dumbest question ever: how do you jump to line in the w2p ide

2016-06-03 Thread Mark Billion
I cant find this anywhere, but Ive seen it somewhere.  Say Im editing in 
the admin application and want to jump to line 1000.  Whats the key binding 
for it?

Feel free to heckle as long as you also provide the answer ;)

-- 
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/d/optout.


[web2py] Re: Computed DAL Values On Insert

2016-05-09 Thread Mark Billion
Yep

On Monday, May 9, 2016 at 12:19:13 PM UTC-4, Niphlod wrote:
>
> are all of the required fields of "storage_string()" supplied ?
>
> On Monday, May 9, 2016 at 5:25:21 PM UTC+2, Mark Billion wrote:
>>
>> When I do an insert the computed values dont updatethoughts?
>>
>> def storage_form_controller():
>> x = request.vars.client
>> sl_dict = {  'client':request.vars.client,
>>  'kind': request.vars.kind,
>>  'others_with_access': request.vars.others_with_access,
>>  'bank_name_address': request.vars.bank_name_address,
>>  'date_surrender_or_trans': 
>> request.vars.date_surrender_or_trans,
>> }
>> for a in range(0,5):
>> try:
>> sl_dict.update({'contents_%s' %str(a+1): 
>> request.vars.contents[a]})
>> except:
>> pass
>> 
>> ret = db.storage_lockers.validate_and_insert(**sl_dict)
>>
>>
>>
>> db.define_table('storage_lockers',
>> Field('client' , requires=IS_IN_DB(db, db.client.id), 
>> writable=False),
>> Field('kind', requires=IS_IN_SET(LOCKER)),
>> Field('others_with_access', 'string', length=100),
>> Field('bank_name_address', 'string', length=100),
>> Field('contents_1', requires=IS_NULL_OR(IS_IN_DB(db, db.asset.id, 
>> '%(Additional_Description)s'))),
>> Field('contents_2', requires=IS_NULL_OR(IS_IN_DB(db, db.asset.id, 
>> '%(Additional_Description)s'))),
>> Field('contents_3', requires=IS_NULL_OR(IS_IN_DB(db, db.asset.id, 
>> '%(Additional_Description)s'))),
>> Field('contents_4', requires=IS_NULL_OR(IS_IN_DB(db, db.asset.id, 
>> '%(Additional_Description)s'))),
>> Field('contents_5', requires=IS_NULL_OR(IS_IN_DB(db, db.asset.id, 
>> '%(Additional_Description)s'))),
>> Field('date_surrender_or_trans', 'string', length=100),
>> Field('content_string', compute=lambda r: storage_string(r)),
>>)
>>
>>

-- 
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/d/optout.


[web2py] Re: non W2p form insert

2016-05-09 Thread Mark Billion
It does indeed

On Monday, May 9, 2016 at 10:08:56 AM UTC-4, Niphlod wrote:
>
> try to prefix yourself with the following situation
>
> db.define_table('sometable', Field('somefield1'), Field('somefield2'))
>
> and then request.vars as
>
> {'somefield1' : 'abcd', 'somefield2' : 'cdef', '*contents*': 'wxyz'}
>
> trying to do db.sometable.validate_and_insert(**request.vars)
>
> will give you the exact same error ("Field *contents *does not belong to 
> the table")
>
>
>
> On Monday, May 9, 2016 at 3:11:51 PM UTC+2, Mark Billion wrote:
>>
>> Dumb question and even though I have rtmed I cannot seem to find what I 
>> am sure is right in front of me.
>>
>> I have a form that sends back data ordered by table name and I want to do 
>> something like 
>>
>> validate_and_insert(**request.vars)
>>
>> That being said, this doesnt work
>>
>>
>>
>>  Field contents does not belong to the 
>> tableVersion
>> web2py™ Version 2.12.3-stable+timestamp.2015.08.19.00.18.03
>> Python Python 2.7.6: /usr/local/bin/uwsgi (prefix: /usr)Traceback
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>> 7.
>> 8.
>> 9.
>> 10.
>> 11.
>> 12.
>> 13.
>> 14.
>>
>> Traceback (most recent call last):
>>   File "/home/www-data/web2py/gluon/restricted.py", line 227, in restricted
>> exec ccode in environment
>>   File "/home/www-data/web2py/applications/t4/controllers/default.py" 
>> <https://104.131.18.58/admin/default/edit/t4/controllers/default.py>, line 
>> 3560, in 
>>   File "/home/www-data/web2py/gluon/globals.py", line 412, in 
>> self._caller = lambda f: f()
>>   File "/home/www-data/web2py/applications/t4/controllers/default.py" 
>> <https://104.131.18.58/admin/default/edit/t4/controllers/default.py>, line 
>> 28, in storage_form_controller
>> ret = db.storage_lockers.insert(**request.vars)
>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/objects.py", line 
>> 712, in insert
>> ret = self._db._adapter.insert(self, self._listify(fields))
>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/objects.py", line 
>> 629, in _listify
>> 'Field %s does not belong to the table' % name)
>> SyntaxError: Field contents does not belong to the table
>>
>> Error snapshot [image: help] 
>> <https://104.131.18.58/admin/default/ticket/t4/75.150.158.78.2016-05-09.09-05-42.8ad1ae83-9f51-4100-b978-04eda00ba5c5#>
>>
>> Locals:
>> eld : 
>> fields : {'bank_name_address': 'd', 'client': '9', 'contents': '1141', 
>> 'date_surrender_or_trans': '1', 'id': '', 'kind': 'Storage Locker', 
>> 'others_with_access': 'dte'}
>> name : 'contents'
>> new_fields : {'bank_name_address': (, 'd'), 
>> 'client': (, '9'), 'date_surrender_or_trans': 
>> (, '1'), 'id': (, 
>> ''), 'kind': (, 'Storage Locker')}
>> self : > (id,client,kind,others_wi...ntents_5,date_surrender_or_trans,content_string)>
>> update : False
>> value : ''
>>
>

-- 
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/d/optout.


[web2py] Computed DAL Values On Insert

2016-05-09 Thread Mark Billion
When I do an insert the computed values dont updatethoughts?

def storage_form_controller():
x = request.vars.client
sl_dict = {  'client':request.vars.client,
 'kind': request.vars.kind,
 'others_with_access': request.vars.others_with_access,
 'bank_name_address': request.vars.bank_name_address,
 'date_surrender_or_trans': 
request.vars.date_surrender_or_trans,
}
for a in range(0,5):
try:
sl_dict.update({'contents_%s' %str(a+1): 
request.vars.contents[a]})
except:
pass

ret = db.storage_lockers.validate_and_insert(**sl_dict)



db.define_table('storage_lockers',
Field('client' , requires=IS_IN_DB(db, db.client.id), writable=False),
Field('kind', requires=IS_IN_SET(LOCKER)),
Field('others_with_access', 'string', length=100),
Field('bank_name_address', 'string', length=100),
Field('contents_1', requires=IS_NULL_OR(IS_IN_DB(db, db.asset.id, 
'%(Additional_Description)s'))),
Field('contents_2', requires=IS_NULL_OR(IS_IN_DB(db, db.asset.id, 
'%(Additional_Description)s'))),
Field('contents_3', requires=IS_NULL_OR(IS_IN_DB(db, db.asset.id, 
'%(Additional_Description)s'))),
Field('contents_4', requires=IS_NULL_OR(IS_IN_DB(db, db.asset.id, 
'%(Additional_Description)s'))),
Field('contents_5', requires=IS_NULL_OR(IS_IN_DB(db, db.asset.id, 
'%(Additional_Description)s'))),
Field('date_surrender_or_trans', 'string', length=100),
Field('content_string', compute=lambda r: storage_string(r)),
   )

-- 
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/d/optout.


[web2py] non W2p form insert

2016-05-09 Thread Mark Billion
Dumb question and even though I have rtmed I cannot seem to find what I am 
sure is right in front of me.

I have a form that sends back data ordered by table name and I want to do 
something like 

validate_and_insert(**request.vars)

That being said, this doesnt work


Locals:
eld : 
fields : {'bank_name_address': 'd', 'client': '9', 'contents': '1141', 
'date_surrender_or_trans': '1', 'id': '', 'kind': 'Storage Locker', 
'others_with_access': 'dte'}
name : 'contents'
new_fields : {'bank_name_address': (, 'd'), 
'client': (, '9'), 'date_surrender_or_trans': 
(, '1'), 'id': (, 
''), 'kind': (, 'Storage Locker')}
self : 
update : False
value : ''

-- 
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/d/optout.


[web2py] Re: Weird Javascript Behavior -- 2 clicks to fire (Sorry, Dont know where else to turn)

2016-05-02 Thread Mark Billion
Ok. So here is the hackity-hack solution I came up with (if you cant beat 
em, join em):

parent.document.getElementsByClassName("iframe_input")[0].click();

I just force a click on the first input element when the modal hides and 
this seems to resolve the behavior.  That being said, this seems really 
hacky and Im all ears as to why this is wrong but it does work like a 
charm

On Friday, April 29, 2016 at 9:48:47 PM UTC-4, Stuart Rolinson wrote:
>
> Hi Mark,
>
> Can you pull together a simple example showing this with your HTML, CSS 
> and Javascript.  I understand what you are trying to do but I need to see 
> more in order to understand when the click event is being applied to the 
> .iframe_add objects.
>
> Thanks
> Stuart
>
> On Friday, April 29, 2016 at 1:17:24 PM UTC-7, Mark Billion wrote:
>>
>> Here's the script.  When I click it on load, works like a charm.  When I 
>> click it via a dynamically created element, the first click sees the actual 
>> html shift (kind of stretch and go back).  It does however work on the 
>> second click consistently. 
>>
>> 
>> $(document).on('click', '.iframe_add', function(){
>> var element = $(this).attr('name');
>> $('#iframe_target').html('<iframe src="
>> <a  rel="nofollow" href="https://104.131.18.58/t3/default/ajax_new_secured_asset_debt_creator?all=">https://104.131.18.58/t3/default/ajax_new_secured_asset_debt_creator?all=</a>'+element
>>  
>> +'" frameborder="0" width="580" height="300" scrolling="yes" 
>> id="myFrame"></iframe>');
>> });
>> 
>>
>> 
>>
>> Only thing I found is: 
>> http://stackoverflow.com/questions/24487664/jquery-on-click-doesnt-work-on-first-click-with-a-dynamic-element
>>
>> I dont really get whats going on and Id  appreciate any help.
>>
>

-- 
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/d/optout.


[web2py] Weird Javascript Behavior -- 2 clicks to fire (Sorry, Dont know where else to turn)

2016-04-29 Thread Mark Billion
Here's the script.  When I click it on load, works like a charm.  When I 
click it via a dynamically created element, the first click sees the actual 
html shift (kind of stretch and go back).  It does however work on the 
second click consistently. 


$(document).on('click', '.iframe_add', function(){
var element = $(this).attr('name');
$('#iframe_target').html('');
});




Only thing I found 
is: 
http://stackoverflow.com/questions/24487664/jquery-on-click-doesnt-work-on-first-click-with-a-dynamic-element

I dont really get whats going on and Id  appreciate any help.

-- 
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/d/optout.


[web2py] Re: Execution of import statements

2016-04-29 Thread Mark Billion
Right, but if the import is a conditional one -- ie, only import a if a 
condition evals to true -- does it no op the import if the condition goes 
to false or does it import all and then execute?

On Friday, April 29, 2016 at 3:23:40 AM UTC-4, Niphlod wrote:
>
> in python if you have 
>
>
> import a
> blablabla
> import b
> blablabla
> import a
>
> the second "import a" statement is executed, but is a no-op.
>
> On Friday, April 29, 2016 at 1:20:59 AM UTC+2, Mark Billion wrote:
>>
>> I understand that the whole default.py file is executed on each request 
>> to a function internal to it. But does it import if the statement evaluates 
>> to false?
>>
>> For example if default.py has:
>>
>> Function x():
>>   If 1==2:
>> Import a
>>
>> Does a get imported every time function x is called?
>>
>>

-- 
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/d/optout.


[web2py] Execution of import statements

2016-04-28 Thread Mark Billion
I understand that the whole default.py file is executed on each request to a 
function internal to it. But does it import if the statement evaluates to false?

For example if default.py has:

Function x():
  If 1==2:
Import a

Does a get imported every time function x is called?

-- 
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/d/optout.


[web2py] Re: SQLFORM return javascript on accept

2016-04-28 Thread Mark Billion
Thats brilliant, but when I put it in the script in, it doesnt work:

ajax_form = SQLFORM(db[field_array[3]], this_page_ajax, deletable=True)

if ajax_form.process().accepted:
response.js = 'alert("hi");'

The form is being called thru a modal and ajax iframe, but even when I just 
call it alone, it doesnt work:

$('.iframe_input').click(function(){
var element = $(this).attr('name');
$('#iframe_target').html('https://104.131.18.58/t3/default/ajax_form_creator?all='+element +'" 
frameborder="0" width="580" height="300" scrolling="yes" 
id="myFrame">');

});
 

On Wednesday, April 27, 2016 at 6:15:43 PM UTC-4, Leonel Câmara wrote:
>
> Hey Mark,
>
> Use response.js for that
>
> If form.process().accepted:
>
> #dont reload
>
> response.js = """
> $("#iframe_modal").remove();
> $('.modal-dialog').remove();
> """
>
>
>
>

-- 
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/d/optout.


[web2py] SQLFORM emulate return false

2016-04-27 Thread Mark Billion


I want to have the SQLFORM submit, validate, and on success do absolutely 
nothing.  It would look like an html event equivalent to:

form onsubmit="myFunction(); return false;"


The problem is that actually injecting return false into the form means w2p 
doesnt validate.  Is there a simple way to prevent the form from doing anything 
--


Psuedocode:


If form.process().accepted:

DO NOTHING


Thoughts?

-- 
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/d/optout.


[web2py] Re: Ajax Form Update (and thank you for all the help)

2016-04-27 Thread Mark Billion
The problem is that Im at a loss. Right now, the process function calls 
next and sends to the default page.  

ajax_form = SQLFORM(db[field_array[3]], this_page_ajax, 
deletable=True).process(next = URL('default', field_array[4], 
vars=dict(cli=field_array[0])))

And Ive got it set up to deal with a situation where it returns something 
to the browser if accepted:

ajax_form = SQLFORM(db[field_array[3]], this_page_ajax, deletable=True)
if ajax_form.process().accepted:
return "fish"
'Fish' obviously displays, but I cant get it to send javascript that can be 
used to update the parent 

My next attempt is (onsuccess=success_func)

The problem with that is that I cannot think of a way to structure a 
function -- ie. success_func -- that would somehow write to the parent.

So I'm somewhat at a loss...I know Im supposed to supply more code, but Im 
just at loggerheads with this one and the only thing I can think of is to 
override the submit button with a HREF/Callback and direct the output to a 
div.  I have no problem doing that, or putting together a plugin for that 
matter, but I'm guessing there is a more elegant way to do this

On Monday, April 25, 2016 at 9:41:55 PM UTC-4, Massimo Di Pierro wrote:
>
> Can you show up some more code.
>
> On Monday, 25 April 2016 08:51:14 UTC-5, Mark Billion wrote:
>>
>> I have a form that is accessed through ajax and displayed in a 
>> modalRight now, on success, the modal clears and the parent page is 
>> reloaded, which then shows the data that was entered in the table.
>>
>> i.e., 
>>
>> ajax_form = SQLFORM(...).process(next = URL('default', page_name))
>>
>> {{for x in y:}}
>> 
>> x.idx.attr1x.attr2
>> 
>> {{pass}}
>>
>>
>> I want to prevent the parent from reloading and update the parent page 
>> via ajax on form success to include the data that is entered.  Can anyone 
>> point me to a script I can modify?
>>
>

-- 
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/d/optout.


[web2py] Ajax Form Update (and thank you for all the help)

2016-04-25 Thread Mark Billion
I have a form that is accessed through ajax and displayed in a 
modalRight now, on success, the modal clears and the parent page is 
reloaded, which then shows the data that was entered in the table.

i.e., 

ajax_form = SQLFORM(...).process(next = URL('default', page_name))

{{for x in y:}}

x.idx.attr1x.attr2

{{pass}}


I want to prevent the parent from reloading and update the parent page via 
ajax on form success to include the data that is entered.  Can anyone point 
me to a script I can modify?

-- 
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/d/optout.


[web2py] Re: Cascade is killing me

2016-04-21 Thread Mark Billion
That fixed it!

On Thursday, April 21, 2016 at 3:30:39 PM UTC-4, Anthony wrote:
>
> Try with a fresh table and see if cascade works.
>
> On Thursday, April 21, 2016 at 3:27:25 PM UTC-4, Mark Billion wrote:
>>
>> It was added later.
>>
>> On Thursday, April 21, 2016 at 3:23:19 PM UTC-4, Anthony wrote:
>>>
>>> Was Income_Src a reference field when you first created the table, or 
>>> did you make that change later?
>>>
>>> On Thursday, April 21, 2016 at 2:16:10 PM UTC-4, Mark Billion wrote:
>>>>
>>>> No, I mean the first one.  I delete an income entry and the associated 
>>>> deduction entries still stick around.
>>>>
>>>> Btw, when I run MYSQL> SHOW CREATE TABLE deductions, I get: 
>>>>
>>>>  deductions | CREATE TABLE `deductions` (
>>>>   `id` int(11) NOT NULL AUTO_INCREMENT,
>>>>   `client` varchar(512) DEFAULT NULL,
>>>>   `Deduction_Type` varchar(512) DEFAULT NULL,
>>>>   `Income_Src` varchar(512) DEFAULT NULL,
>>>>   `Deduction_Amount` decimal(18,2) DEFAULT NULL,
>>>>   `B_22_Deduction_Amount` decimal(18,2) DEFAULT NULL,
>>>>   `Additional_Description` varchar(50) DEFAULT NULL,
>>>>   `deduction_type_string` varchar(512) DEFAULT NULL,
>>>>   `deduction_line_string` varchar(512) DEFAULT NULL,
>>>>   `income_src_cat` varchar(512) DEFAULT NULL,
>>>>   `income_src_string` varchar(512) DEFAULT NULL,
>>>>   PRIMARY KEY (`id`)
>>>> ) ENGINE=InnoDB AUTO_INCREMENT=302 DEFAULT CHARSET=utf8 |
>>>>
>>>>
>>>>
>>>>
>>>> On Thursday, April 21, 2016 at 2:11:34 PM UTC-4, Leonel Câmara wrote:
>>>>>
>>>>> Do you mean you delete something in table "income" and nothing is 
>>>>> deleted in "deductions"?
>>>>>
>>>>> Or do you mean you delete something from the set DEBTOR_TOGGLE_NO_BOTH 
>>>>> and no row is deleted in table "income"?
>>>>>
>>>>> The second one is obviously to be expected since cascading is a 
>>>>> database operation and the element you deleted would be in a set in your 
>>>>> code not in the dabatase.
>>>>>
>>>>

-- 
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/d/optout.


[web2py] Re: Cascade is killing me

2016-04-21 Thread Mark Billion
It was added later.

On Thursday, April 21, 2016 at 3:23:19 PM UTC-4, Anthony wrote:
>
> Was Income_Src a reference field when you first created the table, or did 
> you make that change later?
>
> On Thursday, April 21, 2016 at 2:16:10 PM UTC-4, Mark Billion wrote:
>>
>> No, I mean the first one.  I delete an income entry and the associated 
>> deduction entries still stick around.
>>
>> Btw, when I run MYSQL> SHOW CREATE TABLE deductions, I get: 
>>
>>  deductions | CREATE TABLE `deductions` (
>>   `id` int(11) NOT NULL AUTO_INCREMENT,
>>   `client` varchar(512) DEFAULT NULL,
>>   `Deduction_Type` varchar(512) DEFAULT NULL,
>>   `Income_Src` varchar(512) DEFAULT NULL,
>>   `Deduction_Amount` decimal(18,2) DEFAULT NULL,
>>   `B_22_Deduction_Amount` decimal(18,2) DEFAULT NULL,
>>   `Additional_Description` varchar(50) DEFAULT NULL,
>>   `deduction_type_string` varchar(512) DEFAULT NULL,
>>   `deduction_line_string` varchar(512) DEFAULT NULL,
>>   `income_src_cat` varchar(512) DEFAULT NULL,
>>   `income_src_string` varchar(512) DEFAULT NULL,
>>   PRIMARY KEY (`id`)
>> ) ENGINE=InnoDB AUTO_INCREMENT=302 DEFAULT CHARSET=utf8 |
>>
>>
>>
>>
>> On Thursday, April 21, 2016 at 2:11:34 PM UTC-4, Leonel Câmara wrote:
>>>
>>> Do you mean you delete something in table "income" and nothing is 
>>> deleted in "deductions"?
>>>
>>> Or do you mean you delete something from the set DEBTOR_TOGGLE_NO_BOTH 
>>> and no row is deleted in table "income"?
>>>
>>> The second one is obviously to be expected since cascading is a database 
>>> operation and the element you deleted would be in a set in your code not in 
>>> the dabatase.
>>>
>>

-- 
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/d/optout.


[web2py] Re: Cascade is killing me

2016-04-21 Thread Mark Billion
No, I mean the first one.  I delete an income entry and the associated 
deduction entries still stick around.

On Thursday, April 21, 2016 at 2:11:34 PM UTC-4, Leonel Câmara wrote:
>
> Do you mean you delete something in table "income" and nothing is deleted 
> in "deductions"?
>
> Or do you mean you delete something from the set DEBTOR_TOGGLE_NO_BOTH and 
> no row is deleted in table "income"?
>
> The second one is obviously to be expected since cascading is a database 
> operation and the element you deleted would be in a set in your code not in 
> the dabatase.
>

-- 
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/d/optout.


[web2py] Cascade is killing me

2016-04-21 Thread Mark Billion
Parent table is income:

db.define_table('income',
   Field('client' , requires=IS_IN_DB(db, db.client.id), writable=False),
   
   Field('source', requires=IS_IN_SET(DEBTOR_TOGGLE_NO_BOTH),))

Child Table is deductions:

db.define_table('deductions',
   Field('client' , requires=IS_IN_DB(db, db.client.id), writable=False),
   .
   Field('Income_Src', 'reference income', requires=IS_IN_DB(db, 
db.income.id, '%(Employer_Name)s')),
   Field('Additional_Description' , 'string', length=50))

deductions.Income_Src references income.

When I delete an income source, it doesnt cascade.What am I missing? (I 
know this is an easy question, but I cant find the answer anywhere)

-- 
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/d/optout.


Re: [web2py] Re: Bug / Dumb Question a = b= []

2015-12-11 Thread Mark Billion
 -- thats a really good point!  I did not mean to do that!

On Wed, Dec 9, 2015 at 3:25 PM, Ron McOuat <ron.mco...@gmail.com> wrote:

> Are you sure you want to do that?
>
> a = b = []
>
> binds a and b to the same empty list object so whatever you do to a will
> also appear in b because they both reference the same list object.
> Assignment does not create a new object, it simply binds a variable name on
> the left to the object on the right.
>
> Try this:
>
> a = b = []
> a.insert(0,2)
> print a, b
>
> should print
> [2] [2]
>
> A great source of bugs if a and b are thought to be different objects.
>
> Ron
>
>
> On Tuesday, 8 December 2015 07:01:36 UTC-8, Mark Billion wrote:
>>
>> in python 2.6, I can run a = b = [] and get the expected result.  In W2P,
>> when I do it, it throws an exception as the list does not propagate to both
>> a & b.  It would make my code cleaner, but otherwise not a problem.  Just
>> wanted to give a shout in case anyone gave a 
>>
>> Thanks again for all of your help!
>>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/xCXgIDUZVnU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Mark M. Billion
1904 N. Lincoln
Wilmington, DE 19806
302.416.2199

-- 
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/d/optout.


[web2py] Bug / Dumb Question a = b= []

2015-12-08 Thread Mark Billion
in python 2.6, I can run a = b = [] and get the expected result.  In W2P, 
when I do it, it throws an exception as the list does not propagate to both 
a & b.  It would make my code cleaner, but otherwise not a problem.  Just 
wanted to give a shout in case anyone gave a 

Thanks again for all of your help!  

-- 
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/d/optout.


[web2py] Nginx Gateway Timeout

2015-11-21 Thread Mark Billion
It takes a while to process certain pdf creation requests and the Nginx 
server is throwing a 504 error.  Its atop ubuntu 14.04 w web2py -- it was 
set up using the included w2p scripts.

I am sure that this is a simple question, but my searching has only located 
answers about some PHP function.

-- 
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/d/optout.


[web2py] invalid literal for long() with base 10: 'cli_wiki'

2015-11-13 Thread Mark Billion
SQLFORM(db.cli_wiki) throws this error.  At the same time, when I use a 
different table in its place, all is okthoughts

-- 
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/d/optout.


[web2py] Re: invalid literal for long() with base 10: 'cli_wiki'

2015-11-13 Thread Mark Billion
NM.  Im an idiot.

On Friday, November 13, 2015 at 3:52:20 PM UTC-5, Mark Billion wrote:
>
> SQLFORM(db.cli_wiki) throws this error.  At the same time, when I use a 
> different table in its place, all is okthoughts
>

-- 
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/d/optout.


[web2py] Re: db(db.x.id in [foo, man, chu]).select() does not work

2015-11-12 Thread Mark Billion
Works like a charm.  Thanks

On Thursday, November 12, 2015 at 11:46:33 AM UTC-5, Anthony wrote:
>
> db.x.id.belongs([list, of, ids])
>
>
>
> On Thursday, November 12, 2015 at 11:35:48 AM UTC-5, Mark Billion wrote:
>>
>> I want to select all database rows with ids in a preset list ... contains 
>> grabs everything that is like the list entry -- i.e. .contains(1) will snag 
>> records 1, 12, etc.  And 'in' obviously doesnt work.  Thoughts?
>>
>

-- 
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/d/optout.


[web2py] securing download function

2015-11-12 Thread Mark Billion
Im not sure if this is necessary/redundant, but here is my question:

Is there any way to check permission for the download -- i.e.,  the client 
associated with the file is checked and confirmed prior to the initiation 
of the dl without having to pass extra vars -- i.e., just using the 
filename that is passed as an argument?

db.define_table('foo',
Field('client', ...),
Field('file', ...),
Field('auth_user', ...),
)


def download():
*In pseudocode:*
*q = db(db.foo.file == [filename]).select().last()*
*if q.auth_user != auth.user.id:*
*  redirect/fail*
"""
allows downloading of uploaded files
http:///[app]/default/download/[filename]
"""
return response.download(request, db)

-- 
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/d/optout.


[web2py] db(db.x.id in [foo, man, chu]).select() does not work

2015-11-12 Thread Mark Billion
I want to select all database rows with ids in a preset list ... contains 
grabs everything that is like the list entry -- i.e. .contains(1) will snag 
records 1, 12, etc.  And 'in' obviously doesnt work.  Thoughts?

-- 
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/d/optout.


[web2py] Re: Way to query from a select object

2015-11-03 Thread Mark Billion
Yep.  Am using the same data over and over and over

On Tuesday, November 3, 2015 at 11:51:53 AM UTC-5, Anthony wrote:
>
> Assuming there is some reason you can't move the additional query 
> conditions to the database and you must do the filtering in Python (e.g., 
> the query is complex or you need to filter the same set of rows in multiple 
> ways), you can use the .find() method 
> <http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#find--exclude--sort>
>  
> of the Rows object:
>
> primary_residence_rows = all_rows.find(lambda r: r.primary_residence == 
> True)
>
> Anthony
>
> On Tuesday, November 3, 2015 at 8:53:49 AM UTC-5, Mark Billion wrote:
>>
>> This seems ugly:
>> foo = db(db.xxx.id==x.id).select()
>> for a in foo:
>> if a.primary_residence == True:
>> nine_b_count = 1
>> ..
>> Is there a way for me to select only the elements of foo that meet the 
>> secondary test.  Something like foo.select(a.primary_residence == True) #I 
>> know this is wrong
>>
>>

-- 
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/d/optout.


[web2py] Way to query from a select object

2015-11-03 Thread Mark Billion
This seems ugly:
foo = db(db.xxx.id==x.id).select()
for a in foo:
if a.primary_residence == True:
nine_b_count = 1
..
Is there a way for me to select only the elements of foo that meet the 
secondary test.  Something like foo.select(a.primary_residence == True) #I 
know this is wrong

-- 
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/d/optout.


[web2py] Re: _onkeyup / ajax call

2015-10-15 Thread Mark Billion
Tried, but had problems with longer ones

j_query_calls = """https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js&quot</a>;>
"""
row_adder = """

$( document ).ready(function() {
$('#Debts_creditor__row').after('<tr id="suggestion_id"><td 
colspan=2><font color=#006100>Suggested Creditors</font></td></tr><tr 
id="suggestion_id"><td colspan=2><font color=#006100><div 
id="suggestions"></div></font></td></tr>');
$( "#Debts_creditor" ).keyup(function() {
 ajax('%s', ['creditor'], 'suggestions');
});});

""" %URL('default', 'cred_selector')

return '%s%s%s' %(j_query_calls,row_adder, ajax_form)

On Wednesday, October 14, 2015 at 8:24:58 PM UTC-4, Dave S wrote:
>
>
>
> On Wednesday, October 14, 2015 at 2:30:03 PM UTC-7, Mark Billion wrote:
>>
>> NM.  I injected the jquery into the header.  
>>
>
> Element selection?
>
> /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.
For more options, visit https://groups.google.com/d/optout.


[web2py] _onkeyup / ajax call

2015-10-14 Thread Mark Billion
Im pulling my hair out. . . . 

Im using an inline call to the web2py ajax function via the controller as 
below:

ajax_form.element('#Debts_creditor')['_onkeyup'] = 
"ajax('https:.../t2/default/cred_selector', ['creditor'], 'suggestions');"

The goal is for this ajax call to control a div that I am inserting in a 
dynamically created iframe div, per below.

Ive been at this for two days and cannot for the life of me figure out what 
Im doing wrong.  Any help would be much appreciated.



$('.iframe_input').click(function(){
var element = $(this).attr('name');
$('#iframe_target').html('');

});


function row_adder() {

var iframe = document.getElementById('myFrame'),
iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
$(iframeDoc).find('#Debts_creditor__row').after('here');

}





def cred_selector():
if not request.vars.creditor:
return ""
else:
click_string = "jQuery('#Debts_creditor').val('%s'); 
jQuery('#Debts_street_1').val('%s'); \
jQuery('#Debts_street_2').val('%s'); 
jQuery('#Debts_zip_code').val('%s')"

pattern = request.vars.creditor + '%'
selected = [[row.creditor, row.street_1, row.street_2, 
row.zip_code] for row in 
db(db.preferred_creditor.creditor.like(pattern)).select()]

return ''.join([DIV(k[0], _onclick=click_string %(k[0], k[1], k[2], 
k[3]), 

_onmouseover="this.style.backgroundColor='grey'",

_onmouseout="this.style.backgroundColor='white'").xml() for k in selected])


-- 
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/d/optout.


[web2py] Re: _onkeyup / ajax call

2015-10-14 Thread Mark Billion
NM.  I injected the jquery into the header.  

On Wednesday, October 14, 2015 at 2:22:39 PM UTC-4, Mark Billion wrote:
>
> Im pulling my hair out. . . . 
>
> Im using an inline call to the web2py ajax function via the controller as 
> below:
>
> ajax_form.element('#Debts_creditor')['_onkeyup'] = 
> "ajax('https:.../t2/default/cred_selector', ['creditor'], 'suggestions');"
>
> The goal is for this ajax call to control a div that I am inserting in a 
> dynamically created iframe div, per below.
>
> Ive been at this for two days and cannot for the life of me figure out 
> what Im doing wrong.  Any help would be much appreciated.
>
> 
> 
> $('.iframe_input').click(function(){
> var element = $(this).attr('name');
> $('#iframe_target').html('<iframe src="
> <a  rel="nofollow" href="https://104.131.18.58/t2/default/ajax_form_creator">https://104.131.18.58/t2/default/ajax_form_creator</a>?' +
> 'all='+ element + 
> '" frameborder="0" width="580" height="300" scrolling="yes" 
> id="myFrame" onload="row_adder()"></iframe>');
> 
> });
> 
> 
> function row_adder() {
> 
> var iframe = document.getElementById('myFrame'),
> iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
> $(iframeDoc).find('#Debts_creditor__row').after('<tr 
> id="suggestions"><td colspan=2>here</td></tr>');
> 
> }
> 
> 
>
>
>
> def cred_selector():
> if not request.vars.creditor:
> return ""
> else:
> click_string = "jQuery('#Debts_creditor').val('%s'); 
> jQuery('#Debts_street_1').val('%s'); \
> jQuery('#Debts_street_2').val('%s'); 
> jQuery('#Debts_zip_code').val('%s')"
>
> pattern = request.vars.creditor + '%'
> selected = [[row.creditor, row.street_1, row.street_2, 
> row.zip_code] for row in 
> db(db.preferred_creditor.creditor.like(pattern)).select()]
> 
> return ''.join([DIV(k[0], _onclick=click_string %(k[0], k[1], 
> k[2], k[3]), 
> 
> _onmouseover="this.style.backgroundColor='grey'",
> 
> _onmouseout="this.style.backgroundColor='white'").xml() for k in selected])
>
>
>

-- 
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/d/optout.


[web2py] Is This Even Possible: Serve Form Via Ajax

2015-10-07 Thread Mark Billion
** Splits the input "name" attribute up => generates a query => creates 
sqlform => returns form
def ajax_form_creator():
for k,v in request.vars.iteritems():
field_array = k.split('-')

this_page_form = db[field_array[3]].id==field_array[1]
db[field_array[3]].client.requires=IS_IN_DB(db(db.client.id == x), 
"client.id", '%(d_ln)s, 
%(d_fn)s')
db[field_array[3]].client.default = x

ajax_form = SQLFORM(db[field_array[3]], this_page_form, 
deletable=True).process()
ajax_form['_id']="Ajax_Form"
return ajax_form


**  Button triggers the above script on click.  The result, the 
ajax_form, should be sent to the target div 

   



**

Nothing loads in the target div despite the fact that I know the connection 
works (i.e., I can get it to load other data into the target).  Should I 
serialize the SQLFORM object?  If so, how?  Any thoughts are greatly 
appreciated.

-- 
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/d/optout.


[web2py] Compute on Ajax Update

2015-10-05 Thread Mark Billion
db.define_table('client',
Field('d_fn', 'string', length=45,  label="""Debtor's First 
Name"""),
Field('d_ln', 'string', length=45, notnull=True, 
label="""Debtor's Last Name"""),
. . . . 
Field('caption', compute=lambda r: caption(r.d_fn, r.d_ln, 
r.c_fn, r.c_ln, r.status_flag_string)),
)

def echo():
. . . . 
ret = db(query).validate_and_update(**{field_array[2]:v})

When I updated the d_fn and d_ln strings, the caption doesnt update.  Any 
way to force this?

-- 
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/d/optout.


[web2py] interpolate table name

2015-10-01 Thread Mark Billion
Following up on my last post--this fails:

db.%s.validate_and_insert(...) %var_containing_table_name

Any thoughts on how to interpolate?


-- 
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/d/optout.


[web2py] Any idea about how to interpolate into a dal query string?

2015-09-30 Thread Mark Billion
This fails:
query = "db.%s.id==%s" %(field_array[3], field_array[1])
db(query).select()
Any idea about how to interpolate into a dal query string?

-- 
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/d/optout.


[web2py] ajax todo lists

2015-09-29 Thread Mark Billion
Does anyone have a good example out there in W2Pland?  Im looking

-- 
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/d/optout.


[web2py] if form accepts, add variable to session throws 504 error

2015-09-28 Thread Mark Billion
504 Error:
if form.accepts(request,session):
session.mycli.extend(form.vars.id)
redirect(URL('client_edit', vars={'cli':form.vars.id}))

No Error:
if form.accepts(request,session):
#session.mycli.extend(form.vars.id)
redirect(URL('client_edit', vars={'cli':form.vars.id}))

I have used this session var previously, so I know it exists and is 
populated.Thoughts?

-- 
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/d/optout.


Re: [web2py] Re: Nginx / Web2py modules dont reload

2015-09-25 Thread Mark Billion
Much appreciated everyone.  So far touch uwsgi.ini seems to be working...

On Thu, Sep 24, 2015 at 11:34 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> Track changes is really meant for testing and not for production and I
> cannot exclude something strange can happen in a highly concurrent
> environment. If the module is in the app modules/ folder, all workers
> should update it but something else may be going on. As Leonel says
> restarting uwsgi-emperor is the safest thing.
>
>
> On Thursday, 24 September 2015 18:38:32 UTC-5, Mark Billion wrote:
>>
>> Running w2p on nginx/ubuntu 14.04.  When I change a module's code, the
>> changes dont show up when I load the app again (ie a class that returned 2
>> but now returns 1 still returns 2).  Ive turned sendfile off in Nginx
>> and have reloaded the thing over and over.  Sometimes it works and
>> sometimes I get the same (wrong) result. Any thoughts?
>>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/F9wY1JcjVqo/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Mark M. Billion
1904 N. Lincoln
Wilmington, DE 19806
302.416.2199

-- 
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/d/optout.


[web2py] Nginx / Web2py modules dont reload

2015-09-24 Thread Mark Billion
Running w2p on nginx/ubuntu 14.04.  When I change a module's code, the 
changes dont show up when I load the app again (ie a class that returned 2 
but now returns 1 still returns 2).  Ive turned sendfile off in Nginx and 
have reloaded the thing over and over.  Sometimes it works and sometimes I 
get the same (wrong) result. Any thoughts?  

-- 
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/d/optout.


[web2py] Re: Nginx / Web2py modules dont reload

2015-09-24 Thread Mark Billion
Sadly I've tried that too

-- 
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/d/optout.


Re: [web2py] Re: Exception: Server address not specified

2015-08-04 Thread Mark Billion
Its strange

web2py Shell 2.7.4-stable+timestamp.2013.10.14.15.16.29In [1] : from
gluon.tools import Mail

In [2] : mail = Mail()

In [3] : mail.settings.server = 'smtp.gmail.com:465'

In [4] : mail.settings.sender = 'm...@gmail.com'

In [5] : mail.settings.login = 'm...@gmail.com:xyz'

In [6] : print mail.settings.sender
markbill...@gmail.com

All is okay.  Then when I run  q=mail.send('j...@doe.com', 'Message
subject', 'Plain text body of the message'), literally the system stops
responding (Im on web2py) and it wont even print me any output.  I have to
reload the webapp


On Tue, Aug 4, 2015 at 11:19 AM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 before the mail.send print mail.settings.sender. It is possible this value
 is reset somewhere else. It should work


 On Monday, 3 August 2015 16:04:36 UTC-5, Mark Billion wrote:

 Im pulling straight from the book and running on python anywhere, so Im a
 bit confused:

 web2py Shell 2.11.2-stable+timestamp.2015.05.30.16.33.24
 In [1] : from gluon.tools import Mail

 In [2] : mail = Mail()

 In [3] : mail.settings.server = 'smtp.gmail.com:465'

 In [4] : mail.settings.sender = 'a...@gmail.com'

 In [5] : mail.settings.login = 'a...@gmail.com:b' == Alt (Ive used both):
 In [5] : mail.settings.login = 'a:b'

 In [6] : q=mail.send('j...@doe.com', 'Message subject', 'Plain text body
 of the message')
 Traceback (most recent call last):
   File ..gluon/contrib/shell.py, line 235, in run
 exec compiled in statement_module.__dict__
   File string, line 1, in module
   File gluon/tools.py, line 437, in send
 raise Exception('Server address not specified')
 Exception: Server address not specified

 Any thoughts?

 --
 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 a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/hn2F-FhI2rw/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




-- 
Mark M. Billion
1904 N. Lincoln
Wilmington, DE 19806
302.416.2199

-- 
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/d/optout.


[web2py] Exception: Server address not specified

2015-08-03 Thread Mark Billion
Im pulling straight from the book and running on python anywhere, so Im a 
bit confused:

web2py Shell 2.11.2-stable+timestamp.2015.05.30.16.33.24
In [1] : from gluon.tools import Mail

In [2] : mail = Mail()

In [3] : mail.settings.server = 'smtp.gmail.com:465'

In [4] : mail.settings.sender = 'a...@gmail.com'

In [5] : mail.settings.login = 'a...@gmail.com:b' == Alt (Ive used both): In 
[5] : mail.settings.login = 'a:b'

In [6] : q=mail.send('j...@doe.com', 'Message subject', 'Plain text body of 
the message')
Traceback (most recent call last):
  File ..gluon/contrib/shell.py, line 235, in run
exec compiled in statement_module.__dict__
  File string, line 1, in module
  File gluon/tools.py, line 437, in send
raise Exception('Server address not specified')
Exception: Server address not specified

Any thoughts?

-- 
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/d/optout.


[web2py] Re: fillable pdf forms

2015-06-26 Thread Mark Billion
You are correct.  That said, the issue -- as it turns out -- is that the 
script requests access to /proc/self/stat but PA doesnt grant access to the 
same in the sandbox.  Id rather host remotely but Im stumped at how to work 
around this...


On Friday, June 26, 2015 at 8:02:38 AM UTC-4, Massimo Di Pierro wrote:

 I looked at the source code of pypdftk and it does not appear to depend on 
 windows. It does require pdftk installed under /usr/bin/pdftk

 On Thursday, 25 June 2015 15:19:57 UTC-5, Mark Billion wrote:

 I would like to fill a form with an FDF dict, i.e, form.pdf % 
 {element:data}.  I have seen a lot on pypdftk, but I think it requires a 
 MS system as a dependency. Any alternatives? 



-- 
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/d/optout.


[web2py] Transitioning/Bug/unable to save

2015-06-26 Thread Mark Billion
Seems the easiest way to handle the fillable pdf issue is to move over to 
rackspace.  Ive loaded a server and have w2p up and running.  Welcome app 
works fine and is editable.  I moved the entire folder from PA to 
rackspace, and it loaded up fine.  That said, I uploaded a bunch of views, 
and they won't save after editing.  I just get a red box and communication 
error.  Log files show nothing.  Thoughts?

-- 
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/d/optout.


[web2py] fillable pdf forms

2015-06-25 Thread Mark Billion
I would like to fill a form with an FDF dict, i.e, form.pdf % 
{element:data}.  I have seen a lot on pypdftk, but I think it requires a MS 
system as a dependency. Any alternatives? 

-- 
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/d/optout.


[web2py] type 'exceptions.NameError'(name 'auth' is not defined)

2015-03-11 Thread Mark Billion
We've been very stable, but this just happened last night.  Im guessing its 
a random error, but wanted to see if anyone had any thoughts.  Here's the 
code

.

6.
7.
8.
9.
10.
11.


#global route to static images.
g_im_handle = '/home/mmb21167/web2py/ba_1_1/applications/welcome/static/%s'
@auth.requires_login()
def blog_entries():

-- 
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/d/optout.


[web2py] Download/Security Issue

2015-01-13 Thread Mark Billion
If I have a page controlled by a function that has access control, do I 
need to also validate the same at the download stage?

For example (in pseudo-code):

function x():
1. Check to see if Mark Billion is the authorized user or redirect to 
google.com
2. do something
3.  return dict(image.file=image.file)

The view has the following
 {{=URL('download', args=image.file)}}


My thought is that you cannot access either function x or x.html without 
being verified as me, and I dont see how you could pass to download() 
directly, so there is no reason to add another layer of authentication in 
the download function.  Thoughts?


-- 
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/d/optout.


[web2py] Load() in a page with a form

2015-01-02 Thread Mark Billion
Ive got a page with a form embedded in it.  I also have a load call, but 
that form wont submitit will when i just pull the .load file so I know 
its not the coding.  Thoughts?

-- 
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/d/optout.


[web2py] Ajax/Updated Form Field

2014-12-30 Thread Mark Billion
I may be an idiot but

I want to set up a form so that you click to edit, and on focus out, the 
data is committed to the DB via Ajax. 

1.  Im using the inplace_edit(f,v) module from slices:

wrapper = DIV()
inp = SQLFORM.widgets.string.widget(f,v)
lbl = 
SPAN(inp['_value'],_id='inplace_edit_'+inp['_id'],_style=cursor:pointer;)
scr1 = jQuery('#%s').hide(); % inp['_id']
scr2 = jQuery('#%s').bind('click',function(e){ 
jQuery(this).hide();jQuery('#%s').show().focus();}); % \
 (lbl['_id'],inp['_id'])
scr3 = jQuery('#%s').bind('blur',function(e){ 
jQuery(this).hide();jQuery('#%s').show().text(jQuery(this).val());}); % \
 (inp['_id'],lbl['_id'])
jqscr = SCRIPT(scr1,scr2,scr3,_type=text/javascript)
wrapper.components.extend([inp,lbl,jqscr])
return wrapper

2.  My thought based on the book is that I need to add ['_onkeyup'] as an 
attribute to the sqlform but this adds to the form itself.  

=ajax('{{=URL('default', 'echo')}}', ['name'], 'target') 

This failed horribly.

Is there a slice/package/tutorial/something y'all can point me to?

-- 
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/d/optout.


[web2py] Re: Ajax/Updated Form Field

2014-12-30 Thread Mark Billion
I am wondering if I answered my own (incomprehensible) question:

I plugged in Jeditable http://www.appelsiini.net/projects/jeditable, 
which is great.  Then I set the script up to post to a controller that 
inputs the data to the db (which validates, i.e., 'integer'), commits it, 
and then returns the value.  This seems safe  secure, but Im game if you 
guys disagree!  


MODELS##
db.define_table('dogs',
Field('dog_name','integer'))


CONTROLLERS##
def dogs():
xml_string = []
return locals()

def upd_dog_name():
#id,column = request.post_vars.id.split('.')
#value = request.post_vars.value
x = request.post_vars['id']
y = request.post_vars['value']
db.dogs[x]={'dog_name':y}
db.commit()

return y

VIEWS##
script src={{=URL('static','js/jquery.jeditable.js')}}/script


script
jQuery(document).ready(function(){
jQuery('.edit').editable('default/upd_dog_name',{   
tooltip: Click to edit, enter to save,
indicator : 'updating',
 onblur: 'submit'});})
/script
div class=edit id=1Dolor/div
div class=edit_area id=div_2Lorem ipsum dolor sit amet, consectetuer
adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore
magna aliquam erat volutpat./div


On Tuesday, December 30, 2014 10:46:42 AM UTC-5, Mark Billion wrote:

 I may be an idiot but

 I want to set up a form so that you click to edit, and on focus out, the 
 data is committed to the DB via Ajax. 

 1.  Im using the inplace_edit(f,v) module from slices:

 wrapper = DIV()
 inp = SQLFORM.widgets.string.widget(f,v)
 lbl = 
 SPAN(inp['_value'],_id='inplace_edit_'+inp['_id'],_style=cursor:pointer;)
 scr1 = jQuery('#%s').hide(); % inp['_id']
 scr2 = jQuery('#%s').bind('click',function(e){ 
 jQuery(this).hide();jQuery('#%s').show().focus();}); % \
  (lbl['_id'],inp['_id'])
 scr3 = jQuery('#%s').bind('blur',function(e){ 
 jQuery(this).hide();jQuery('#%s').show().text(jQuery(this).val());}); % \
  (inp['_id'],lbl['_id'])
 jqscr = SCRIPT(scr1,scr2,scr3,_type=text/javascript)
 wrapper.components.extend([inp,lbl,jqscr])
 return wrapper

 2.  My thought based on the book is that I need to add ['_onkeyup'] as an 
 attribute to the sqlform but this adds to the form itself.  

 =ajax('{{=URL('default', 'echo')}}', ['name'], 'target') 

 This failed horribly.

 Is there a slice/package/tutorial/something y'all can point me to?



-- 
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/d/optout.


Re: [web2py] Re: Dumb Question/Bug

2014-12-26 Thread Mark Billion
Just two questions for my edification:
1. Why did HTTP get grouped into exceptions
2. Is there a security reason not to catch all non-http exceptions, ie
except EXCEPTION

On Tue, Dec 23, 2014 at 3:28 PM, Mark Billion markbill...@gmail.com wrote:

 Thanks guys -- that makes a ton of sense.  I really appreciate it.

 On Tue, Dec 23, 2014 at 2:54 PM, Anthony abasta...@gmail.com wrote:

 More specifically, when you provide the next argument to
 SQLFORM.process(), it ultimately calls redirect(), which raises an HTTP
 exception. If you put the .process() call inside a try/except, that HTTP
 exception will get caught, and in your case, you are then ignoring it. We
 should probably spell this out more clearly in the book.

 You could instead do something like:

 except Exception as e:
 if isinstance(e, HTTP):
 raise e # re-raise the exception in case of a redirect
 redirect(URL('index'))

 But generally it is much better to catch specific exceptions.

 Anthony


 On Tuesday, December 23, 2014 2:44:57 PM UTC-5, Niphlod wrote:

 are you aware that in web2py any HTTP is a subclass of exception ?
 Never, never, never use an exception without specifying what exception your
 code may raise.

 On Tuesday, December 23, 2014 7:34:45 PM UTC+1, Mark Billion wrote:

 Why are you using an except without specifying the exception? Trying to
 catch all possible exceptions.

 On Tuesday, December 23, 2014 1:31:21 PM UTC-5, Leonel Câmara wrote:

 Why are you using an except without specifying the exception? Anyway
 just do this:

 @auth.requires_login()
 def cli_add():
 db.client.au_usr.default = auth.user_id
 form = SQLFORM(db.client, fields = ['d_fn', 'd_ln', 'd_aka',
 'd_ss'], labels = {'d_ss': 'Social Security', 'd_aka': 'Any Aliases',
 'd_65': 'Older than 65'}).process(next=URL('clients'))
 return dict(form=form)

  --
 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 a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/hWvrDzyR49M/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




 --
 Mark M. Billion
 1904 N. Lincoln
 Wilmington, DE 19806
 302.416.2199




-- 
Mark M. Billion
1904 N. Lincoln
Wilmington, DE 19806
302.416.2199

-- 
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/d/optout.


Re: [web2py] Re: Dumb Question/Bug

2014-12-26 Thread Mark Billion
Awesome.  I really appreciate the help.

On Fri, Dec 26, 2014 at 10:13 AM, Anthony abasta...@gmail.com wrote:

 On Friday, December 26, 2014 9:15:40 AM UTC-5, Mark Billion wrote:

 Just two questions for my edification:
 1. Why did HTTP get grouped into exceptions


 By making HTTP an exception, this allows both the framework and app code
 to short-circuit a given response at any point and immediately return
 something (e.g., you can raise an HTTP exception in a model, and it will
 return without executing the controller or view).


 2. Is there a security reason not to catch all non-http exceptions, ie
 except EXCEPTION


 I don't think it's necessarily a security issue. It's just that you
 usually don't want to catch all exceptions, particularly if your code isn't
 doing anything to actually inspect and handle the exception. You could end
 up introducing silent failures and subtle bugs. It could be OK to catch all
 exceptions if your except block then does something with the exception,
 such as executing special error handling code or re-raising particular
 exceptions.

 Anthony

 --
 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 a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/hWvrDzyR49M/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




-- 
Mark M. Billion
1904 N. Lincoln
Wilmington, DE 19806
302.416.2199

-- 
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/d/optout.


[web2py] Dumb Question/Bug

2014-12-23 Thread Mark Billion
Works Just Fine

def cli_add():
try:
db.client.au_usr.default = auth.user_id
except:
redirect(URL('index'))
form = SQLFORM(db.client, fields = ['d_fn', 'd_ln', 'd_aka', 'd_ss'], 
labels = {'d_ss': 'Social Security', 'd_aka': 'Any Aliases', 'd_65': 'Older 
than 65'}).process(next=URL('clients'))
return dict(form=form)

BUT WHEN I MOVE THE FORM CALL INTO THE TRY LOOP:

def cli_add():
try:
db.client.au_usr.default = auth.user_id
form = SQLFORM(db.client, fields = ['d_fn', 'd_ln', 'd_aka', 
'd_ss'], labels = {'d_ss': 'Social Security', 'd_aka': 'Any Aliases', 
'd_65': 'Older than 65'}).process(next=URL('clients'))
except:
redirect(URL('index'))

return dict(form=form)

The look fails into the except redirect.

Any thoughts?

-- 
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/d/optout.


[web2py] Re: Dumb Question/Bug

2014-12-23 Thread Mark Billion
Why are you using an except without specifying the exception? Trying to 
catch all possible exceptions.  

On Tuesday, December 23, 2014 1:31:21 PM UTC-5, Leonel Câmara wrote:

 Why are you using an except without specifying the exception? Anyway just 
 do this:

 @auth.requires_login()
 def cli_add():
 db.client.au_usr.default = auth.user_id
 form = SQLFORM(db.client, fields = ['d_fn', 'd_ln', 'd_aka', 'd_ss'], 
 labels = {'d_ss': 'Social Security', 'd_aka': 'Any Aliases', 'd_65': 'Older 
 than 65'}).process(next=URL('clients'))
 return dict(form=form)



-- 
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/d/optout.


Re: [web2py] Re: Dumb Question/Bug

2014-12-23 Thread Mark Billion
Thanks guys -- that makes a ton of sense.  I really appreciate it.

On Tue, Dec 23, 2014 at 2:54 PM, Anthony abasta...@gmail.com wrote:

 More specifically, when you provide the next argument to
 SQLFORM.process(), it ultimately calls redirect(), which raises an HTTP
 exception. If you put the .process() call inside a try/except, that HTTP
 exception will get caught, and in your case, you are then ignoring it. We
 should probably spell this out more clearly in the book.

 You could instead do something like:

 except Exception as e:
 if isinstance(e, HTTP):
 raise e # re-raise the exception in case of a redirect
 redirect(URL('index'))

 But generally it is much better to catch specific exceptions.

 Anthony


 On Tuesday, December 23, 2014 2:44:57 PM UTC-5, Niphlod wrote:

 are you aware that in web2py any HTTP is a subclass of exception ? Never,
 never, never use an exception without specifying what exception your code
 may raise.

 On Tuesday, December 23, 2014 7:34:45 PM UTC+1, Mark Billion wrote:

 Why are you using an except without specifying the exception? Trying to
 catch all possible exceptions.

 On Tuesday, December 23, 2014 1:31:21 PM UTC-5, Leonel Câmara wrote:

 Why are you using an except without specifying the exception? Anyway
 just do this:

 @auth.requires_login()
 def cli_add():
 db.client.au_usr.default = auth.user_id
 form = SQLFORM(db.client, fields = ['d_fn', 'd_ln', 'd_aka',
 'd_ss'], labels = {'d_ss': 'Social Security', 'd_aka': 'Any Aliases',
 'd_65': 'Older than 65'}).process(next=URL('clients'))
 return dict(form=form)

  --
 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 a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/hWvrDzyR49M/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




-- 
Mark M. Billion
1904 N. Lincoln
Wilmington, DE 19806
302.416.2199

-- 
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/d/optout.


[web2py] Safari/IE User Login Issue

2014-08-15 Thread Mark Billion
All --

Again, I am so grateful for all of your assistance.  I have a strange 
question -- when I log in to my site on chrome, mozilla,  safari handheld, 
Im just fine.  Yet, when I use safari and IE on the site from a desktop, 
the user registration form simply refuses input . . . until I use the same 
browser to log into the admin panel.  Then it can log into the site and 
everything else.  Any thoughts on this strange behavior?

-- 
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/d/optout.


[web2py] Re: Thank You

2014-08-08 Thread Mark Billion
Exactly!

On Thursday, August 7, 2014 4:41:15 PM UTC-4, Derek wrote:

 That's awesome, so it's like bankruptcy for dummies? 

 On Thursday, August 7, 2014 5:18:18 AM UTC-7, Mark Billion wrote:

 I just finished the first beta of software that automates consumer 
 chapter 7 filings...
 https://mmb21167.pythonanywhere.com/Sharkskin_2_2/default/user/login 
 https://www.google.com/url?q=https%3A%2F%2Fmmb21167.pythonanywhere.com%2FSharkskin_2_2%2Fdefault%2Fuser%2Floginsa=Dsntz=1usg=AFQjCNENvlBAgV00mM-XSz7vDYyEIjeH5w

 I wanted to take a moment to thank everyone on this board.  I have 
 learned so much and you all cannot know how valuable your insight has been.

 And Massimo, thank you so much for Web2Py -- you deserve so many 
 accolades for your hard work.

 Best,


 Mark 



-- 
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/d/optout.


[web2py] Thank You

2014-08-07 Thread Mark Billion
I just finished the first beta of software that automates consumer chapter 
7 
filings...https://mmb21167.pythonanywhere.com/Sharkskin_2_2/default/user/login

I wanted to take a moment to thank everyone on this board.  I have learned 
so much and you all cannot know how valuable your insight has been.

And Massimo, thank you so much for Web2Py -- you deserve so many accolades 
for your hard work.

Best,


Mark 

-- 
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/d/optout.


[web2py] Disabling/Limiting Access To Profile

2014-07-29 Thread Mark Billion
I want to prevent users from accessing their profile and changing data 
after registration.  Is there a way to disable 
http:///[app]/default/user/profile without disturbing the balance of 
the user-auth suite?

-- 
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/d/optout.


[web2py] SQL Forms Redirect

2014-05-06 Thread Mark Billion
I have an SQLFORM that accepts certain user data, and then needs to update 
the record that was just created.  

My command reads: 
form = SQLFORM(db.album).process(next=URL('album', 
args=[request.args(0,cast=int), *myform.vars.id*])) 

Both myform.vars.id and form.vars.id fail when included as this second 
argument.

Thoughts?

And as always, I owe everyone on this forum a beer.

-- 
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/d/optout.


[web2py] Re: Custom Form Widget Question

2014-05-06 Thread Mark Billion
Great idea.  I did that and it works perfectly!

On Monday, May 5, 2014 4:00:59 PM UTC-4, Jim S wrote:

 Maybe a dropdown isn't the right control for this situation.  Have you 
 considered an autocomplete widget?  How many rows are in your dropdown?

 -Jim


 On Saturday, May 3, 2014 3:13:40 PM UTC-5, Mark Billion wrote:

 How can I set the width of the dropdown menu for an input?  The thing is 
 way too long because its trying to be longer than the textsorry, I know 
 its dumb, but I cant find anything



-- 
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/d/optout.


[web2py] Re: SQL Forms Redirect

2014-05-06 Thread Mark Billion
When I put that in, I get 
 global name 'myform' is not defined...thoughts?

On Tuesday, May 6, 2014 10:01:13 AM UTC-4, Anthony wrote:

 If you want to include the id in the query string (i.e., ?id=1), then you 
 have to use the vars argument to URL() and give it a dictionary:

 URL('album', args=[request.args(0,cast=int), vars=dict(id=myform.vars.id
 )])

 Anthony

 On Tuesday, May 6, 2014 9:13:55 AM UTC-4, Mark Billion wrote:

 I have an SQLFORM that accepts certain user data, and then needs to 
 update the record that was just created.  

 My command reads: 
 form = SQLFORM(db.album).process(next=URL('album', 
 args=[request.args(0,cast=int), *myform.vars.id http://myform.vars.id*])) 


 Both myform.vars.id and form.vars.id fail when included as this second 
 argument.

 Thoughts?

 And as always, I owe everyone on this forum a beer.



-- 
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/d/optout.


[web2py] Custom Form Widget Question

2014-05-03 Thread Mark Billion
How can I set the width of the dropdown menu for an input?  The thing is 
way too long because its trying to be longer than the textsorry, I know 
its dumb, but I cant find anything

-- 
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/d/optout.


[web2py] Line Breaks in DAL Entries

2014-05-01 Thread Mark Billion
I have a database entry that looks like this when I enter the DB admin:

Mark's Restaurant 

MEAL PLAN 

NOTICE

When it prints, I get:

Mark's Restaurant MEAL PLAN NOTICE

My problem is that I would like to split the text by line but I cant figure 
out what the raw symbol is for the break (i.e., \r\n), as when I add these, 
they are ignored.  Can you point me in the right direction.

-- 
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/d/optout.


[web2py] Re: Line Breaks in DAL Entries

2014-05-01 Thread Mark Billion
Perfect.  Thank you so much.

On Thursday, May 1, 2014 4:27:51 PM UTC-4, Anthony wrote:

 Are you saying you want to retain the line breaks when it is rendered in 
 HTML (e.g., in a grid or read-only form)? If so, you can do something like:

 Field('myfield', 'text', represent=lambda v, r: XML(v.replace('\n', 'br'
 )))

 or

 Field('myfield', 'text', represent=lambda v, r: PRE(v))

 Anthony

 On Thursday, May 1, 2014 3:24:16 PM UTC-4, Mark Billion wrote:

 I have a database entry that looks like this when I enter the DB admin:

 Mark's Restaurant 

 MEAL PLAN 

 NOTICE

 When it prints, I get:

 Mark's Restaurant MEAL PLAN NOTICE

 My problem is that I would like to split the text by line but I cant 
 figure out what the raw symbol is for the break (i.e., \r\n), as when I add 
 these, they are ignored.  Can you point me in the right direction.



-- 
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/d/optout.


[web2py] Calling a function from a different controller

2014-04-11 Thread Mark Billion

This seems like a really dumb question to me, but I cant seem to find an 
answer. 


Controllers are 'default.py' and 'worker.py'

In worker.py, I want to call foo(x,y), which is a function in default.py.

Thoughts on how to do that?

-- 
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/d/optout.


Re: [web2py] Calling a function from a different controller

2014-04-11 Thread Mark Billion
Thanks!  

On Friday, April 11, 2014 11:49:30 AM UTC-4, Carlos Cesar Caballero Díaz 
wrote:

  I think that the function foo(a,b) could be in modules, you will be able 
 to call it from any place.


 El 11/04/14 11:36, Mark Billion escribió:
  

 This seems like a really dumb question to me, but I cant seem to find an 
 answer. 


 Controllers are 'default.py' and 'worker.py'

 In worker.py, I want to call foo(x,y), which is a function in default.py.

 Thoughts on how to do that?
  -- 
 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+un...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/d/optout.


 

-- 
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/d/optout.


[web2py] Re: Example of web2py integration with an AJAX grid (preferably jquery based) which updates backend db ?

2014-03-07 Thread Mark Billion
I am sure I am an idiot, but when I hit enter to update (ie, petunia to 
petuniatest), it reverts back to the same old dog name (petunia).  

def dogs():
db.dogs.dog_name.represent = lambda value, row: DIV(value if value else 
'-',_class='dog_name', _id=str(row.id)+'.dog_name')
g = SQLFORM.grid(db.dogs, searchable=False, csv=False, 
user_signature=False)
return dict(form = g)


def upd_dog_name():
id,column = request.post_vars.id.split('.')
value = request.post_vars.value
db(db.dogs.id == id).update(**{column:value})
return value

{{extend 'layout.html'}}

script
jQuery(document).ready(function(){
jQuery('.dog_name').editable({{=URL('dogs', 
'upd_dog_name')}},{   
tooltip: Click to edit, enter to save,
 indicator : 'updating',
 });})
/script


div id='dogs'
{{=form}}
/div

db.define_table('dogs',
Field('dog_name','string'))





On Monday, September 2, 2013 8:10:59 PM UTC-4, Tim Richardson wrote:

 Can anyone provide tutorial/example of a web2py implementation of an AJAX 
 grid which updates records? web2py slices has jqgrid in read only mode, 
 (although the example doesn't work out of the box anymore).
 My learning curve is working out good ways to send update requests back to 
 the server, however pretty sure this wheel is already invented.

 Overall, I want to have the skills to add inline editing to my web2py apps 
 and I think using a javascript grid is the only realistic way to do this.





-- 
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/d/optout.


[web2py] Exceedingly Dumb Question about chaining db conditions

2014-02-27 Thread Mark Billion
So Ive got a select request that looks like this:

 a = db((db.clear.client==req_arg_0)  ((db.clear.Property_Type != 'aa')  
(db.clear.Property_Type != 'bb')  (db.clear.Property_Type != 
'cc'))).select()

And it works just fine.

However, when I do:

 a = db((db.clear.client==req_arg_0)  (db.clear.Property_Type not in [ 
'aa', 'bb', 'cc'])).select()

it selects everything where client == req_arg_0 and disregards the second 
premiseeven though I thought these were supposed to be equivalent 
expressions.

I know this is an easy fix, but Im not seeing it

-- 
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.


[web2py] Re: Exceedingly Dumb Question about chaining db conditions

2014-02-27 Thread Mark Billion
Thank you! 

On Thursday, February 27, 2014 1:24:06 PM UTC-5, Leonel Câmara wrote:

 What you're looking for is belongs

  a = db((db.clear.client==req_arg_0)  (!db.clear.Property_Type.belongs([ 
 'aa', 'bb', 'cc'])).select()


-- 
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.


[web2py] Importing Data / Force Record ID #s To Remain As Specified in the CSV

2014-01-23 Thread Mark Billion
I know that this is a dumb question, but I have a database with static data 
entry ids 17 to 100.  When I download the CSV, it has the x.id field and 
the corresponding number.  However, when I create a new database and upload 
the data using the db admin, it automatically renumbers these entries.  
Because its static, I have been referencing it by id -- so renumbering 
throws this off.

Anything I can do? 

-- 
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.


[web2py] Updating DAL elements with a loop

2014-01-21 Thread Mark Billion
I have a database that accepts user data and then repurposes it for use in 
a different context.  The problem is scrubbing for None; I can do it, but 
its ugly going line by line -- Id rather loop through it but I cant get it 
to work.  

Approach #1

for r in rows:
   . . . . 

   for e in [r.name . . . ]:
 if e == None:
 e = ''
 r.update_record()

#OUTPUT: r.name - unchanged . . . e = '' // Updates variable e, not the 
loop variables

Approach #2

for r in rows:
   . . . . 

   for k, v in {'name' : r.name . . . ].items():
 if v == None:
 v = ''
 r.update_record(k=v)

#OUTPUT: throws error

Thoughts?



-- 
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.


[web2py] DAL looping update

2014-01-21 Thread Mark Billion
  I cannot seem to get this code to run, even though Im almost sure Im 
right.any thoughts would be appreciated!

for r in rows:

  . . . . . 

  for k, v in {'name': r.name, 'address': r.address . . .  }.items():
  if v is None:
db(db.client.id==r.id).update(**{k:'Not Specified'})

-- 
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.


[web2py] Re: DAL looping update

2014-01-21 Thread Mark Billion
This is perfect, thanks.  Meant it wouldnt run, and the values were NULL.

On Tuesday, January 21, 2014 11:25:39 AM UTC-5, Anthony wrote:

 What do you mean it won't run? Do you get an error, or just don't see the 
 changes you expect? Are the values in question in the database actually 
 None (i.e., NULL), or are they empty strings ('')?

 If you're trying to change all the records in the table, would be easier 
 to do:

 for field in ['name', 'address']:
 db(db.mytable[field] == None).update(**{field: 'Not Specified'})

 That will just issue two updates rather selecting the entire table and 
 then doing two updates per row.

 Also, if you have a Rows object and need to make multiple changes to a 
 given Row, you can do:

 row.update(...)
 row.update(...)
 row.update_record()

 The row.update() calls make changes to the Row object itself (but not the 
 database). Then, .update_record() updates the database with whatever 
 changes have been made to the Row.

 Anthony

 On Tuesday, January 21, 2014 11:00:10 AM UTC-5, Mark Billion wrote:

   I cannot seem to get this code to run, even though Im almost sure Im 
 right.any thoughts would be appreciated!

 for r in rows:

   . . . . . 

   for k, v in {'name': r.name, 'address': r.address . . .  }.items():
   if v is None:
 db(db.client.id==r.id).update(**{k:'Not Specified'})



-- 
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.