[web2py] Re: multiple conditional fields
I tried, but it's not working with 2 fields to get hidden... Il giorno domenica 10 giugno 2018 02:41:12 UTC+2, 黄祥 ha scritto: > > perhaps you can use show_if for conditional field or jquery() > ref: > > http://web2py.com/books/default/chapter/29/07/forms-and-validators#Conditional-fields > > http://web2py.com/books/default/chapter/29/11/jquery-and-ajax#Conditional-fields-in-forms > > 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] fetching events from DB using fullcalendar javascript event calendar
I'm using web2py and now I'm fetching all calendar events from db using this code in a view: events: [ {{for row in rowseventi:}} { title: '{{=row.evento.titolo}}', id: '{{=row.evento.id}}', resourceId: '{{=row.evento.risorsa}}', start: '{{=row.evento.inizio}}', end: '{{=row.evento.fine}}', recurring: '{{=row.evento.ricorrenza}}', // allDay: false, color : '{{=row.evento.colore}}', url: '{{=URL('mostra_evento',args=row.evento.id)}}', }, {{pass}}] It's working perfectly but now I'd like to fetch only events regarding current view using this function https://fullcalendar.io/docs/events-function function( start, end, timezone, callback ) { } There are some example using php but I want only use python and PyDAL. Can someone give me some examples using only python and javascript? rowseventi it's an array retrieved from controller that contains all events... When I change the view with "next", "prev" or something else I'd like to fetch the new events based on the dates showed in the view. Thank you -- 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] Scheduler and far-away tasks
Are there any reasons I should not schedule tasks days, weeks, or months in advance in the web2py scheduler? It seems such a fantastic, general-purpose tool that I'm using it for more and more things in the site. Currently I'm considering using it to "reveal" embargo'ed items that should not be seen until a certain date and time. The reveal would involve putting a task in the scheduler for the far-away date and having it create a permission on a table at the moment of truth. Is there some reason this might be considered bad design, or poor use of the scheduler? Reliability is of high importance in my site, so design that decreases reliability is to be avoided. -- Joe -- 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] anyserver in 2.16.1-stable
web2py version 2.16.1-stable python version 2.7.15 pip install wsgiref flup cherrypy rocket paste gevent tornado twisted gunicorn eventlet motor waitress tried to install via pip but failed in mac : fapws mongrel2 diesel bjoern pulsar repoze *note:* - for linux os is tested using docker - for diesel is work in debian and ubuntu (via pip), but error on other linux distribution : centos, fedora, opensuse, scientifix, alpine, mageia, mac - cgi is use wsgiref in anyserver.py, tested using -s cgi an error occured (in any environment linux and mac) but tested using -s wsgiref is running smoothly - tested using flup is error using python 2 but not respond in python 3 (no error occured in terminal but cant access it via browser), while add the test using python 3 later - tested using motor is error in any environment (linux and mac) $ python ~/project/python/web2py/anyserver.py -s cgi -i 0.0.0.0 -p 8000 starting cgi on 0.0.0.0:8000... ERROR:web2py:Traceback (most recent call last): File "/Users/sugizo/web2py/gluon/main.py", line 317, in wsgibase (static_file, version, environ) = url_in(request, environ) File "/Users/sugizo/web2py/gluon/rewrite.py", line 189, in url_in return regex_url_in(request, environ) File "/Users/sugizo/web2py/gluon/rewrite.py", line 628, in regex_url_in path = urllib_unquote(request.env.path_info) or '/' File "/Users/sugizo/miniconda3/envs/python2_test/lib/python2.7/urllib.py", line 1233, in unquote bits = s.split('%') AttributeError: 'NoneType' object has no attribute 'split' Status: 500 INTERNAL SERVER ERROR Content-Type: text/html; charset=UTF-8 web2py_error: ticket unrecoverable Content-Length: 719 Internal errorTicket issued: unrecoverable $ python ~/project/python/web2py/anyserver.py -s flup -i 0.0.0.0 -p 8000 starting flup on 0.0.0.0:8000... Traceback (most recent call last): File "/Users/sugizo/web2py/anyserver.py", line 367, in main() File "/Users/sugizo/web2py/anyserver.py", line 364, in main options=options) File "/Users/sugizo/web2py/anyserver.py", line 316, in run getattr(Servers, servername)(application, (ip, int(port)), options=options) File "/Users/sugizo/web2py/anyserver.py", line 30, in flup import flup.server.fcgi File "/Users/sugizo/miniconda3/envs/python2_test/lib/python2.7/site-packages/flup/server/fcgi.py", line 54, in from .fcgi_base import BaseFCGIServer, FCGI_RESPONDER File "/Users/sugizo/miniconda3/envs/python2_test/lib/python2.7/site-packages/flup/server/fcgi_base.py", line 45, in import _dummy_thread as thread ImportError: No module named _dummy_thread $ python ~/project/python/web2py/anyserver.py -s motor -i 0.0.0.0 -p 8000 starting motor on 0.0.0.0:8000... Traceback (most recent call last): File "/Users/sugizo/web2py/anyserver.py", line 367, in main() File "/Users/sugizo/web2py/anyserver.py", line 364, in main options=options) File "/Users/sugizo/web2py/anyserver.py", line 316, in run getattr(Servers, servername)(application, (ip, int(port)), options=options) File "/Users/sugizo/web2py/anyserver.py", line 172, in motor app = motor.WSGIContainer(app) AttributeError: 'module' object has no attribute 'WSGIContainer' any idea how to fix it? 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: multiple conditional fields
Change IS_IN_DB to requires = IS_EMPTY_OR(IS_IN_DB( db(db.query.))) Then you should not get the error for an empty field See http://web2py.com/books/default/chapter/29/07/forms-and-validators about 3/4 the way down the page -- 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: LDAP Authentication never work
Hi stifan, Thanks for reply. But it is still validating against the DB and not LDAP Thanks, Suhas On Friday, 8 June 2018 16:39:15 UTC-7, 黄祥 wrote: > > pls try (not tested) > *models/db.py* > from gluon.contrib.login_methods.ldap_auth import ldap_auth > auth.settings.login_methods.append(ldap_auth( > mode='ad', > server='ldaps://chexadcexp001.expeso.com:636',base_dn='ou=Service > Accounts,dc=sea,dc=corp,dc=com') ) > auth.settings.login_methods = [ldap_auth] > > *controllers/default.py* > @auth.requires_login() > def test(): > return locals() > > 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.