Richard | 28 Apr 01:56 2015
Picon

anyone had developed something related to electronic signature in web2py app

Hello,

I would like to know if anyone had developed any kind of electronic signature involving some record signature or encryption inside a web2py app?

Thanks

Richard

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
tommasot | 27 Apr 23:44 2015
Picon

Cron <at> reboot and socket server on web2py startup

I want run a simple script on web2py startup,that listen on a tcp port

the script is the following "example.py". The file in the "applications/myapp/cron" folder



import SocketServer
import logging

class MyTCPHandler(SocketServer.BaseRequestHandler):


    # handle syslog event message
def handle(self):
self.logger = logging.getLogger("web2py.app.easylog")
self.logger.setLevel(logging.DEBUG)
messagelog = self.request.recv(1024).strip()
self.logger.info(messagelog)

if __name__ == "__main__":
HOST, PORT = "0.0.0.0", 514
servertcp = SocketServer.TCPServer((HOST, PORT), MyTCPHandler)


servertcp.serve_forever()

i have created into the "cron" folder the crontab file with the following content:
<at> reboot root *applications/easylog/cron/example.py

i run web2py with the following shell command "sudo python web2py.py -Y"

The first time web2py is running everything works fine and i am able to connect with telnet on port 514

If i kill web2py and restart it the no more open port on 514

The question is.... Why? 

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
hiro | 27 Apr 16:40 2015
Picon

Best way to load password at startup.

I connect to an external DB in one of my models:

my_model.db:

my_db = DAL(
    'postgres://use:password <at> url/database',
    pool_size=20,
    after_connection=lambda self: self.execute('set search_path to my_schema, other_schema, public; set statement_timeout to 60000;'),
    migrate=False
)

Now we are planning to adding the project to a git repository and I would now like to store our password there. 

I though about just creating the connection string by reading the .pgpass file. It will probably work but it seems unnecessary to read .pgpass every request. What is the best way to load the password at startup but not all other requests? Maybe just create in if statement?

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
黄祥 | 27 Apr 15:13 2015
Picon

print html page view on dot matrix printer

hi, 

is it possible to print html page view on dot matrix printer using web2py?
i've tried it but the result is not expected? the font is near each other.
how can i solve this when i generate a html view using web2py?

thanks and best regards,
stifan

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Alex Glaros | 27 Apr 08:00 2015
Picon

How to capture auth_user.id during registration

How to capture auth_user.id during registration

Code is below.  No error message but the value is "None" instead of the auth_user.id

It correctly captures first_name and last_name from auth_user form vars.

    form=SQLFORM.factory(db.SuperObject,db.Party,db.auth_user,db.PartyAddressIntersection,db.Address)
    if form.process().accepted:
        response.flash='Thanks for filling the form'
        form.vars.displayName = form.vars.objectDisplayName = '%(first_name)s %(last_name)s' % form.vars
        form.vars.superObjectID = db.SuperObject.insert(**db.SuperObject._filter_fields(form.vars))
        form.vars.partyID = db.Party.insert(**db.Party._filter_fields(form.vars))
        db.auth_user.insert(**db.auth_user._filter_fields(form.vars))
        form.vars.addressID = db.Address.insert(**db.Address._filter_fields(form.vars))
        db.PartyAddressIntersection.insert(**db.PartyAddressIntersection._filter_fields(form.vars))
        theMessage =  'newly registered user: '  + ' ' + str(request.now)  + ' ' + '%(auth_user.id)s %(first_name)s %(last_name)s' % form.vars
        theSubject = 'newly registered user' 
        mail.send(to='alex-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org', subject=theSubject, message=theMessage)
        redirect(URL('/user/login'))
    return dict(form=form)

thanks,

Alex Glaros

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
weheh | 27 Apr 01:09 2015
Picon
Picon

can't import files

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
Traceback (most recent call last):
File "C:\web2py\gluon\restricted.py", line 224, in restricted
exec ccode in environment
File "C:/web2py/applications/myapp/models/0_db_1_user.py", line 18, in <module>
import my_module
File "C:\web2py\gluon\custom_import.py", line 82, in custom_importer
modules_prefix, globals, locals, [itemname], level)
File "C:\web2py\gluon\custom_import.py", line 131, in __call__
result = NATIVE_IMPORTER(name, globals, locals, fromlist, level)
ImportError: No module named myapp.modules

The modules folder exists.
There  is __init__.py in the modules folder.

What gives?

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Gael Princivalle | 26 Apr 22:07 2015
Picon

Email auth settings

Hi all.

I would like to customize emails that web2py send to the user for email verification and password change.
For example now I have for email verification:
Welcome myemail-3Q2Tfjf0mexWk0Htik3J/w@public.gmane.org! Click on the link http... to verify your email

How can I do it?

Another thing, how is it possible to have the last registered user row in auth.settings.register_onaccept?
I would like to send an email when a new user sign in.
auth.settings.register_onaccept = lambda user: mail.send(to='my_email <at> my_domain.com',subject='New user on my_domain.com',message='<html>New user on my_domain.com<br/>' + user.first_name + '</html>')

Is it possible to do it?

Thanks, regards.


--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Sarbjit | 26 Apr 15:24 2015
Picon

Updating multiple targets using AJAX callback

Hi,

I have used AJAX based cascading drop down menu based on slice "http://www.web2pyslices.com/slice/show/1526/cascading-drop-down-lists-with-ajax-2"

I have introduced a third drop down whose value is populated based on the selection of second drop down.

I am using the following code : (Not the exact code, but it'll be enough to explain the flow)

VIEWS:

<select>  <!-- DROPDOWN1-->
onchange="jQuery('#dropdown2_a').empty(); 
ajax('{{=URL('default','getoptionsfordropdown2'})}}', [''], 'dropdown2');">
..
</select>
<span id='dropdown2'>
<select id='dropdown2_a'>      <!-- DROPDOWN2-->
onchange="jQuery('#dropdown3_a').empty(); 
ajax('{{=URL('default','getoptionsfordropdown3'})}}', [''], 'dropdown3');">
</select>
</span>
<span id='dropdown3'>
<select id='dropdown3_a'>   <!-- DROPDOWN3-->
</select>
</span>

CONTROLLER:

getoptionsfordropdown2/getoptionsfordropdown3:

def ...
.... query the db and build SELECT ....
return SELECT(...)


Problem:

So, at any point of time, if the option in the drop down1 is not changed, then everything works fine i.e. changes in dropdown2 updates the options in dropdown3.

However, once the dropdown1 option is changed, dropdown3 contents are not RESET (No code for it, and I need some guidance for it). So, I have to change the option in dropdown2 and come-back in order to change the options in dropdown3. Basically, once an option is changed in drop down1, user has to change the option in dropdown2 once in order to update the dropdown3.

Can someone please suggest me on how to handle this situation such that changing the dropdown1 should update dropdown3 as well (based on the value of dropdown2).

Is it possible to call multiple forcefully trigger the onchange event for dropdown2 once it is re-populated based on the changes in dropdown1.


--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
黄祥 | 26 Apr 13:18 2015
Picon

sub sub menu in newest version

hi,

i realize that web2py sub sub menu in newest version is not work as expected (no error occured but the result is not expected).
models/menu.py
response.menu = [
(T('Menu'), False, URL('default', 'index'), [
(T('Sub Menu 1'), False, URL('default', 'index'), [
(T('Sub Menu 2'), False, URL('default', 'index'), []),
]),
]), 
]

result in html browser
<ul class="dropdown-menu">
<li class="dropdown-submenu">
<a href="/test/default/index">Sub Menu 1</a>
<ul class="dropdown-menu">
<li>
<a href="/test/default/index">Sub Menu 2</a>
</li>
</ul>
</li>
</ul>

how can i have the sub sub menu in web2py newest version? the previous version (bootstrap 2) is worked as expected

thanks and best regards,
stifan

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
weheh | 26 Apr 09:10 2015
Picon
Picon

postgres/psychopg2 connect problem -- need help

I'm moving my app to a new server. It's running Windows 8.1 (sorry about that, but it can't be avoided for technical reasons). Regardless, I backed up my postgres db on my old server and moved it over to the new server and sucked it into postgres. The db is associated with the same user name and password. Now, however, when I try to start my app, I get the error message:

Traceback (most recent call last):
  File "C:\web2py\gluon\restricted.py", line 224, in restricted
    exec ccode in environment
  File "C:/web2py/applications/myapp/models/0_0_globals.py", line 25, in <module>
    migrate=False,  # enable in production for increased performance
  File "C:\web2py\gluon\dal\base.py", line 432, in __init__
    raise RuntimeError("Failure to connect, tried %d times:\n%s" % (attempts, tb))
RuntimeError: Failure to connect, tried 10 times:
Traceback (most recent call last):
  File "C:\web2py\gluon\dal\base.py", line 410, in __init__
    self._adapter = ADAPTERS[self._dbname](**kwargs)
  File "C:\web2py\gluon\dal\adapters\base.py", line 47, in __call__
    obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
  File "C:\web2py\gluon\dal\adapters\postgres.py", line 144, in __init__
    if do_connect: self.reconnect()
  File "C:\web2py\gluon\dal\connection.py", line 113, in reconnect
    self.connection = f()
  File "C:\web2py\gluon\dal\adapters\postgres.py", line 142, in connector
    return self.driver.connect(msg,**driver_args)
  File "C:\Program Files (x86)\Python27\lib\site-packages\psycopg2\__init__.py", line 164, in connect
    conn = _connect(dsn, connection_factory=connection_factory, async=async)
OperationalError: FATAL:  password authentication failed for user "myuser"

I'm using the same credentials as before. Nothing has changed. psychopg2 is installed. The password has been validated multiple times directly in postgres.

This is all running on web2py 2.9.12-stable+timestamp.2015.01.17.06.11.03 (Running on Rocket 1.2.6, Python 2.7.8)     



Anybody have any ideas how to get this running again? 

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Leonardo Pires Felix | 26 Apr 04:32 2015

put table._format as default for referenced fields

Hi,
There is a better way to put the table format attribute in each referenced field that has not a label specified?
My application has now 183 tables so far, and puting one by one is kind of boring.

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Gmane