[web2py] Re: Spatial/GIS: find records within X distance of point?

2013-12-09 Thread User
This appears to be working correctly now thank you. One more thing: the docstring on line 2985 is referencing the wrong PostGIS function (ST_Within), it should be: """ http://postgis.org/docs/ST_DWithin.html """ (note the D) On Monday, December 9, 2013 6:54:53 PM UTC-5,

[web2py] Re: how to build field list from string for SQLFORM.grid?

2013-12-09 Thread P T
I think, the problem is due to the following calls in gluon.sqlhtml.py (lines 2050, 2072, and 2093), which does not include the optional parameter "fields" create_form = SQLFORM(table, **sqlformargs) view_form = SQLFORM(table, record, **sqlformargs)

[web2py] Re: custom chosen.jquery.js widget

2013-12-09 Thread Jesse Ferguson
> > Ok so that didn't work so great... now I am trying to use this slice as a > template to make a widget: > http://www.web2pyslices.com/slice/show/1411/widgets-widgets-widgets > anyone know of any tutorials that would a novice like myself? > -- Resources: - http://web2py.com - http://web2py

[web2py] Re: redirect after user approval

2013-12-09 Thread Michel Hayek
Sorry Dave if what i described is not clear. 1. After a successful register directly the code will perform an insert into my second table, the issue here is i don't know where i place my insert function, in which file and after which line. 2. When the admin is approving the registered user and

Re: [web2py] Re: Proposal for big but simple improvement: [add view] in IDE view

2013-12-09 Thread Roberto Perdomo
https://github.com/web2py/web2py/pull/322/ 2013/12/9 Roberto Perdomo > Sometime ago I do an "Create" button in the "files toggle" menu, to allow > create files from the editor page, when a new file is created the "files > toggle" menu is updated using javascript to show the new files created. >

[web2py] custom chosen.jquery.js widget

2013-12-09 Thread Jesse Ferguson
How would i Implement a custom widget using this http://harvesthq.github.io/chosen/? Or is there an easier way to use this? I assume I can probably just pass the table rows and use something like {{response.files.insert( ALL THE REQUIRED JS STUFF HERE ) {{=form.custom.begin}} {{for row in ro

Re: [web2py] reference field or add if not in db

2013-12-09 Thread Jesse Ferguson
> > This has worked wonderfully on all my fields except now i cant figure out > how to have fix one field widget... > Its a List reference its showing like this... I want to be able to

[web2py] Re: Spatial/GIS: find records within X distance of point?

2013-12-09 Thread Massimo Di Pierro
You are right. Please check again. On Monday, 9 December 2013 17:16:17 UTC-6, User wrote: > > Thanks, on line 2987 I believe the format string is missing the 3rd '%s' > parameter: > > return 'ST_DWithin(%s,%s)' %(self.expand(first), > self.expand(second, first.type), >

[web2py] Re: redirect after user approval

2013-12-09 Thread Dave S
On Monday, December 9, 2013 11:51:39 AM UTC-8, Michel Hayek wrote: > > I'm fairly new to web2py and i'm using the register & login forms from > Web2PY. I was able to enable approval and send email for the admin. but i > need to do 2 things > > >1. Upon user successful register i need to ins

[web2py] Re: Spatial/GIS: find records within X distance of point?

2013-12-09 Thread User
Thanks, on line 2987 I believe the format string is missing the 3rd '%s' parameter: return 'ST_DWithin(%s,%s)' %(self.expand(first), self.expand(second, first.type), self.expand(third, 'double')) Should be: return 'ST_DWithin(%s,%s,%s)' %(se

[web2py] Re: Spatial/GIS: find records within X distance of point?

2013-12-09 Thread Massimo Di Pierro
Actually you do understand a lot of about this. That's a trick. It works. We can use it in this case too, until we come up with a better design. I used the same trick as in REPLACE, in trunk. Please give it a try. Massimo On Monday, 9 December 2013 16:33:09 UTC-6, User wrote: > > Forgive me bec

[web2py] Re: Can't edit default.py after upgrade to 2.8.2

2013-12-09 Thread Massimo Di Pierro
In Chrome, can you check the JavaScript Console? Does it show any error? On Monday, 9 December 2013 16:04:31 UTC-6, Richard Brown wrote: > > I am running Web2py on a Raspberry Pi and accessing the Admin > Interface via a browser on a Windows 8.1 PC. Since upgrading to the > latest version I can

[web2py] Re: Online classes

2013-12-09 Thread greaneym
These videos are fantastic and very helpful. Thank you, Massimo. Margaret -- 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 be

[web2py] Re: Spatial/GIS: find records within X distance of point?

2013-12-09 Thread User
Forgive me because I don't understand anything about the internals of web2py but doesn't REPLACE take three parameters: def REPLACE(self, first, (second, third)): return 'REPLACE(%s,%s,%s)' % (self.expand(first,'string'), self.expand(second,'string'), self.expand

[web2py] Re: how to build field list from string for SQLFORM.grid?

2013-12-09 Thread P T
open a ticket http://code.google.com/p/web2py/issues/detail?id=1812&sort=-id On Monday, December 9, 2013 3:38:18 PM UTC-6, Massimo Di Pierro wrote: > > Strange. Please open a ticket about this. > > On Monday, 9 December 2013 09:25:57 UTC-6, P T wrote: >> >> file attached >> >> On Monday, December

[web2py] Can't edit default.py after upgrade to 2.8.2

2013-12-09 Thread Richard Brown
I am running Web2py on a Raspberry Pi and accessing the Admin Interface via a browser on a Windows 8.1 PC. Since upgrading to the latest version I can no longer edit default.py. When I try I get a 'blank' edit screen with the 'Files Toggle', + A -' etc buttons at the top and the 'Powered by Web2

[web2py] Re: cannot get a multiselect list

2013-12-09 Thread Massimo Di Pierro
The extra ] was just a cut and paste error. On Monday, 9 December 2013 14:38:02 UTC-6, Dave S wrote: > > > > On Sunday, December 8, 2013 8:25:06 AM UTC-8, 黄祥 wrote: >> >> requires=IS_IN_SET(ngotype]), >>> >>> >> are you sure? there is unbalance bracket [] on that >> i mean: >> >> requires=IS_IN_SE

[web2py] Re: Spatial/GIS: find records within X distance of point?

2013-12-09 Thread Massimo Di Pierro
OK. This needs more work than anticipated. Looks like the Query object only supports unary and binary operators. Give me a little more time. ;-) On Monday, 9 December 2013 12:21:37 UTC-6, User wrote: > > Thanks. This is what I see at line 2983 in dal.py: > > def ST_DWITHIN(self, first, secon

[web2py] Re: how to build field list from string for SQLFORM.grid?

2013-12-09 Thread Massimo Di Pierro
Strange. Please open a ticket about this. On Monday, 9 December 2013 09:25:57 UTC-6, P T wrote: > > file attached > > On Monday, December 9, 2013 9:17:29 AM UTC-6, P T wrote: >> >> That works fine, but I have another problem - the order of columns is >> different in View and Edit (see attached sc

[web2py] Re: Format date after selecting field from database

2013-12-09 Thread Massimo Di Pierro
print row.comment_date.strftime('%d/%m/%Y') On Monday, 9 December 2013 08:42:42 UTC-6, Simon Carr wrote: > > I have this line > > > comment_RS = self.db(self.db.aol_comments.aol_id == item.text(0)).select( > orderby=~self.db.aol_comments.comment_date) >

[web2py] Re: Table reference field instead of the id

2013-12-09 Thread Gael Princivalle
Well I've done it in another way: db.define_table('brands', Field('id_01', 'id'), # 'id' instead of unique = True Field('name'), format='%(names') db.define_table('products', Field('code', unique=True), Field('descripti

Re: [web2py] urlify - no char mapping

2013-12-09 Thread Richard
Hello, What's happen with this? Is unidecode been added to contrib? Thanks Richard Le lundi 19 août 2013 14:35:12 UTC-4, Niphlod a écrit : > > it would be the first time we ship a zip archive of a module... > a) do we want to update a zip from a module with 118 files? > b) do we want to maint

[web2py] error using {{=auth.wiki('slug')}} on service pages

2013-12-09 Thread Janko Strusa
I have created wiki page named "Sidebar", then using {{=auth.wiki('Sidebar')}} inserted it in default/index.html. On wiki pages it looks ok but on service pages (_edit, _editmedia, _search...) i get following in place of desired sidebar. {'content': } - On _editmedia {'content': } - On _edit

[web2py] error using auth.wiki('slug') on service pages

2013-12-09 Thread Janko Strusa
I have created wiki page named "Sidebar" and using auth.wiki('Sidebar') I want to insert it as sidebar on website. When viewing page it looks ok, but on service pages I get following in place of sidebar. {'content': } I have followed web2py_manual_5th.pdf, so my controler returns auth.wiki()

[web2py] redirect after user approval

2013-12-09 Thread Michel Hayek
I'm fairly new to web2py and i'm using the register & login forms from Web2PY. I was able to enable approval and send email for the admin. but i need to do 2 things 1. Upon user successful register i need to insert into another table (Users) 2. After the Admin approve the User (appadm

[web2py] using auth.wiki(slug) on service page

2013-12-09 Thread Janko Strusa
I have created wiki page named "Sidebar" and using auth.wiki('Sidebar') I want to insert it as sidebar on website. When viewing page it looks ok, but on service pages I get following in place of sidebar. {'content': } I have followed web2py_manual_5th.pdf, so my controler returns auth.wiki()

[web2py] web2py help

2013-12-09 Thread Michel Hayek
Hey guys, i need your help i'm new to web2py and trying to use all its features. i need help in 2 things 1. When the user perform a successful register process, i need to perform an insert of that user in a new table. Not sure where i can embed this process 2. After the admin appr

Re: [web2py] Re: Proposal for big but simple improvement: [add view] in IDE view

2013-12-09 Thread Roberto Perdomo
Sometime ago I do an "Create" button in the "files toggle" menu, to allow create files from the editor page, when a new file is created the "files toggle" menu is updated using javascript to show the new files created. Due to something problems I forgot to send the pull request for this, I can try

[web2py] Re: cannot get a multiselect list

2013-12-09 Thread Dave S
On Sunday, December 8, 2013 8:25:06 AM UTC-8, 黄祥 wrote: > > requires=IS_IN_SET(ngotype]), >> >> > are you sure? there is unbalance bracket [] on that > i mean: > > requires=IS_IN_SET(ngotype]), > > should be > > requires=IS_IN_SET(ngotype), > > The extra paren is from the FIELD helper, isn't it?

[web2py] Re: convert month into roman format

2013-12-09 Thread Dave S
On Sunday, December 8, 2013 8:11:50 AM UTC-8, 黄祥 wrote: > > thank you so much for the reference link, massimo. > > best regards, > stifan > > On Sunday, December 8, 2013 9:21:41 PM UTC+7, Massimo Di Pierro wrote: >> >> https://pypi.python.org/pypi/rome/0.0.2 >> >> I was afraid this was a question a

[web2py] Re: abaut python 2.x and web2py lifetime

2013-12-09 Thread LightDot
If the future python support is the main issue, than I'd say you're worrying without any need. Support for python 2.x won't simply go away in two years, other maintainers will take over if it comes to that. If nothing else, Red Hat has taken on a serious commitment to support python 2.x for a l

[web2py] Re: Spatial/GIS: find records within X distance of point?

2013-12-09 Thread User
Thanks. This is what I see at line 2983 in dal.py: def ST_DWITHIN(self, first, second): """ http://postgis.org/docs/ST_Within.html """ return 'ST_DWithin(%s,%s)' %(self.expand(first), self.expand(second, first.type)) The proper documentation is at http://pos

[web2py] Re: Table reference field instead of the id

2013-12-09 Thread Gael Princivalle
With your solution Field('id_01', 'id')now I can add a custom column in the grid with links (also without a link inside !): links = [dict(header=T('Brand'), body=lambda row: (db.brands(row.brand_id_01).name))] Ok, it works fine, but how can I display this custom column in my custom single vi

Re: [web2py] reference field or add if not in db

2013-12-09 Thread Richard Vézina
Slice about that require jquery-ui I think : http://www.web2pyslices.com/slice/show/1446/widget-select-or-add-option Better with modal and bootstrap no jquery-ui : http://linuxapuntes.blogspot.ca/2013/03/plugin-modal-bootstrap-web2py.html Richard On Mon, Dec 9, 2013 at 12:16 PM, Jesse Ferguson

Re: [web2py] Re: Proposal for big but simple improvement: [add view] in IDE view

2013-12-09 Thread paolo.vall...@gmail.com
You are right, technically speaking it is true we already have the name of views and we can avoid to ask them again to the users. However what you proposed It's not so straightforward with the current editor structure, I don't say it is impossible. At first sight we should: 1- migrate the file li

[web2py] reference field or add if not in db

2013-12-09 Thread Jesse Ferguson
Is there a way to do this using a autocomplete field? would i put the logic in a custom validator? or is there a easier better way? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues

[web2py] Re: login crash under 2.8.2

2013-12-09 Thread Leonel Câmara
Lucas I kept getting this problem too, I found that my problem was old .pyc files in my web2py/gluon directory. If you have the same problem delete them all and restart apache. Terça-feira, 3 de Dezembro de 2013 11:59:11 UTC, lucas escreveu: > > hey everyone, > > thanx for the help on my prior p

[web2py] Re: Proposal for big but simple improvement: [add view] in IDE view

2013-12-09 Thread Mika Sjöman
Well, I was thinking that usually you write the controller first. If you click an [Add view] button, it could check which functions are missing a view and give you two options in a popup, or pop-down? (don't know what it is called); - Add view for function: [Link: missing_view_functio

Re: [web2py] Re: Import from csv file with original id's

2013-12-09 Thread Jonathan Lundell
On 9 Dec 2013, at 8:09 AM, Gael Princivalle wrote: > Thanks Anthony but in any case I've got the same web2py answer: > 'DAL' object has no attribute 'products' > > How is it possible ? Try doing your drop in a separate request. My guess is that you need to trigger a migrate cycle after the dro

[web2py] Re: Proposal for big but simple improvement: [add view] in IDE view

2013-12-09 Thread Paolo Valleri
It is a good idea that could speed up the initial development phase; We could start by implementing some like that: while you edit the controller test.py at the top you will get a button 'add view' that when clicked creates a file (a view actually) in the directory app/views/test; the file name

[web2py] Re: Import from csv file with original id's

2013-12-09 Thread Gael Princivalle
Thanks Anthony but in any case I've got the same web2py answer: 'DAL' object has no attribute 'products' How is it possible ? Il giorno lunedì 9 dicembre 2013 17:03:54 UTC+1, Anthony ha scritto: > > I think you want db.products.truncate(), not db.products.drop(). > > Anthony > > On Monday, Decemb

Re: [web2py] list:reference painfull to fill

2013-12-09 Thread Richard Vézina
I can help you, but I will not write it for you :) Richard On Mon, Dec 9, 2013 at 10:49 AM, Kevin Bethke wrote: > has anyone done that before and give me a few hints? I'm not the master > programmer^^ > > > On Mon, Dec 9, 2013 at 4:47 PM, Richard Vézina < > ml.richard.vez...@gmail.com> wrote: >

[web2py] Re: Import from csv file with original id's

2013-12-09 Thread Anthony
I think you want db.products.truncate(), not db.products.drop(). Anthony On Monday, December 9, 2013 8:03:24 AM UTC-5, Gael Princivalle wrote: > > Hello all. > > I need to import in one table data keeping original id's. > I know that I have to drop the table first, but when I want to import the

[web2py] Proposal for big but simple improvement: [add view] in IDE view

2013-12-09 Thread Mika Sjöman
Hi I just noticed watching Massimo's video tutorials, how often we need to open a second tab in Chrome when we want to create a view/controller/model file. It often leads us to get conflicts since we do not want to close the previous (having multiple tabs open we are working on). If we could

Re: [web2py] list:reference painfull to fill

2013-12-09 Thread Kevin Bethke
has anyone done that before and give me a few hints? I'm not the master programmer^^ On Mon, Dec 9, 2013 at 4:47 PM, Richard Vézina wrote: > It a custom thing, you can do anything you need... Web2py as really little > to do with that. But you will have to work around web2py default... BSM > sele

Re: [web2py] list:reference painfull to fill

2013-12-09 Thread Richard Vézina
It a custom thing, you can do anything you need... Web2py as really little to do with that. But you will have to work around web2py default... BSM select is not going to work out of the box you will have to give it what it need to work : web2py custom widget that wrap BSM for instance. Richard O

Re: [web2py] list:reference painfull to fill

2013-12-09 Thread Kevin Bethke
autocomplete would be nice. but anything is better than scrolling though a list showing only 5 entries holding shift for 25 ingredience and forget holding shift at the last one. I read "really quickly through the examples from bsmselect. that works with and lists? Does that work with web2py when

Re: [web2py] list:reference painfull to fill

2013-12-09 Thread Richard Vézina
So you need a auto complete widget... Don't remember if bsmselect has one... I use to build my own bsm like widget with bootstrap multiselect and typeahead... To me what was important was to make sure order of picked items remains from input and update, so you can see the order of importance of the

Re: [web2py] list:reference painfull to fill

2013-12-09 Thread Kevin Bethke
that bsm select looks already way better than the standard w2p implementation. My requirements are pick 0-max ingredience. All ingredience have to be in the ingredience table. no ingredient can be picket twice. I don't need the default or most common 10 stuff. Just a simple way to pick quite a few

[web2py] abaut python 2.x and web2py lifetime

2013-12-09 Thread Carlos Cesar Caballero Díaz
Hello, I've been using web2py for some time, but being close to begin what would be by far the most serious project of my life, has made me wonder, as if support for 2.7 version of python ends in 2 years (maybe a little more), what will happen to web2py when there is no more python 2.x support?

Re: [web2py] list:reference painfull to fill

2013-12-09 Thread Richard Vézina
You need to have control over the ingredient order no? You need something like BSM selet : https://github.com/vicb/bsmSelect You will need also a piece of python to restore the order of the list elements you get from the DB... But I am not sure of your needs... For you issue that you have to pick

[web2py] list:reference painfull to fill

2013-12-09 Thread BlueShadow
Hi, If I had two tables one called ingredience and the other soup. It is quite painfull to put 20 ingredience in one soup. Is there any more convenient way? It is sopposed to work with a form for users to create more entries. So punching in the ids is not an option. -- Resources: - http://web2

[web2py] Format date after selecting field from database

2013-12-09 Thread Simon Carr
I have this line comment_RS = self.db(self.db.aol_comments.aol_id == item.text(0)).select( orderby=~self.db.aol_comments.comment_date) I want to format the date field like dd/mm/ How would I do this in Python? Thanks Simon -- Re

[web2py] Re: how to build field list from string for SQLFORM.grid?

2013-12-09 Thread P T
Thank you! On Monday, December 9, 2013 7:12:32 AM UTC-6, Massimo Di Pierro wrote: > > assuming the fields exist: > > fields=[db.monthly_projections.employee, db.monthly_projections.id, db. > monthly_projections.costcode] > for row in db(db.months).select(): >fields.append(db.monthly_projectio

[web2py] Re: Table reference field instead of the id

2013-12-09 Thread Anthony
> > I cannot use web2py id's for referencing my brands, I need to use id's > from another CRM application called "01". So I have in my "brands" table a > field called "id_01" and in the "products" table a field called > "brand_id_01". > > db.define_table('brands', > Field('id

[web2py] Re: get a controller function in default view

2013-12-09 Thread Anthony
Doesn't sound like a good idea. We can help more if you show some code. On Monday, December 9, 2013 5:48:41 AM UTC-5, Ivo wrote: > > Thank you for the reply. > This goes a bit above my (web2)py skills for the moment. > I resolved it by declaring the entire function inside the view. > that way it's

[web2py] Re: how to build field list from string for SQLFORM.grid?

2013-12-09 Thread Massimo Di Pierro
assuming the fields exist: fields=[db.monthly_projections.employee, db.monthly_projections.id, db. monthly_projections.costcode] for row in db(db.months).select(): fields.append(db.monthly_projections[row.effort_month.strftime('%b_%Y')]) or fields=[db.monthly_projections.employee, db.monthly

[web2py] Import from csv file with original id's

2013-12-09 Thread Gael Princivalle
Hello all. I need to import in one table data keeping original id's. I know that I have to drop the table first, but when I want to import the CSVfile web2py say me that " 'DAL' object has no attribute 'products' I've tried to follow these instructions: http://web2py.com/books/default/chapter/3

[web2py] Re: Importng dropbox and scheduler problem

2013-12-09 Thread Peter
It seems that the problem was caused by uwsgi running under python2.7, and the service using python2.6. Confusing that it ran from the command line with python2,6 fine. So this thread is now closed. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/

[web2py] Calendar

2013-12-09 Thread Martin Weissenboeck
I want to change some parameters of the Calendar *(1) I wanted to have German texts* *Solution:* - Download Calendar from http://sourceforge.net/projects/jscalendar/ - Change web2py_ajax.html: response.files.insert(3,URL('static','js/calendar-de.js')) *(2) Setup* Now the first day of

Re: [web2py] Re: Prevent multiple submit buttons from showing "Working..." on submit

2013-12-09 Thread Martin Weissenboeck
Interesting. My minimal app does not show any "Working..." message. I have to make more tests. 2013/12/9 Martin Weissenboeck > ok, maybe during the next two hours. > > > 2013/12/9 Niphlod > >> this is really unexpected. >> this line >> >> https://github.com/web2py/web2py/blob/master/applic

[web2py] Re: get a controller function in default view

2013-12-09 Thread Ivo
Thank you for the reply. This goes a bit above my (web2)py skills for the moment. I resolved it by declaring the entire function inside the view. that way it's always available when I call the html. On Monday, December 9, 2013 2:39:16 AM UTC+1, Anthony wrote: > > It would help if you show layout_1

[web2py] Re: Table reference field instead of the id

2013-12-09 Thread Gael Princivalle
Thanks Massimo but with: links = [dict(header=T('Brand'), body=lambda row: (db.brands(row.brand_id_01).name))] it give me this error: 'NoneType' object has no attribute 'name' I've also tried with reference: db.products.brand_id_01.represent = lambda id,row: '%s' % db.brands[row.brand_id_01].

[web2py] Typo on Reference Manual Chapter 9 re: Restrictions on Registration

2013-12-09 Thread Henry Nguyen
The following is contained under the Reference Manual Chapter 9 under the Restrictions on Registration section: If you want to allow people to register and automatically log them in after > registration but still want to send an email for verification so that they > cannot login again after

Re: [web2py] Re: Prevent multiple submit buttons from showing "Working..." on submit

2013-12-09 Thread Martin Weissenboeck
ok, maybe during the next two hours. 2013/12/9 Niphlod > this is really unexpected. > this line > > https://github.com/web2py/web2py/blob/master/applications/welcome/static/js/web2py.js#L462 > "selects" all the inputs in the form ... that syntax **should** leave out > all inputs with a name

[web2py] Re: foreign key constraint failed ???

2013-12-09 Thread Niphlod
foreign_keys = True keeps your data safe. Ignoring it means that your data doesn't respect referential integrity (meaning, it's faulty). Every "major" db engine forces it by default, SQLite instead needs an explicit declaration to enable it. You'd really need to check if all of your data is cons

[web2py] Re: Scheduler in Windows

2013-12-09 Thread Niphlod
uhmwhat happens if you start it with web2py.py -K verificationdemo -D 0 ? (all lowercase) On Sunday, December 8, 2013 3:09:38 AM UTC+1, Massimo Mascaro wrote: > > Thanks a lot for the super quick answer! After reading your post I did try > to create an empty model named scheduler.py and inde

Re: [web2py] Re: Prevent multiple submit buttons from showing "Working..." on submit

2013-12-09 Thread Niphlod
this is really unexpected. this line https://github.com/web2py/web2py/blob/master/applications/welcome/static/js/web2py.js#L462 "selects" all the inputs in the form ... that syntax **should** leave out all inputs with a name attribute Can you pack a minimal app to reproduce the issue ? O