[web2py] routes.py to app/controller/function/1/2/3

2021-11-01 Thread 'Annet' via web2py-users
I am developing a network application in web2py which consists of vertices and edges. Every vertex has a site which is dynamicalIy created within the init application. I added a domain and subdomains for my own domain to routes.py routers = dict( # base router BASE = dict(

[web2py] Services

2021-10-29 Thread 'Annet' via web2py-users
I built a calendar application in web2py 2.20.4, the application has a calendar.py controller with functions event_list(), timetable(), coursetable() etc. The data is stored in a PostgreSQL database. What I want is to make the data in the database available to for instance a user's WP web

[web2py] form.custom.widget.image breaks in case of form.errors

2021-05-14 Thread 'Annet' via web2py-users
I have another problem with form.custom: When I browse and select an image and submit the form, if the form contains an error, the form empties the image field. So the user has to browse for the image again I don't know in which version of web2py this error was introduced, but is very annoying

[web2py] form.custom.widget.image does not show preview

2021-05-14 Thread 'Annet' via web2py-users
I have a view with the following code: {{=form.custom.widget.image}} The problem is that in the update form the image does not display, which is very confusing to the user. is there a way to fix this issue? Kind regards, Annet -- Resources: - http://web2py.com -

[web2py] Unable to handle upload

2021-04-26 Thread 'Annet' via web2py-users
In my database model I have a parent table 'thg_thing' and a child table 'thg_book' Furthermore I have a function book_form which contains the following code: form = SQLFORM(db.thg_book, row, deletable=False, upload=URL('default', 'download'), showid=False, buttons=buttons) if

[web2py] data-w2p_remote

2021-01-21 Thread 'Annet' via web2py-users
I have a site in which I have a layout.html view with a header and a footer, the main content is loaded into this div: The problem is that when I click on a link on /init/home/index/ the content of /init/home/index/ is shown a fraction of a second before the requested page is loaded. Any

[web2py] Re: Selecting payment method

2020-12-23 Thread 'Annet' via web2py-users
I am not sure I fully understand your question, but doesn't SQLFORM.widgets. radio.widget on the pay_with solve your issue? Best, Annet Op dinsdag 22 december 2020 om 17:25:57 UTC+1 schreef mauri...@gmail.com: > I worked on a way to pay through various methods. It involves a user > selecting

[web2py] Digitally sign URLs

2020-12-08 Thread 'Annet' via web2py-users
In the control panel I built I use URL(..., user_signature=True) and @auth.requires_signature() to secure the urls. I the init application I built I have various links to a particular function with different combinations of args and vars. I want to limit access to that function so only the

[web2py] sessions2trash.py

2020-12-08 Thread 'Annet' via web2py-users
I used to host my web2py application at Webfaction, there I scheduled a cron job to run the sessions2trash.py script. In the end this no longer worked. Now I host my web2py application at Opalstack, and wonder how I schedule a task to run sessions2trash.py to clean up my applications. Kind

[web2py] Re: How to customize email settings.

2020-12-04 Thread 'Annet' via web2py-users
Maybe auth.messages is what you're looking for: auth.messages.retrieve_username = 'Your user name: %(username)s' auth.messages.retrieve_username_subject = 'Username retrieval' auth.messages.reset_password = 'Click or copy/paste the following link https://'+request.env.http_host+URL('default',

[web2py] Re: In case of form.errors browse for image again

2020-11-11 Thread 'Annet' via web2py-users
Related to the issue above. I have the following form: form = SQLFORM.factory(table, db.prm_generic, upload=URL('default', 'download'), buttons=buttons) ... if form.validate(): if request.args(0) == 'landingpages': if row:

[web2py] In case of form.errors browse for image again

2020-11-11 Thread 'Annet' via web2py-users
When I create a form based on a table that has a field of type upload to upload an image, I have a problem when one of the other fields in the table doesn't validate. e.g. a field of type text contains too may characters. This form.errors resets the upload field, so I have to browse for the image

[web2py] Re: Upload images to folder outside web2py

2020-11-09 Thread 'Annet' via web2py-users
Thanks for the link. I had a look at Gael's post, my problem isn't related to that one. However, reading Gael's post I realised that bewteen versions I introduced conditional models. Since the download function is in the default controller and the uploadfolder is set in the model I needed to add

[web2py] Re: Upload images to folder outside web2py

2020-11-02 Thread 'Annet' via web2py-users
I forgot to say, uploading an image works, if the folder isn't there it is being created, otherwise the image is uploaded to the folder. Best, Annet Op maandag 2 november 2020 om 16:17:48 UTC+1 schreef Annet: > > To upload images to separate folders outside web2py I set the upload > folder

[web2py] Upload images to folder outside web2py

2020-11-02 Thread 'Annet' via web2py-users
To upload images to separate folders outside web2py I set the upload folder with the model definition: UPLOADSDIR = '/home/me/apps/static/' db.define_table('mytable', Field('image', 'upload', autodelete=True, uploadfolder=os.path.join( UPLOADSDIR, 'vertexID%s' % session.vertexID), ...)

[web2py] Re: Opalstack for ex-webfaction users or people looking for a Web2Py Web Hosting (Tutorial for Python 3 or 2.7)

2020-10-20 Thread 'Annet' via web2py-users
Hi, Jose, is right, I had the same problem: I did not go to my app directory prior to activating the virtualenv. No need to switch databases. Personally I prefer Opalstack's control panel over Webfaction's control panel. It's simpler and more powerful. Best, Annet Op dinsdag 20 oktober 2020

[web2py] Re: routes.py and root_static

2020-10-19 Thread 'Annet' via web2py-users
Hi Jose, Thanks for your reply. One more thing. I've got routes.py in web2py's root folder, as you can see I've got three applications, do I place the robots.txt file in all three application's static folder? Kind regards, Annet Op vrijdag 16 oktober 2020 om 12:39:18 UTC+2 schreef Jose C:

[web2py] routes.py and root_static

2020-10-14 Thread 'Annet' via web2py-users
I have the following lines of code in routes.py routers = dict( # base router BASE = dict( domains = { 'domain.com' : 'init', 'www.domain.com' : 'init', 'ldc.domain.com' : 'admin', 'my.domain.com' : 'controlpanel', } ),

[web2py] Share sessions

2020-10-13 Thread 'Annet' via web2py-users
In the model files of my applications I have these lines of code because I want to share the session, so menus etc. reflect the correct state and users need not login twice # share the session cookie among all subdomains under the main domain response.cookies[response.session_id_name]['domain']

[web2py] Re: web2py hosting

2020-10-13 Thread 'Annet' via web2py-users
Hi Jose, You're right no regrets at all. Just like you I very much appreciate their willingness to help you solve the problems you run into when deploying your applications. Annet Op dinsdag 13 oktober 2020 om 08:51:21 UTC+2 schreef Jose C: > Hi Annet, > > Just FYI, I'm going on 18 months

[web2py] Re: web2py hosting

2020-10-10 Thread 'Annet' via web2py-users
Hi Antonio, I came across your post, and thought I'd share my experience with Opalstack. I am a web developer not a server administrator, I hosted at Webfaction because their support people were very patient and helpful. After joining forces with GD support no longer stands out from the crowd.

[web2py] Re: How to automatically reset or hide drop down menus in navbar

2020-10-01 Thread 'Annet' via web2py-users
http://web2py.com/book uses a script named web2py_bootstrap.js // this code improves bootstrap menus and adds dropdown support jQuery(function(){ jQuery('.nav>li>a').each(function(){ if(jQuery(this).parent().find('ul').length)

[web2py] Re: Setting a default value for a reference field

2020-09-19 Thread 'Annet' via web2py-users
I wonder why the IS_IN_DB() validator doesn't suit your needs. I have a field day: Field('day', 'reference cal_day', default=None, required=True, requires=IS_IN_DB(db, 'cal_day.id', '%(id)s %(name)s', zero='Select a day'), ondelete='RESTRICT', notnull=True, label='Day *'), Doesn't zero =

[web2py] Re: formatting a field in SQLTABLE

2020-08-24 Thread 'Annet' via web2py-users
Maybe use the represent attribute in the field constructor db.table.field.represent = lambda val, row: function()) and use: locale.format('%10.2f', val, grouping=True) Best, Annet Op maandag 24 augustus 2020 om 07:43:15 UTC+2 schreef Vlad: > I've got the rows to be displayed in a table: > >

[web2py] Re: Nested menu item

2020-08-18 Thread 'Annet' via web2py-users
Hi, I've got a two level menu, however, calling {{=MENU(response.app_menu)}} doesn't render a Bootstrap 4 menu like your resulting html code. It renders something pretty ugly: Our network Networks we joined Do you have any idea how to solve this

[web2py] Re: modules: NameError("name 'reload' is not defined",)

2020-08-17 Thread 'Annet' via web2py-users
I reported the same problem some time ago. When I edit a module and save it I get this nameError. Since I am importing the modules into other applications I have to restart web2py everytime I edit a module. Further more the module are no longer compiled on first use, which I also find very

[web2py] Re: What happened to OptionsWidget

2020-08-13 Thread 'Annet' via web2py-users
Hi, Thanks for your reply. I didn't alter anything in the code, however, I moved the widget to another module, in which I forgot to import sqlhtml.py You reply pointed me in that direction. Best, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] What happened to OptionsWidget

2020-08-11 Thread 'Annet' via web2py-users
I coded a custom radio widget: def inlineRadioOptions(field, value, **attributes): ... attr = OptionsWidget._attributes(field, {}, **attributes) attr['_class'] = attr.get('_class', 'web2py_radiowidget') ... return TAG[''](*opts, **attr) After upgrading to web2py 20.x this no

[web2py] Re: How do I prevent going back to previous page after user is logged out?

2020-07-31 Thread 'Annet' via web2py-users
What about the following? auth.settings.login_onaccept = lambda form: __on_login() auth.settings.logout_onlogout = lambda user: __on_logout() def __on_login(): # whatever you want to do return None def __on_logout(): # whatever you want to do return None To solve your

[web2py] Re: Autocomplete JSON output format.

2020-07-28 Thread 'Annet' via web2py-users
Hi Jose, Thanks for you reply. Following your suggestion, and making one adjustment: return dict(suggestions=json.dumps(countries)) the controller/function jsonsource/name_autocomplete now returns a correct list: ["first_option", "second_option", "third_option"] In layout.html before the

[web2py] Autocomplete JSON output format.

2020-07-26 Thread 'Annet' via web2py-users
I've got this rows object as the source of an autocomplete function: rows = db(query).select(db.vtx_vertex.name, left=left, distinct=True, orderby=db.vtx_vertex.name).as_list() result = [r['name'] for r in rows] return response.json(result) This is the autocomplete I'd like to use::

[web2py] Re: Having a user belong to 2 groups with different priviledges

2020-06-18 Thread 'Annet' via web2py-users
I am not sure I completely understand what you want, but what about groups Region 1, Region 2, HR and Admin. User 1 has membership Region1 and HR User 2 has membership Region2 and HR In your code you could have if auth.has_membesrhip(Region1) and auth.has_membesrhip(HR) tasks ... elif

[web2py] Re: invalid literal for long() with base 10: when linking 2 tables

2020-06-14 Thread 'Annet' via web2py-users
Hi, I think you'd better reference your store_registration table once by id in the temperature table. Field('store_registration_id', 'reference store_registration', writable= False), In that way you comply with the rule of single_point-of_definition. The way you define your temperatures

[web2py] Re: Bootstrap 4 and MENU helper problem

2020-06-11 Thread 'Annet' via web2py-users
Hi Val, Thanks for your reply. I'll do as you suggest. Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message

[web2py] datatable_list = request.controller in ['network', 'calendar'] True or False

2020-06-02 Thread 'Annet' via web2py-users
In web2py 2.14 and python 2.7 the following line of code datatable_list = request.controller in ['network', 'calendar'] or request.function in ['search_group', 'search_supplier'] enabled me to do the following in an view: {{if datatable_list:}} DO SOMETHING {{pass}} In web2py 2.19 and

[web2py] Re: Bootstrap 4 and MENU helper problem

2020-06-02 Thread 'Annet' via web2py-users
I got a bit further solving this issue adjusting web2py-bootstrap4.js $(function() { $(".navbar-nav ul.dropdown-menu").each(function() { var toggle = jQuery(this).parent(); if (toggle.parent().hasClass("navbar-nav")) { toggle.attr("data-w2pmenulevel", "l0")

[web2py] Bootstrap 4 and MENU helper problem

2020-05-29 Thread 'Annet' via web2py-users
In Bootstrap 4 the MENU helper no longer generates the Bootstrap navbar {{=MENU(response.menu, _class='nav navbar-nav', ul_class='dropdown-menu', li_class='dropdown')}} This worked in Bootstrap 3, in Bootstrap 4 it no longer works this is what web2py generates:

[web2py] Re: __pycache__

2020-05-24 Thread 'Annet' via web2py-users
Hi Jose, Thanks for your reply, the link to the discussion on stackoverflow was very helpful. Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report

[web2py] Re: CSS URL Helper

2020-05-24 Thread 'Annet' via web2py-users
When you store the css code in a view e.g. css.html and include it in a view you can do: background-image: url('{{=URL('static','images/headerback.jpg')}}'); An other option is the following: Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: LOAD in web2py 2.14 and 2.19.1

2020-05-20 Thread 'Annet' via web2py-users
Hi Jim, Thanks for your reply. I did what you advised me to do. It's not a python 3.7 issue. I think it has something to do with modules not being reloaded after they have been edited. 404 NOT FOUND wasn't pointing in that direction. Kind regards, Annet -- Resources: - http://web2py.com -

[web2py] 2.19.1 cm-s-twilight

2020-05-19 Thread 'Annet' via web2py-users
I wonder whether it is possible to change the editor's background colour and colour from cm-s-twilight to a light background colour. The dark background doesn't work well under certain light conditions in the room I'm working in. Kind regards, Annet -- Resources: - http://web2py.com -

[web2py] Re: Displaying images with their title in a for statement in an image slideshow

2020-05-19 Thread 'Annet' via web2py-users
Have a look at the html of the Bootstrap 4.5 carousel https://getbootstrap.com/docs/4.5/components/carousel/ maybe that points you in the right direction. Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

[web2py] LOAD in web2py 2.14 and 2.19.1

2020-05-18 Thread 'Annet' via web2py-users
After upgrading to web2py 2.19.1 and switching to python 3.7 the following no longer works. I have a controller main with an index function that builds a scaffold with header, content and footer. The index function returns a variable: content = LOAD('home', 'index', args=[vertexid, typeid,

[web2py] __pycache__

2020-05-13 Thread 'Annet' via web2py-users
This morning I noticed a directory /init/__pycache__ containing the file __init__.cpython-37.pyc It caused web2py hanging on start up, after removing the directory and the file web2py did start up. I just wonder where the directory and the file came from. I don't think I compiled the init

[web2py] Re: two web2py servers and sessions in redis

2020-05-08 Thread 'Annet' via web2py-users
I had a similar problem, Anthony explained to me that I should share the session cookie among all subdomains under the main domain: response.cookies['session_id_A']['domain'] = '.example.com' I hope this points you in the right direction to solve the issue. Annet -- Resources: -

[web2py] Re: Autocomplete widget filter values

2020-05-05 Thread 'Annet' via web2py-users
Hi Anthony, I am rebuilding an application that uses the jQuery UI autocomplete widget. In the view I have the following code: $(function() {$("#no_table_name").autocomplete({source: "{{=URL('jquery', 'name_autocomplete')}}", minLength: 2});}); name_autocomplete is a function in the jquery

[web2py] Menu no longer renders {{=MENU(response.menu)}}

2020-04-30 Thread 'Annet' via web2py-users
In web2py 2.14 I had the following code in menu.py response.menu = [ (CAT(SPAN('Log in', _class="btn btn-primary")), False, URL('controlpanel', 'default', 'user', args='login', scheme=SECURESCHEME, host=CONTROLPANELDOMAIN)), (CAT(SPAN('Open account', _class="btn btn-success")), False,

[web2py] Re: Server error when accessing admin

2020-04-30 Thread 'Annet' via web2py-users
Hi Ian, I do have a copy of the script, it's a bit old, but I'll attach it anyway, maybe it's of help. Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list

[web2py] Re: Server error when accessing admin

2020-04-30 Thread 'Annet' via web2py-users
Why didn't you use the web2py install/unstall script that webfaction provides? It installs web2py served via nginx and uWSGI. The script mentions 2 caveats: Web2py won't work properly if it is mounted to a sub-URL like http://domain.com/web2py/. Instead, it must be mounted to the website root,

[web2py] Re: How to customize "Invalid function/someview" ?

2020-04-30 Thread 'Annet' via web2py-users
I think routes_onerror = [] in routes.py is whar you're looking for: routes_onerror = [ ,(r'*/404', r'/handler/default/on_404_error') ,(r'*/*', r'/handler/default/onerror') ] Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: Mac Catalina 10.15.4 - Cannot run web2py binary

2020-04-21 Thread 'Annet' via web2py-users
Hi Jon, When I first ran web2py using python 2.7 on Mac OS X Catalina I got this error message: DEPRECATION WARNING: The system version of Tk is deprecated and may be removed in a future release. Please don't rely on it. Set TK_SILENCE_DEPRECATION=1 to suppress this warning. please visit:

[web2py] Re: Mac Catalina 10.15.4 - Cannot run web2py binary

2020-04-21 Thread 'Annet' via web2py-users
I switched to web2py source code long ago, after buying a new mac mini with Mac OS X Catalina I decided to switch to homebrew en pyenv, there are some caveats but if you've sorted these out, it all works well. Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: Getting an error that ends in "No driver of supported ones %s is available" % str(self.drivers) RuntimeError: No driver of supported ones ('psycopg2',) is available

2020-04-19 Thread 'Annet' via web2py-users
I had the same problem when installing web2py 2.19.1 on Mac OS X Catalina. I eventually solved the problem running the following code: Annets-Mini:~ me$ export PATH=/usr/local/Cellar/postgresql/12.1/bin/:$PATH Annets-Mini:~ me$ export LDFLAGS="-L/usr/local/opt/readline/lib" Annets-Mini:~ me$

[web2py] {{block head}}{{end}}

2020-04-18 Thread 'Annet' via web2py-users
What is the use of: {{block head}}{{end}} {{block page_js}}{{end page_js}} In layout.html I expected something like this: {{block head}} all head elements here {{end}} But I obviously didn't get it :-( Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] auth.settings.extra_fields and on_define

2020-04-11 Thread 'Annet' via web2py-users
Is it possible to add the keyword argument on_define to auth.settings.extra_fields['auth_user'] Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report

[web2py] Re: web2py 2.19.1 is OUT

2020-04-10 Thread 'Annet' via web2py-users
In this version of web2py I have the following lines of code in db.py from gluon.contrib.appconfig import AppConfig configuration = AppConfig(reload=True) When I add code to a module file and save the file I get the following error: nameError(“name ‘reload’ is not defined”) Why do I get

[web2py] on_define and IS_IN_DB()

2020-04-10 Thread 'Annet' via web2py-users
I am not sure I understand the following paragraph in the book: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#on_define I have lazy_table = true and a Field('vertex_id', 'reference vertex', requires=IS_IN_DB(db, 'vtx_vertex.id', '%(id)s')) In the book it says:

[web2py] configuration.take() or configuration.get() and pool_size = 0 error

2020-04-08 Thread 'Annet' via web2py-users
In the online verson of the book it says: a_config_value = myconf.take('example_section.example_key', cast=int) http://web2py.com/books/default/chapter/29/13/deployment-recipes#AppConfig-module In the db.py file in web2py 2.19 it says: migrate_enabled=configuration.get('db.migrate') What

[web2py] Rocket error

2020-03-18 Thread 'Annet' via web2py-users
In web2py 2.18.5 on Mac OS X Catalina I get the following error in the terminal: ERROR:Rocket.Errors.Thread-10:Traceback (most recent call last): File "/Users/me/web2py/gluon/rocket.py", line 1288, in run self.run_app(conn) File "/Users/me/web2py/gluon/rocket.py", line 1781, in run_app

[web2py] BUG response.cookies and sessions2trash.py

2020-02-27 Thread 'Annet' via web2py-users
I scheduled cron to regularly trash the session in my web2py applications. this worked well until I added this line of code to a model.py file; response.cookies[response.session_id_name]['domain'] = '.leonexus.nl' My scripts log any errors at ~my/logs/user/sessions2trash.log. That file is full

[web2py] Re: Setting a default reference value as that of a specific group the logging in user is a member of

2020-02-25 Thread 'Annet' via web2py-users
I don't understand the use of field 'groups' and function 'get_groups() I think you should use web2py's built in auth_ functionality: drop field 'groups' in both tables, link users and groups (each hotel its own group) in the auth_membership table, and use this table to create a list of options

[web2py] Mail in separate application

2020-02-19 Thread 'Annet' via web2py-users
I have three applications all of which have mail functionality. Since this gives a lot of dupliacte code I thought of moving all mail functionality to its own mail application. I have one masterapp controlpanel with the following code; if not request.env.remote_addr in ['127.0.0.1',

Re: [web2py] Raspberry pi cannot connect to postgreSQL

2020-02-06 Thread 'Annet' via web2py-users
Thank you both for your replies. @Massimiliano Are you sure the user is *posgres* and not *postgres*? :-D > I've checked the connection string over and over again and just did not spot the missing 't' Thank you so much for your help! Best, Annet -- Resources: - http://web2py.com -

[web2py] Raspberry pi cannot connect to postgreSQL

2020-02-06 Thread 'Annet' via web2py-users
I just installed psycopg2 to connect to my PostgreSQl database on Raspberry Pi 4. When starting web2py I get the following error ticket: Traceback (most recent call last): File "/home/pi/web2py/gluon/restricted.py", line 227, in restricted exec ccode in environment File

[web2py] raspberry pi starting browser xdg-open issue and error ticket postgreSQL

2020-02-06 Thread 'Annet' via web2py-users
Since I am not able to run web2py on mac os x Catalina I installed PostgreSQL and web2py on a raspberry pi 4. When I start web2py using the built in server I get the following error: Database drivers available: sqlite3, imaplib, pymysql, pg8000 please visit: http://127.0.0.1:8000/ starting

[web2py] No driver of supported ones ('psycopg2',) is available

2020-01-20 Thread 'Annet' via web2py-users
Last week I upgraded my development environment from Mac OS X Mavericks - Python 2.7 - Web2py 2.14.5 to Mac OS X Catalina - Python 2.7 - Web2py 2.18.5, since then I have the following issue: Failure to connect, tried 5 times: Traceback (most recent call last): File

[web2py] Database drivers available does not show psycopg2

2019-12-20 Thread 'Annet' via web2py-users
On Mac OS X Catalina with psycopg2 installed in the /Python/2.7/site-packages web2py does not find the psycopg2 driver: Database drivers available: sqlite3, imaplib, pyodbc, pymysql, pg8000 It did on lower versions of Mac OS X, is there a way to solve this issue? Best, Annet -- Resources:

[web2py] Re: Is it possible to load older web2py binaries for Mac?

2019-12-19 Thread 'Annet' via web2py-users
Hi Jarrod, I also have an issue after upgrading to Mac OS X Catalina see this post for Massimo's answer: https://groups.google.com/forum/?fromgroups=#!topic/web2py/431xgrgLkn0 Best, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: Illegal instruction 4

2019-12-06 Thread 'Annet' via web2py-users
Hi Leonel, Thanks for your reply. I am already running Web2py from source and I am using PostgreSQL 12. Seems like more people are having the same problem both on Windows and Mac. so far I haven't read a plausible solution. Kind regards, Annet -- Resources: - http://web2py.com -

[web2py] Illegal instruction 4

2019-12-05 Thread 'Annet' via web2py-users
Last week I upgraded my development environment from Mac OS X Mavericks - Python 2.7 - Web2py 2.14.5 to Mac OS X Catalina - Python 2.7 - Web2py 2.14.5, since then I have the following issue: Created by Massimo Di Pierro, Copyright 2007-2019 Version 2.14.5-stable+timestamp.2016.04.14.03.26.16

[web2py] Re: Validator IS_NOT_IN_DB not working | web2py

2019-10-18 Thread 'Annet' via web2py-users
What about form = SQLFORM() if form.process(...).accepted instead of form = SQLFORM().process() if form.accepted: Best, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: auth_membership grid with both, group id and group roles displayed when adding a new record

2019-10-08 Thread 'Annet' via web2py-users
Hi Villas, Will your solution still work when you change the value of role in the auth_membership table? In your mygroupdict you define the role values again, so that there is no single point of definition. I may be wrong but isn't that something to keep in mind when using your solution?

[web2py] Re: auth_membership grid with both, group id and group roles displayed when adding a new record

2019-10-07 Thread 'Annet' via web2py-users
Use IS_IN_DB() ids = [1,3,5] > db.auth_membership.group_id.requires = IS_IN_DB(db(db.auth_group.id.belongs(ids)), 'auth_group.id', '%(role)s') Best, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: Can't connect to MySQL

2019-09-10 Thread 'Annet' via web2py-users
According to the book the connection string for MySql is: mysql://username:password@localhost/test?set_encoding=utf8mb4 Maybe adding the TCP port solves the issue: mysql://username:password@localhost:13306/test?set_encoding=utf8mb4 Kind regards, Annet -- Resources: - http://web2py.com -

[web2py] Re: Custom form errors style

2019-08-23 Thread 'Annet' via web2py-users
To diasble it: if form.accepts(..., hideerror=False): to restyle it, restyle: .error Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report

[web2py] Re: How to stopped redirection to user/login.html

2019-08-21 Thread 'Annet' via web2py-users
What about: auth.settings.on_failed_authentication = lambda url: redirect(url) That is what the book says changing the default behaviour. Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: web3py -> py4web

2019-08-21 Thread 'Annet' via web2py-users
> python3 setup.py install > I installed py4web from source: git clone https://github.com/web2py/py4web.gitcd py4web python3 -m pip install -r requirements.txt python3 setup.py install Running the last statement gives the following errors: byte-compiling

[web2py] default/user/profile 404 NOT FOUND

2019-07-04 Thread 'Annet' via web2py-users
All of a sudden this link http://127.0.0.1:8000/controlpanel/default/user/profile no longer works, instead of returning the form it returns a 404 NOT FOUND. I didn't change anything in the user function, so I have no idea why this happens. Kind regards, Annet -- Resources: -

[web2py] Re: sqlform grid to show a field entirely, without cutting off the text

2019-06-18 Thread 'Annet' via web2py-users
I think Anthony answered this question in this post: https://groups.google.com/forum/?fromgroups=#!topic/web2py/okMVqyQPKV8 hope he did ;-) Regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: intercepting login & logout events

2019-06-18 Thread 'Annet' via web2py-users
Web2py has auth.settings I used them to solve your problem auth.settings.login_onaccept = lambda form: __on_login() auth.settings.logout_onlogout = lambda user: __on_logout() and then in the functions the task you want to perform, in my case some set up things and messages, something like:

Re: [web2py] Re: setting up pscycopg2

2019-06-13 Thread 'Annet' via web2py-users
> This isn't done as sudo? > With these lines I installed psycopg2 in my hosting environment, no sudo needed. | The trick seems to letting web2py know it is installed in its local environment. I installed psycopg2 in the site-packages folder of the python version I am using same folder

Re: [web2py] Re: setting up pscycopg2

2019-06-12 Thread 'Annet' via web2py-users
Hi Dave, I work both on Mac OS X and Linux and have Postgres databases. On Mac OS X I located the pg_config file and added its location to the .bash_profile file: export PATH=/usr/local/bin:$PATH export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.3/bin Then I got pip and

[web2py] Don't allow textarea to contain html tags

2019-04-23 Thread 'Annet' via web2py-users
My application has a contact form which is inserted into a database. I am using Google's CAPTCHA, however, sometimes a contact form is being submitted with a malicious link. To prevent this from happening I wonder wether it is possible to validate the textarea and only submit the form when it

[web2py] Re: CSS button alignment

2019-04-06 Thread 'Annet' via web2py-users
I think Bootstrap's float-right and float-left will solve this issue. https://getbootstrap.com/docs/4.1/utilities/float/ -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list

[web2py] Re: session.connect()

2019-03-28 Thread 'Annet' via web2py-users
Hi Anthony, Thanks for your reply. I added response.cookies['session_id_cms']['domain'] = '.yourdomain.com ' to a model file in the cms app. And in the init app I have session.connect(request,

[web2py] session.connect()

2019-03-27 Thread 'Annet' via web2py-users
I have two applications one init and one cms. In init I have a few functions for which the user needs to be logged in. These functions only read from the database they do not write to the database. I thought I could use session.connect(request, response, masterapp="cms") to share the fact that

[web2py] IS_IN_SET instead of IS_IN_DB

2019-03-21 Thread 'Annet' via web2py-users
I needed a IS_IN_DB() validator based on joined tables with the id coming from one table and the label coming from both tables, since I did not get this to work I tried: table.labelIDs.requires = IS_EMPTY_OR(IS_IN_SET([(r.ntw_edge_label_set.id, '%s' %str(r.vtx_vertex.name + ' - ' +

[web2py] auth.settings user_url

2019-02-26 Thread 'Annet' via web2py-users
I have one application that takes car of all the auth stuff. In the init application I have a couple of functions that require login,. I added this line of code session.connect(request, response, masterapp="controlpanel") and decorated the functions with @auth.requires_login() and set

[web2py] Re: Issue between 2.14.5 and 2.17.2

2018-10-26 Thread 'Annet' via web2py-users
Thank you both for your replies. Are you on the same filesystem/OS? Is it possible your OS sort order is now > different, so "_" sorts after the digits instead of before? Try changing > 0_imports.py to 00_imports.py. > I tried, but it did not solve the issue. Like Carlos said I had add the

[web2py] Issue between 2.14.5 and 2.17.2

2018-10-25 Thread 'Annet' via web2py-users
After upgrading from web2py 2.14.5 to 2.17.2 and editing a model file I got the following error: Traceback (most recent call last): File "/Users/iannet/web2py/gluon/restricted.py", line 219, in restricted exec(ccode, environment) File

[web2py] Re: Autocomplete widget match middle of word

2018-09-17 Thread 'Annet' via web2py-users
Hi Anders, In the query use .contains() Something lijke: rows = db(db.table.field.contains(request.get_vars.term, case_sensitive=False)).select().as_list() Best, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

[web2py] Re: response menu

2018-07-22 Thread 'Annet' via web2py-users
Hi Stavros, I think this'll solve your problem: {{=MENU(response.menu, _class='web2py-menu', li_class='dropdown', ul_class='dropdown-menu')}} Best, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] grouping and counting

2018-05-24 Thread 'Annet' via web2py-users
In a table definition I have the following field: db.define_table('app_settings', ... Field('viewtypeID', type='integer', requires=IS_IN_SET(viewtype_list)), ... migrate = False) This is the viewtype_list: viewtype_list = [(1, 'zero'), (2, 'thing'), (3, 'client'), ..., (8,

[web2py] Re: raise HTTP(503, "")

2018-05-17 Thread 'Annet' via web2py-users
Hi Stifan, Thanks for your helpful reply. Anthony's solution solves the issue. Best, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You

[web2py] raise HTTP(503, "")

2018-05-15 Thread 'Annet' via web2py-users
I have the following line of code in 00_db.py raise HTTP(503, "Maintenance") Is it possible to replace the code between "" with a view name, as in response.view = '503_handler.html' Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: join and count()

2018-04-14 Thread 'Annet' via web2py-users
Hi Anthony, Thanks for your reply. Does this work: > > label_count = db.vtx_label.id.count() > count = rowset.select(label_count, join=join).first()[label_count] > > Yes, that works, but I don't understand why it works, could you please explain how your solution works? The table vtx_labels

[web2py] join and count()

2018-04-13 Thread 'Annet' via web2py-users
In a function I have the following query: labels = db(db.vtx_label.vertexID==vertexID)._select(db.vtx_label.label) join = db.vtx_vertex.on((db.vtx_label.vertexID==db.vtx_vertex.id) & (db.vtx_vertex.typeID==IOTHINGID)) rowset = db((db.vtx_label.label.belongs(labels)) &

[web2py] Re: LOAD an routes_onerror

2018-03-16 Thread 'Annet' via web2py-users
Hi Anthony, Thanks for your reply. Have you tried redirect(..., client_side=True) in your error handler? > The error handler error/default/index contains the following lines of code: def index(): session.forget(response) response.title = 'Leonexus - Error handler' return

[web2py] LOAD an routes_onerror

2018-03-06 Thread 'Annet' via web2py-users
In my application I have a view containing a header, main and footer component. In the index function of a controller I have the following code: maincomponent = LOAD('home', 'base', args=[vertexID, viewtypeID, groupID, plural], ajax=True, target='main-component',

Re: [web2py] _href to URL()

2018-02-26 Thread 'Annet' via web2py-users
Hi Anthony, Thanks for your reply and explanation, I changed my code to the code you provided. Kind regards, Annet -- 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

  1   2   >