[web2py] Again: relation "auth_user" already exists

2019-10-14 Thread Johann Spies
I want all my auth_tables in a specific schema in PostgreSQL: wos_2019_1. I have created a model like this: db.define_table('auth_user', Field('id','id', represent=lambda id:SPAN(id,' ',A('view',_href=URL('auth_user_read',args=id, Field('username', type='string',

Re: [web2py] Composite key in web2py

2019-08-20 Thread Johann Spies
On Tue, 20 Aug 2019 at 07:00, Deep Shah wrote: > Hi All, > I am migrating table from existing table which has primary key with two > fields. > After migrating the table i created SQLFORM.grid and used selectable to > process the selected tuples. > selectable = [('Approve Selected names', lambda

Re: [web2py] Re: please help testing web3py

2019-07-18 Thread Johann Spies
On Wed, 17 Jul 2019 at 22:21, Nico Zanferrari wrote: > Hi Johann, > > you can copy the whole _documentation folder from github under the apps > folder of web3py (C:\Users\nico\myapps in my case on Win10). Then, after > running web3py, you can reach it on http://127.0.0.1:8000/_documentation > ,

Re: [web2py] Re: please help testing web3py

2019-07-16 Thread Johann Spies
On Sun, 14 Jul 2019 at 05:48, Massimo Di Pierro wrote: > > I posted some preliminary documentation > https://github.com/web2py/web3py/tree/master/apps/_documentation > > > I do not see a Makefile to convert the .mm-files to html-documentation. How do I read the documentation? Johann -- Because

Re: [web2py] Re: Python3 and gluon/xmlrpc.py

2018-08-14 Thread Johann Spies
Thanks Leonel. -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) -- 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] Python3 and gluon/xmlrpc.py

2018-08-14 Thread Johann Spies
On Debian I have: apt-file search /usr/lib/python2.7/SimpleXMLRPCServer.py libpython2.7-stdlib: /usr/lib/python2.7/SimpleXMLRPCServer.py But there is no such file for python3. Therefore this line(10) fails on python3: from SimpleXMLRPCServer import SimpleXMLRPCDispatcher I suspect this is a

Re: [web2py] LDAP authentication questions

2018-03-22 Thread Johann Spies
On 15 March 2018 at 16:21, Richard Vézina wrote: > ... > Good luck Thank you Richard. Your comments helped me to a clearer understanding of the problem and possible solutions. Regards Johann -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] LDAP authentication questions

2018-03-15 Thread Johann Spies
I am trying out ldap authentication after I have last used it in 2006. My ldap knowledge is minimal. After reading the documentation in the book and in ldap_auth.py I have a few questions about authentication and ldap. Background: Only a few users (probably not more than 5 or 6) will use this

Re: [web2py] Bug in ldap library for python3?

2018-03-14 Thread Johann Spies
with pip3... It fails over importing setuptools issue... Setuptools is >>>>>> installed, so I wonder what going on... >>>>>> >>>>>> It seems to be working with python 3.4+ : >>>>>> https://www.python-ldap.org/en/lates

[web2py] Bug in ldap library for python3?

2018-03-13 Thread Johann Spies
Version 2.16.1 In python (2.7) I can do: python web2py.py -S welcome .. In [1]: from gluon.contrib.login_methods.ldap_auth import ldap_auth In [2]: But not when I use python3 (and I have python3-ldap installed). ``` /home/js/web2py/gluon/custom_import.py in custom_importer(name, globals,

Re: [web2py] 'DAL' object has no attribute 'db'

2018-02-07 Thread Johann Spies
to help me. Johann On 8 February 2018 at 08:03, Johann Spies <johann.sp...@gmail.com> wrote: > On 7 February 2018 at 22:14, Dave S <snidely@gmail.com> wrote: >> >> >> I thought web2py always ran the model files before calling the controller >> functio

Re: [web2py] 'DAL' object has no attribute 'db'

2018-02-07 Thread Johann Spies
On 7 February 2018 at 22:14, Dave S wrote: > > > I thought web2py always ran the model files before calling the controller > function, > part of the overhead of each call (and the reason for lazy tables and tables > defined in modules). > > Johann, is this function in the

Re: [web2py] 'DAL' object has no attribute 'db'

2018-02-07 Thread Johann Spies
No. Regards Johann On 7 February 2018 at 16:10, Richard Vézina <ml.richard.vez...@gmail.com> wrote: > Do you make a module function call without passing the db to it?? > > Richard > > On Wed, Feb 7, 2018 at 8:42 AM, Johann Spies <johann.sp...@gmail.com> wrote:

[web2py] 'DAL' object has no attribute 'db'

2018-02-07 Thread Johann Spies
Version 2.16.1-stable+timestamp.2017.11.14.05.54.25 Traceback (most recent call last): File "/home/js/web2py/gluon/restricted.py", line 219, in restricted exec(ccode, environment) AttributeError: 'DAL' object has no attribute 'db' During handling of the above exception, another exception

Re: [web2py] Re: Script to create models from legacy PostgreSQL tables

2018-02-05 Thread Johann Spies
On 4 February 2018 at 07:43, Massimo Di Pierro wrote: > How does it compare with this? > > https://github.com/web2py/web2py/blob/master/scripts/extract_pgsql_models.py > > > If better, can you merge and make a PR? Thanks Massimo. I did not know (or forgot) about

[web2py] Script to create models from legacy PostgreSQL tables

2018-02-01 Thread Johann Spies
I have written a script which I use to create models for an existing database. Maybe it will be useful for others. Comments are welcome. https://github.com/johannspies/pg_to_web2py_model Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise

Re: [web2py] auth actions_disabled in 2.16.1

2018-01-30 Thread Johann Spies
It seems that the menu option is hard coded in the default layout.html. Regards Johann On 30 January 2018 at 12:24, Johann Spies <johann.sp...@gmail.com> wrote: > On 2 January 2018 at 20:37, 黄祥 <steve.van.chris...@gmail.com> wrote: >> web2py latest version auth actions_

Re: [web2py] auth actions_disabled in 2.16.1

2018-01-30 Thread Johann Spies
On 2 January 2018 at 20:37, 黄祥 wrote: > web2py latest version auth actions_disabled doesn't work anymore > models/db.py > #auth.settings.actions_disabled = > configuration.take('auth.actions_disabled') > auth.settings.actions_disabled = ['profile', 'register'] > >

Re: [web2py] Re: exportclasses for Grid: a bug?

2017-08-03 Thread Johann Spies
On 2 August 2017 at 17:35, Anthony wrote: > The post you linked to is incorrect -- if you specify exportclasses, the > allowable values are False, an export class, or a tuple containing an export > class and its label. You cannot use values of True, and there is no need to >

[web2py] exportclasses for Grid: a bug?

2017-08-02 Thread Johann Spies
Web2py Version 2.15.2-stable+timestamp.2017.07.19.12.18.41 I found a clearer explanation than I could get in the Book on how to pass exportclasses to a grid: http://rootpy.com/Export-in-SQLFORM-grid/ and it worked as far as the buttons are concerned. But then the export does not work. Here is

Re: [web2py] now web2py related but this is free now ...

2017-05-31 Thread Johann Spies
+1 Thank you very much. Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: Can't import plugin module

2017-04-11 Thread Johann Spies
On Wednesday, 21 December 2016 15:45:12 UTC+2, Anthony wrote: > > There is no __init__.py file in your /modules folder, nor in the app > folder (should also be one in the /applications folder). > > Anthony > > On Wednesday, December 21, 2016 at 8:29:25 AM UTC-5, Jurgis Pralgauskis > wrote: >>

Re: [web2py] Re: 502 Bad Gateway - no tmp/web2py.socket file

2016-11-24 Thread Johann Spies
On 23 November 2016 at 14:36, Richard Brown wrote: > Thanks, the answer is 'yes' to all of these checks - web2py.ini file > attached. I did find out how to see if the uwsgi process is running and it > does appear to be: > > $ ps aux | grep "uwsgi" > richard 1044 0.0 0.1

Re: [web2py] Re: Moving auth_user and related tables to another schema

2016-06-20 Thread Johann Spies
On 15 June 2016 at 17:54, Anthony wrote: > It's a bit of a hack and I haven't tried it so not sure it will work, but > maybe something like this: > > db._lazy_tables = True > auth.define_tables() > lt = db._LAZY_TABLES > [lt[t][2].update(rname='myschema.%s' % t) for t in

Re: [web2py] Moving auth_user and related tables to another schema

2016-06-15 Thread Johann Spies
Thanks Richard, On 13 June 2016 at 16:21, Richard Vézina wrote: As far as I know web2py only support public schema, though as you mention I > think can support other schema with rname... You mention to use it that > way, it not working with auth if you create custom

[web2py] Moving auth_user and related tables to another schema

2016-06-13 Thread Johann Spies
We use PostgreSQL and make use of schemas for most of our work and use the "rname" option to do that in normal table definition. I have looked through the source code of tools.py and cannot see where it can be done to let the auth-related tables be created in a different schema than 'public'.

Re: [web2py] Invalid view even created it before

2016-04-25 Thread Johann Spies
Hallo André On 25 April 2016 at 11:49, Morganti wrote: > Hello, > > I am started to learn web2py some weeks ago. After created some > controllers and models using the generic view. I tried to deploy to > PythonAnywhere to test it and, of course, I know or use disable

Re: [web2py] Re: Importing CSV file

2016-03-01 Thread Johann Spies
On 26 February 2016 at 16:21, Joe wrote: > Hello Anthony, Thanks for your reply. > I exported the CSV after adding some records, as you suggested, and I see > no difference in the format. I tried to change the format several times but > I can't import it. I either get the

Re: [web2py] Re: nginx/uwsgi problem on Debian

2016-01-21 Thread Johann Spies
On 20 January 2016 at 16:35, Richard Vézina wrote: > > Which user is regular "web" user under debian, www-data? > > Yes. Thanks it is working now. Regards Johann -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] nginx/uwsgi problem on Debian

2016-01-20 Thread Johann Spies
The combination uwsgi/nginx has been recommended often on this list. After an upgrade from wheezy to jessy the nginx, uswgi-combination does not play nicely together. We have also tried to move the socket to tmp, but that did not change anything in as far as the refused connection is concerned.

Re: [web2py] FEATURE REQUEST: Case Insensitive Field types

2015-12-07 Thread Johann Spies
On 2 December 2015 at 09:59, Encompass solutions wrote: > I am not sure this exists yet, but it would be nice to take a string field > (or anything string like) and make it case insensitive. That way I don't > have to worry the j...@example.com is the same as

Re: [web2py] How to use fancytree?

2015-11-30 Thread Johann Spies
On 1 December 2015 at 04:08, Henk huisman wrote: > > This is the code I tried: > > > "text/javascript"> >

Re: [web2py] Re: web2py / pydal returning id 1 in postgres

2015-11-26 Thread Johann Spies
What is the output of \d+ in psql? What does your model in web2py for that model look like? Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

Re: [web2py] Re: A MCV-related question: global search form

2015-11-23 Thread Johann Spies
Thanks Leonel and Ian. Just in case it might help someone else, this is the code in layout.html that works for me: {{if response.menu:}} {{=MENU(response.menu, _class='nav navbar-nav',li_class='dropdown',ul_class='dropdown-menu')}} {{pass}}

Re: [web2py] web2py / pydal returning id 1 in postgres

2015-11-23 Thread Johann Spies
Which database backend do you use and what does the table definition look like in that backend? Regards Johann On 23 November 2015 at 04:58, Mark Graves wrote: > Are there any caveats to know about running applications in shell mode > (e.g. transactions / returning id)? >

Re: [web2py] Re: exporting to csv

2015-11-18 Thread Johann Spies
On 18 November 2015 at 03:51, lucas wrote: nice job, any idea how to make it a tab delimited file instead of comma? > lucas > > From the book: Both export_to_csv_file and import_from_csv_file accept keyword arguments that tell the csv parser the format to save/load the

[web2py] A MCV-related question: global search form

2015-11-18 Thread Johann Spies
As I understand Web2py forms in views are managed by controllers. I want to use a search form in the menubar like the attached image. [image: Inline images 1] This form is presented by layout.html. I want the form to be an auto-complete widget with sql-lookups in the background. So from

Re: [web2py] Type Cast Field On The Fly

2015-10-22 Thread Johann Spies
On 20 October 2015 at 20:03, Benson Myrtil wrote: > Hey guys, > > I have a quick question. Does the DAL support type casting on the fly? I > am working with a legacy mssql 2008 database that I cannot alter. Within > this database it has a field of integers but the field

Re: [web2py] Re: PostgreSQL

2015-10-22 Thread Johann Spies
Also look at this: http://www.dbta.com/Editorial/Trends-and-Applications/Best-Database-Overall%C2%AD-105362.aspx Regards Johann -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

Re: [web2py] Setting up database table with date.

2015-10-22 Thread Johann Spies
On 20 October 2015 at 14:16, Garry Smith wrote: > 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. > Which database do you use and how is the date format specified

[web2py] 'module' object has no attribute 'startswith'

2015-09-03 Thread Johann Spies
We have an app working with a database on another server through an ssh-tunnel. The app is working. But the admin app which worked previously suddenly throws an error when one try to we tries the "database administration" button - but only for this app. The traceback is this: Traceback (most

Re: [web2py] Re: Backup/Restore problem with web2py, postgres

2015-09-02 Thread Johann Spies
On 20 March 2011 at 07:05, Massimo Di Pierro wrote: > ask web2py to repair it > > auth.define_tables(fake_migrate=True) > > Installing an app on a second computer we tried this to overcome the message: auth_user already exists. It is not working. How should this be

Re: [web2py] Grid query

2015-09-01 Thread Johann Spies
On 31 August 2015 at 15:17, Manuele Pesenti wrote: > Il 31/08/15 09:54, Manuele Pesenti ha scritto: > > to brutally by-pass the exception you can try something like... > > > > papers = db.wos_papers_by_dt.count.sum() > > setitem(papers, "tablename", "wos_papers_by_dt")

Re: [web2py] Re: ldap import problem

2015-08-27 Thread Johann Spies
Thanks Massimo. After installing python-ldap the problem was solved. I did not realise that the package in gluon/contrib was dependent on external stuff. Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) -- Resources: -

[web2py] Grid query

2015-08-27 Thread Johann Spies
In SQL I can do select doctype, sum(count) number from wos.za_publications where pubyear 1979 group by doctype; In the web2py shell I can do: db.define_table('wos_papers_by_dt', Field('pubyear', 'integer'), Field('doctype'),

Re: [web2py] Getting type 'exceptions.ImportError' cannot import name table_field after upgrading to 2.12.3

2015-08-24 Thread Johann Spies
I had similar problems which convinced me to to stop using solidtable. Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

Re: [web2py] Re: ldap import problem

2015-08-24 Thread Johann Spies
Thanks Richard and Massimo for your replies. Version 2.12.3-stable+timestamp.2015.08.18.19.14.07 Massimo, there is nothing in modules - only __init__.py This is a new app. Regards Johann -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

Re: [web2py] Re: ldap import problem

2015-08-24 Thread Johann Spies
On 24 August 2015 at 16:20, Massimo Di Pierro massimo.dipie...@gmail.com wrote: So the problem is that it cannot import ldal. Do you know it works from the normal python shell? import ldap Does it work from the web2py shell? No, I cannot import ldap. I also tried it from another app

[web2py] ldap import problem

2015-08-20 Thread Johann Spies
Why does this happen? The import process seems to try and import the ldap module from the modules directory and not from gluon/contrib/login_methods. File /home/js/web2py/applications/wos_2015_3/models/db.py http://localhost:8000/admin/default/edit/wos_2015_3/models/db.py, line 11, in module

Re: [web2py] display only 20 entries in a table

2015-08-20 Thread Johann Spies
Why do not limit your query to 10 or 20 items? Regards Johann On 20 August 2015 at 12:30, Iancic Bogdan bogdan.ian...@gmail.com wrote: I have a lot of entries in the table that I want to display, and as i already have other things on the same page, i want to make this table show only 10-20

Re: [web2py] display only 20 entries in a table

2015-08-20 Thread Johann Spies
, but they are too many to be shown on a single page. That's why i would like to share them on different pages On Thursday, August 20, 2015 at 2:30:47 PM UTC+2, Johann Spies wrote: Why do not limit your query to 10 or 20 items? Regards Johann On 20 August 2015 at 12:30, Iancic Bogdan bogdan...@gmail.com

Re: [web2py] Re: rname for a reserved name?

2015-08-19 Thread Johann Spies
Thanks Nophlod. Johann -- 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] rname for a reserved name?

2015-08-19 Thread Johann Spies
I am trying to create a model for an existing table which contains the field 'state' which is according to web2py a reserved word. This does not work: Field('province', rname='state', citext), SyntaxError: non-keyword arg after keyword arg I could not find a lot of documentation either in

Re: [web2py] Pass html in label of SQLFORM.factory Field without it by sanitized

2015-07-16 Thread Johann Spies
Hello Thomas, It seems that the css for label anyhow uses a strong font so strong/strong would not have any visible effect. This is just to illustrate how you can pass html in a form element: label=XML('I consent for to provide my contact information to ___. II confirm that my house

Re: [web2py] Re: How to insert data in data base by xml file

2015-07-06 Thread Johann Spies
On 3 July 2015 at 23:43, Anthony abasta...@gmail.com wrote: All of the effort will be in parsing the XML, so you should check the documentation of the various XML libraries and ask questions in their forums (or on Stack Overflow). The details will depend on the structure of your XML.

Re: [web2py] We have released Censusgical,Census data visualization prototype for Myanmar.

2015-06-23 Thread Johann Spies
Impressive! On 23 June 2015 at 13:49, Michele Comitini michele.comit...@gmail.com wrote: +1 2015-06-23 13:48 GMT+02:00 Phyo Arkar phyo.arkarl...@gmail.com: We have plan to release it opensource soon. On Tue, Jun 23, 2015 at 5:56 PM, Kiran Subbaraman subbaraman.ki...@gmail.com wrote:

[web2py] Invalid password reset

2015-06-10 Thread Johann Spies
What would cause this error message if a user receives a link from web2py to reset his password and when he clicks on it he gets the error : invalid password reset? Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) --

Re: [web2py] Re: Web2py adding additional and not wanted orderby

2015-06-02 Thread Johann Spies
On 1 June 2015 at 20:22, Anthony abasta...@gmail.com wrote: Thanks Anthony. Correct. I do not want it in all cases. After reading up on it I came accross this link ( http://chrisdone.com/posts/postgresql-pagination) where the author illustrates just how slow PostgreSQL's OFFSET can be which

Re: [web2py] Re: Web2py adding additional and not wanted orderby

2015-06-01 Thread Johann Spies
On 28 May 2015 at 15:28, Anthony abasta...@gmail.com wrote: On Thursday, May 28, 2015 at 6:33:25 AM UTC-4, Johann Spies wrote: Does the db.isi_alt_names.code field contain unique values? If not, I don't think your pagination is guaranteed to work (i.e., you could get back different orderings

Re: [web2py] Re: Web2py adding additional and not wanted orderby

2015-06-01 Thread Johann Spies
After reading the discussion Anthony referred to, I would like to state that I prefer the behaviour of the DAL/Grid query to result in the same outcome as if I would have done with a raw query in PostgreSQL. I test my queries in PG before I implement them in web2py because I work with fairly large

Re: [web2py] Re: Web2py adding additional and not wanted orderby

2015-06-01 Thread Johann Spies
Thank you for the sermon :) Regards Johann -- 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

Re: [web2py] Re: Web2py adding additional and not wanted orderby

2015-06-01 Thread Johann Spies
On 1 June 2015 at 13:38, Anthony abasta...@gmail.com wrote: Just to be clear, the old behavior was a bug (and a particular problem when the user sorted on a column within the grid, which overrides the original orderby). Pagination is a fundamental feature of the grid, so it ought to just

Re: [web2py] wsgi / apache error

2015-05-28 Thread Johann Spies
Thanks Marko and Niphlod. I do not think it is a permissions problem in the app somewhere. I did not have a cache/ directory but then I do not use cache.disk. The issue Niphlod refers to seems to be related. I could see no solution there though :( My problem is not (as suggested in some

Re: [web2py] Reportlab, Platypus and tables

2015-05-28 Thread Johann Spies
Sorry I ommitted one import: import os -- 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

Re: [web2py] Reportlab, Platypus and tables

2015-05-28 Thread Johann Spies
On 28 May 2015 at 07:40, Jason (spot) Brower encomp...@gmail.com wrote: Pdf reporting can take a lot of work. Is this for a single page report or many pages. How are formated? And do you have an examole report in pdf format? I have used it once and it works. Here is the code as example: In

Re: [web2py] Specifying which fields are searchable with Smartgrid

2015-05-28 Thread Johann Spies
Try: search_options = [] #see gluon/sqlhtml. where it is defined as search_options = search_options or { 'string': ['=', '!=', '', '', '=', '=', 'starts with', 'contains', 'in', 'not in'], 'text': ['=', '!=', '', '', '=', '=', 'starts with', 'contains', 'in', 'not

Re: [web2py] Re: Web2py adding additional and not wanted orderby

2015-05-28 Thread Johann Spies
On 28 May 2015 at 12:42, Niphlod niph...@gmail.com wrote: auto_pagination = False. That being said, mind that without ordering, pagination is inherently incorrect Thanks. Will that not respect my orderby = ~db.isi_alt_names.code? I just do not want the extra ordering added. Maybe one can

[web2py] Web2py adding additional and not wanted orderby

2015-05-28 Thread Johann Spies
The following code: query = ((db.rresearch.id == db.isi_alt_names.rsc_id) (db.rresearch.nu.upper().like(request.vars.country + '%'))) data = SQLFORM.grid(query, searchable = False, links = links, fields = fields, editable = False, deletable = False,

Re: [web2py] Re: Web2py adding additional and not wanted orderby

2015-05-28 Thread Johann Spies
On 28 May 2015 at 12:42, Niphlod niph...@gmail.com wrote: auto_pagination = False. When did this become part of Web2py? I do not find it in the Changelog. It works in the latest version but no in 2.9.5. Regards Johann -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: Web2py adding additional and not wanted orderby

2015-05-28 Thread Johann Spies
2015 at 12:28, Johann Spies johann.sp...@gmail.com wrote: The following code: query = ((db.rresearch.id == db.isi_alt_names.rsc_id) (db.rresearch.nu.upper().like(request.vars.country + '%'))) data = SQLFORM.grid(query, searchable = False, links = links, fields = fields

[web2py] wsgi / apache error

2015-05-27 Thread Johann Spies
Most parts of the app work on our server running apache2.4 and wsgi but on after a query which takes some time I get this in the apache error log and 504 Gateway Timeout on my browser: [Wed May 27 14:20:46.617759 2015] [wsgi:error] [pid 18286:tid 140225013630720] [remote x.x.x.x:10678] mod_wsgi

Re: [web2py] SQLFORM.grid multiple left joins and where clause

2015-05-11 Thread Johann Spies
On 10 May 2015 at 04:26, A36_Marty ma...@mccaslandcorp.com wrote: fields = db.auth_user.first_name, db.auth_group.role Make that fields = [db.auth_user.first_name, db.auth_group.role] fields should be a list. query = (db.auth_user)(db.auth_group.id == PARENT_GROUP_ID) #get query not

Re: [web2py] delete session value that store query as_list()

2015-05-04 Thread Johann Spies
On 1 May 2015 at 10:44, 黄祥 steve.van.chris...@gmail.com wrote: the problem is if i just use one all value that store in session detail is not deleted all, always remain i=1, so that i must take two steps for that. is it the correct way to handle it in web2py? I see Session() is as Storage

Re: [web2py] parenthesis in SQLFORM.grid search

2015-04-30 Thread Johann Spies
Will it not be easier to encapsulate your complex query in a database view and run the grid on the view? e.g. in the controller: db.execute(create view xx as complexquery) db.define_table('xx', Field1(), Field2... Johann -- Because

Re: [web2py] Re: New error in trunk' s sqlhtml.py: AttributeError: 'SQLCustomType' object has no attribute 'represent'

2015-04-23 Thread Johann Spies
. Paolo On Wednesday, April 22, 2015 at 1:00:04 PM UTC+2, Johann Spies wrote: This code work without a problem in Version 2.9.12-stable+timestamp.2015.01.17.06.11.03 but not with the code from the trunk: def za_arts_by_journal_by_year(): db.define_table

Re: [web2py] Re: New error in trunk' s sqlhtml.py: AttributeError: 'SQLCustomType' object has no attribute 'represent'

2015-04-23 Thread Johann Spies
Apologies for my previous email. I have read the README again and saw I had to do a git submodule update --init --recursive. Now it is working. Where are the days when I could just do a hg pull; hg update. :) Regards Johann On 23 April 2015 at 08:47, Johann Spies johann.sp...@gmail.com wrote

[web2py] New error in trunk' s sqlhtml.py: AttributeError: 'SQLCustomType' object has no attribute 'represent'

2015-04-22 Thread Johann Spies
This code work without a problem in Version 2.9.12-stable+timestamp.2015.01.17.06.11.03 but not with the code from the trunk: def za_arts_by_journal_by_year(): db.define_table('za_wos_papers_by_journal_by_year', Field('journal', type=citext),

Re: [web2py] Re: web2py Complete Reference Manual

2015-04-21 Thread Johann Spies
Maybe https://colflash.cdm.depaul.edu/colflashweb/COLFlashPlayer.aspx?ID=183272 On 9 April 2015 at 01:00, Carlos Zenteno cmzent...@gmail.com wrote: @Ron: There is a video somewhere, where Anthony talks about the inner works of web2py. Let me see if I can find it, unless someone nice, beats

Re: [web2py] Re: web2py Complete Reference Manual

2015-04-08 Thread Johann Spies
On 4 April 2015 at 13:57, José Ricardo Borba jrborba...@gmail.com wrote: We left summer few weeks ago. It's late? ;-) As a South African, I enjoyed your remark! :) Regards Johann -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

Re: [web2py] Re: Cloning SQLlite into PostgreSQL

2015-04-08 Thread Johann Spies
On 2 April 2015 at 13:00, Gael Princivalle gaelprinciva...@gmail.com wrote: Hi Philip. Using UUIDs make the db slower right? Why? On huge databases the indexing will be slower but queries should not be slower than systems not using uuid.

Re: [web2py] Re: Cloning SQLlite into PostgreSQL

2015-04-08 Thread Johann Spies
For a new application it's not a problem, but someone have an experience about converting tables from standard ID to GUID? Firstly: backup :) I have done some conversions in the past. If I remember correctly, I added an extra column (say 'uuid'), filled it with unique values, created foreign

Re: [web2py] Re: Cloning SQLlite into PostgreSQL

2015-04-02 Thread Johann Spies
On 31 March 2015 at 20:19, Gael Princivalle gaelprinciva...@gmail.com wrote: Thanks Ron but:with CSV export: auth_user_iduser 3 John 7 Sally And then you import your CSV file you will have: auth_user_iduser 1

Re: [web2py] Re: Rendering null values in SQLFORM.grid

2015-03-30 Thread Johann Spies
You should be able to use field.represent to do that. If the value is None, then show something else like ''. Regards Johann On 30 March 2015 at 14:54, JorgeH jorgeh...@gmail.com wrote: I am dealing with the same issue these days. Client told me to remove all those 'None' fields. On

Re: [web2py] Select categories that are in use

2015-03-17 Thread Johann Spies
Good to know. Thanks. Johann -- 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

Re: [web2py] Executesql SQLFORM.grid

2015-03-17 Thread Johann Spies
What I do is to create a view or create table as (select...) and then define a table in the controller to correspond to the view or table and then use the grid to show the data in the view/table. If your query is one that will be repeated a lot of times you can make use of materialized views in

Re: [web2py] cannot perform INSERT RETURNING on VIEW

2015-03-16 Thread Johann Spies
On 10 March 2015 at 01:51, Val K valq7...@gmail.com wrote: It's no problem while INSERT into TABLE, but not for VIEW If you want to support RETURNING queries on the view, you need to make the rules include RETURNING clauses that compute the view rows. This is usually pretty trivial for

Re: [web2py] Select categories that are in use

2015-03-16 Thread Johann Spies
On 10 March 2015 at 13:44, Niphlod niph...@gmail.com wrote: 2 queries ? no subselect - way, 1 query. And you think using a subselect makes it one query? I had a mistake in my query: orderby should be groupby - which is more efficient (at least on PostgreSQL than using distinct). A

Re: [web2py] SQLFORM Validation and Password Hashes

2015-03-10 Thread Johann Spies
On 10 March 2015 at 06:53, horridohobbyist horrido.hobb...@gmail.com wrote: I use SQLFORM to add records to a table. However, one of the fields is a password which requires=[IS_STRONG(upper=2),CRYPT(salt=False)]. I would like to use SQLFORM to update records in the table, but I run into a

Re: [web2py] Select categories that are in use

2015-03-10 Thread Johann Spies
Try this (untested) categories_used = [x.category for x in db().select(db.news.category,orderby=db.news.category))] categories = db(db.news_categories.id.belongs(categories_used).select( db.news_categories.name) Johann On 9 March 2015 at 18:53, Gael Princivalle gaelprinciva...@gmail.com

Re: [web2py] Re: Global search form example

2015-03-10 Thread Johann Spies
On 9 March 2015 at 20:08, Ron Chatterjee achatterjee...@gmail.com wrote: SQLFORM.build_query[(db.table.field)] Passing a list ([]) into that will give you a text in that field. and then you can use a form input to do the display like the book on page 84 on the book. Damn I am getting good at

Re: [web2py] Re: Bootstrap is really killing web2py

2015-03-09 Thread Johann Spies
Try createing a new app from the admin interface and replace it's bootstrap css-files (in static/css) and js-files (in static/js) with bootstrap3 files and see what you get. Regards Johann On 5 March 2015 at 07:16, Moiz Nagpurwala moiz...@gmail.com wrote: Hello, I'm using latest relaease of

Re: [web2py] Re: Trunk unusable after this morning's git pull

2015-02-10 Thread Johann Spies
On 9 February 2015 at 20:51, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Can you try: python web2py.py -S welcome from gluon.dal import _default_validators what error do you get? I had to get web2py working so I just unpacked a web2py_src.zip over the existing installation.

[web2py] Trunk unusable after this morning's git pull

2015-02-08 Thread Johann Spies
After git pull this morning I could not start web2py: --- RuntimeError: web2py depends on pydal, which apparently you have not installed. Probably you cloned the repository using git without '--recursive' To fix this, please run (from inside your web2py folder): git submodule

Re: [web2py] update_or_insert error

2014-12-01 Thread Johann Spies
On 28 November 2014 at 07:26, T.R.Rajkumar t.r.rajkuma...@gmail.com wrote: When I do update_or_insert into a table in postgresql I get the following error. My code is below. class 'gluon.contrib.pg8000.errors.ProgrammingError' ('ERROR', '42601', 'syntax error at or near ') What does the

Re: [web2py] syntax for making var appear in view

2014-12-01 Thread Johann Spies
On 1 December 2014 at 09:23, Alex Glaros alexgla...@gmail.com wrote: Question one: This is in controller: vars=dict(Alex=99) This is in view: brAlex = {{ =response.get_vars.Alex}} br error is: 'NoneType' object has no attribute 'Alex'. I assume this is not the way to get a var to show

Re: [web2py] PostgreSQL migrate / fake_migrate_all failure with relation does not exists

2014-11-30 Thread Johann Spies
My migrations suddenly failed with Error: class 'gluon.contrib.pg8000.errors.ProgrammingError' ('ERROR', '42P01', 'relation wiki_page does not exist') If the relation does exist in Postgresql (which is why you want to migrate), try and move the related file in /app/databases/ for that

Re: [web2py] Re: multiple select plugin and list reference

2014-11-30 Thread Johann Spies
On 28 November 2014 at 13:13, Kevin Bethke kevin.bet...@gmail.com wrote: How do I open up the console to check for javascript errors? If you use Firefox, open Firebug (you may have to install it) in the developer menu. Chrome also have a menu item for developer tools and so Opera. Regards

Re: [web2py] Hardcoded Drop Down Menu In Form

2014-11-25 Thread Johann Spies
On 26 November 2014 at 01:47, Pablo Cruise pal...@gmail.com wrote: I'm a novice Web2py programmer and I've searched the net but can't figure this out. I've seen many example using SQLFORM but I don't have a need for these fields to be saved or retrieved to/from a database. Why don't you

Re: [web2py] Re: Another import problem

2014-11-17 Thread Johann Spies
Solved: __init__.py was also missing in the top directory of the app. Thanks for your help. Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

Re: [web2py] Re: Another import problem

2014-11-16 Thread Johann Spies
Hallo Leonel, Thanks. I did not see that __init__.py was missing. However, the problem was not solved by doing that. I stil get: $ python web2py.py -M -S sakb web2py Web Framework Created by Massimo Di Pierro, Copyright 2007-2014 Version 2.9.11-stable+timestamp.2014.09.15.23.35.11 Database

  1   2   3   4   5   6   7   8   9   10   >