[web2py] crud.update message

2012-06-19 Thread Annet
As part of a delete function I have the following lines of code: message='All data related to this node have been deleted' form=crud.update(table=db.Node,record=row,next=URL('index'),message=message,deletable=True) When the user checks the check to delete box and submits the form, the function r

Re: [web2py] Re: how can I pick a directory from a web2py form (equivalent to WxDirPickerCtrl)

2012-06-19 Thread Michele Comitini
Janath, I do not know if the following is something that can help but at least it allows doing neat things: http://tutorialzine.com/2011/09/html5-file-upload-jquery-php/ http://www.html5rocks.com/en/tutorials/file/dndfiles/ http://www.html5rocks.com/en/tutorials/file/filesystem/ http://net.tutspl

[web2py] Re: id.max()

2012-06-19 Thread Annet
Hi Anthony and Vasile, Thanks for your replies and explanation, problem solved. Kind regards, Annet

Re: [web2py] Re: Web2py RAM usage

2012-06-19 Thread Vasile Ermicioi
> In my case, i just started web2py server and set up apache2 + proxypass. > I need to change to uwsgi? it will keep your memory usage low --

[web2py] web2py as standalone desktop application

2012-06-19 Thread glomde
Hi, I was thinking of using web2py as standalone desktop application. After some tinkering I realized I needed to resolve some things. What I want * Application should be completely standalone. Each start of application should have its own DB. * When user starts app, browser should open with the

[web2py] An ExtendedLoginForm with facebook

2012-06-19 Thread raferbop
I used the code from the book(Full Stack Web Framework, 4th Ed) to create a facebook login successfully, but that code disabled the default login form. I tried to use ExtendedLoginForm but i got this error: 'FaceBookAccount' object has no attribute 'login_form'' Is there another way to keep the

[web2py] Re: how can I pick a directory from a web2py form (equivalent to WxDirPickerCtrl)

2012-06-19 Thread stefaan
>From what I understand: If it is a folder on the client pc, it probably isn't possible with just javascript. If it is a folder on the server, it should be possible to write something yourself (maybe a lot of work if you want a full-fledged file manager, but if you can live with listing possible

Re: [web2py] Re: uwsgi enable-thread option and web2py

2012-06-19 Thread Michele Comitini
If web2py does not leak memory (it did sometimes on development versions) the memory overhead is not very high compared to threads. The supplemental physical memory that each new web2py process, other than the parent process, requires is only a fraction of the virtual memory each process sees. Thi

Re: [web2py] Re: how can I pick a directory from a web2py form (equivalent to WxDirPickerCtrl)

2012-06-19 Thread Michele Comitini
The html5 filesystem API allows you to add files from the "real" filesystem of the clients machine to the "sandboxed" filesystem in the browser. The browser can then send files in the "sandbox" to the server or manipulate those directly. To add files to the sandboxed filesystem one can use drag&dr

[web2py] Works, but is it valid: db.sometable.id.table ??

2012-06-19 Thread Cliff Kachinske
It seems to work, because print db.sometable.id.table returns 'sometable'. But I can't find any documentation for it. Is this how things are supposed to work, or am I just seeing a side effect? Thanks Cliff Kachinske

[web2py] Re: Anyone using BootSwatch with new web2py layout

2012-06-19 Thread LightDot
Using "bootswatch.css" file name by web2py is a bit confusing, as can clearly be seen :) 1+ to renaming it in order to clearly distinguish that it's entirely provided by web2py project and doesn't come from Bootswatch. Either "bootswatch4w2p.css" or perhaps "web2py_bootswatch.css" or anything

[web2py] Re: Works, but is it valid: db.sometable.id.table ??

2012-06-19 Thread Anthony
Yes, it's supposed to work. Both db.sometable.anyfield.table and db.sometable.anyfield._table refer to the db.sometable object; and db.sometable.anyfield.tablename and db.sometable.anytable._tablename refer to the name of the db.sometable object (i.e., the string "sometable"). The ._table and .

[web2py] Re: Web2Py compute fields not working on update

2012-06-19 Thread LightDot
I think this is closely connected to an existing Issue 687 (Compute= should work always, not once): http://code.google.com/p/web2py/issues/detail?id=687 Regards On Monday, June 18, 2012 11:21:57 PM UTC+2, peter wrote: > > I would try removing the readable and writeable false for the compute >

[web2py] Re: Works, but is it valid: db.sometable.id.table ??

2012-06-19 Thread Cliff Kachinske
Thanks. This simplifies things tremendously. On Tuesday, June 19, 2012 9:33:04 AM UTC-4, Anthony wrote: > > Yes, it's supposed to work. Both db.sometable.anyfield.table and > db.sometable.anyfield._table refer to the db.sometable object; and > db.sometable.anyfield.tablename and db.sometable.an

[web2py] Re: web2py as standalone desktop application

2012-06-19 Thread Massimo Di Pierro
Are you saying all your data should be lost when the app is "closed"? Can you tell us more about the use case? Are you going to have concurrent users at all? Should they share any data? Do they need access to admin at all or just appadmin? On Tuesday, 19 June 2012 04:58:24 UTC-5, glomde wrote:

[web2py] Re: Web2Py compute fields not working on update

2012-06-19 Thread Massimo Di Pierro
I need your help debugging this. In dal.py there are these lines: def _listify(self,fields,update=False): for ofield in self: if not ofield.name in new_fields_names and ofield.compute: try: new_fields.append((ofield,ofield.compute(Row(fie

Re: [web2py] count current visitors

2012-06-19 Thread Richard Vézina
comet_messaging in gluon/contrib allow to use tornado and somehow it possible to get the number of connected user if websocket is activated client-side... Bruno has made a video where he is showing how to use comet_messaging and tornado with web2py. It is not this one, there is an other one, but

[web2py] Re: web2py as standalone desktop application

2012-06-19 Thread glomde
In my case I would like all my data to be lost when the app is closed. But I assume one could think that the user saves the data as well. The app is not very complicated, but I want to have a GUI interface. What the app should do is to read a file that the user chooses. This will the generate a DB

Re: [web2py] count current visitors

2012-06-19 Thread Marin Pranjić
you can search the group for more solutions, this is not the first time someone asked this question

[web2py] Re: Web2Py compute fields not working on update

2012-06-19 Thread Brandon Reynolds
Peter, I tried your fix with no luck. It did not work unfortunately. Massimo, I replaced the lines you specified with no luck. It never printed out computing. What should we try to next to debug this? Brandon On Tuesday, June 19, 2012 8:28:20 AM UTC-6, Massimo Di Pierro wrote: > > I need your

[web2py] Re: web2py as standalone desktop application

2012-06-19 Thread Massimo Di Pierro
If the app is not the network you need authentication. In this case youneed a shared persistant databases. Why not store everything else in session and do a session cleanup on login and logout. massimo On Tuesday, 19 June 2012 10:04:08 UTC-5, glomde wrote: > > In my case I would like all my

Re: [web2py] Re: database locking web2py vs. "external" access...

2012-06-19 Thread Doug Philips
On Mon, Jun 18, 2012 at 2:07 AM, Anthony wrote: > I don't think web2py is doing any magic -- I think it just relies on the > standard database and database driver behavior. "There in lies the rub" - the problem is that The Book isn't really very easy to use to find out just what the DAL does for

[web2py] Re: Admin - edit static files is broken

2012-06-19 Thread Neil
I think I've made some progress. The problem seems to be that since the URL has "static" in it, nginx is trying to serve it directly (instead of calling "admin/default/edit"). I think the offending lines in nginx.conf are the following: location ~* /(\w+)/static/ { root /hom

[web2py] Re: Web2Py compute fields not working on update

2012-06-19 Thread Massimo Di Pierro
Basically the function _listify is called by both inser and update. It figures out which fields are missing and gets their default, update or computed value. Looks like it is not calling compute. It has three loops: for name in fields: ... for ofield in self:

Re: [web2py] Re: database locking web2py vs. "external" access...

2012-06-19 Thread Doug Philips
On Mon, Jun 18, 2012 at 4:02 AM, Niphlod wrote: >> Ok, just to double check, that is for all DB back-ends or just for SQLite? >> > This is true for every backend. Thanks! > Web2py is not blocked, and again, it's only with SQLite that there is the > problem. From the first update on the queue to

[web2py] Re: web2py as standalone desktop application

2012-06-19 Thread glomde
I do not really want authetication. The app will be accessed locally but on network drive. I want to do it as simple as possible for the user. So the user just runs a command from terminal and the app opens i firefox. When he closes the app this will close the app. But can you store a sqlite db

[web2py] is there a log of web2py errors when server fails to start?

2012-06-19 Thread simon
I just made a small change to logging.conf and the web2py server would not start. Is there a log file somewhere that shows what went wrong?

Re: [web2py] Re: database locking web2py vs. "external" access...

2012-06-19 Thread Anthony
> > > I don't think web2py is doing any magic -- I think it just relies on the > > standard database and database driver behavior. > > "There in lies the rub" - the problem is that The Book isn't really > very easy to use to find out just what the DAL does for each DB and > what "shows through

Re: [web2py] Re: recognizing web2py restart

2012-06-19 Thread Derek
Look in main.py for the httpserver class. you could handle the cleanup in the stop function, or you could look at widget.py and add a line after the start server function to do the cleanup. On Friday, June 8, 2012 2:04:17 PM UTC-7, Jonathan Lundell wrote: > > On Jun 8, 2012, at 12:49 PM, Derek w

Re: [web2py] recognizing web2py restart

2012-06-19 Thread Jonathan Lundell
On Jun 19, 2012, at 2:08 PM, Derek wrote: > Look in main.py for the httpserver class. you could handle the cleanup in the > stop function, or you could look at widget.py and add a line after the start > server function to do the cleanup. Those are relevant only if you're using Rocket, right? If

[web2py] Re: bootstrap carousel web2py Nightly build

2012-06-19 Thread LightDot
There was a very recent change from using .icon-chevron-right to using .chevron-right in web2py itself and this might be your issue. You could test quickly by commenting out the .icon-chevron-right section in bootswatch.css. This will affect other things, so just test if it fixes the Carousel

[web2py] Re: Anyone using BootSwatch with new web2py layout

2012-06-19 Thread Andrew
I think the file content relates more to bootstrap specifically. Bootswatch is a website with lots of different bootstrap.css files. Rename makes sense, it sort of is a "web2py_bootstrap_adaptor" , but that's a bit long.

Re: [web2py] Re: database locking web2py vs. "external" access...

2012-06-19 Thread Niphlod
> > I was being half kidding, but only half. :-) > given that that phrase could initiate another round of "web2py sucks" and that is actually a simple statement to say that that behaviour occurs only with standard sqlite, I was not kidding at all :P > > Maybe I should make a slice on how t

[web2py] Re: bootstrap carousel web2py Nightly build

2012-06-19 Thread Paolo Caruccio
I'm building an app trying carousel feature and I met the same your issue. My solution (note style stayement): › Maybe you should adapt the width to your necessity. Il giorno martedì 19 giugno 2012 19:25:07 UTC+2, dundee ha scritto: > > Hey all, > > Anyone trying to use carousel in web2py nig

[web2py] Re: bootstrap carousel web2py Nightly build

2012-06-19 Thread LightDot
I was too quick to comment and too optimistic :) It seems Bootstrap's css will need to be further tested for collisions with current web2py css code. I'm using Carousel myself but didn't notice the problem because I have never enabled the controls... Regards On Tuesday, June 19, 2012 9:35:42 P

Re: [web2py] Re: bootstrap carousel web2py Nightly build

2012-06-19 Thread Kevin Miller
Thanks for the replies. That fixed worked for me Paolo. On Tue, Jun 19, 2012 at 2:59 PM, LightDot wrote: > I was too quick to comment and too optimistic :) > > It seems Bootstrap's css will need to be further tested for collisions > with current web2py css code. I'm using Carousel myself but di

Re: [web2py] Re: Problem while using two sqlform.grid in a single form

2012-06-19 Thread Cliff Kachinske
Jonathan, I realize fixing this isn't a priority. Could you retain the edit/view state in the session and retrieve it on reload? On Monday, June 18, 2012 8:48:50 PM UTC-4, Jonathan Lundell wrote: > > On Jun 18, 2012, at 5:17 PM, Massimo Di Pierro wrote: > > The grid uses the request args to fig

[web2py] admin login page invites admin to leak password

2012-06-19 Thread pyhead
Security vulnerability When accessing the admin page on a server with http and https both enbled, admin may accidentally attempt to login via http. The login page looks the same and displays an input for the password even when the login will be rejected due to insecure http protocol, while sti

Re: [web2py] Infinite loop: Auth using OAuth2 with Facebook

2012-06-19 Thread Michele Comitini
You don't return a dictionary with the registration_id key in the get_user() method. change the code as follows: return dict(first_name = user['first_name'], last_name = user['last_name'], username = user['id'], registration_id = user['id']) This is stated in the web2py book as required paramet

[web2py] Re: Web2Py compute fields not working on update

2012-06-19 Thread Brandon Reynolds
I have spend a long time on this and haven't come up with a fix. My script is back to the original but oddly enough not the new record thumbnails aren't generating either. I had the files when they were working saved elsewhere and just put them back in. Now thumbnails aren't generating at all.

[web2py] Re: Web2Py compute fields not working on update

2012-06-19 Thread villas
I don't understand this line: img.db_photo_var((nx, ny), Image.ANTIALIAS) why isn't it this?? img.thumbnail((nx, ny), Image.ANTIALIAS) Isn't thumbnail a method in PIL? Maybe I'm missing something? Regards, David

[web2py] helps for the biginer on web2py

2012-06-19 Thread song
I start to study the web2py system. I understand the models and a little controllers. But now it is very difficult for me to understand the complex views technologies. Are there more simple and concise ppt or pdf files?

Re: [web2py] helps for the biginer on web2py

2012-06-19 Thread Marco Mansilla
the book [1] should be enough, very explicit and easy to understand, plus this list is very helpfull too... [1] http://www.web2py.com/book > I start to study the web2py system. I understand the models and a > little controllers. > But now it is very difficult for me to understand the complex view

[web2py] Re: helps for the biginer on web2py

2012-06-19 Thread Anthony
In addition to the tutorial and the Views chapter in the book, there are also some templateand layout

Re: [web2py] Infinite loop: Auth using OAuth2 with Facebook

2012-06-19 Thread Alec Taylor
On Wed, Jun 20, 2012 at 7:49 AM, Michele Comitini wrote: > You don't return a dictionary with the registration_id key in the > get_user() method. > > change the code as follows: > >  return dict(first_name = user['first_name'], last_name = > user['last_name'], username = user['id'], registration_i

Re: [web2py] Re: web2py + Rocket server SSL is vulnerable

2012-06-19 Thread pyhead
Yes, the patch worked. The test was run on Rocket and Python 2.7.1, the default on Mac OS X. Upgrading to Python 2.7.3 disabled the insecure SSL 2.0 and <128 bit ciphers. On Saturday, May 19, 2012 10:39:27 PM UTC-5, Massimo Di Pierro wrote: > > I believe these vulnerabilities are fixed by this

[web2py] Re: web2py as standalone desktop application

2012-06-19 Thread Massimo Di Pierro
You cannot store db in session but I do not see why you need a db at all if, in principle, you do not want rersistence. On Tuesday, 19 June 2012 11:15:12 UTC-5, glomde wrote: > > I do not really want authetication. The app will be accessed locally but > on network drive. > I want to do it as sim

[web2py] Re: admin login page invites admin to leak password

2012-06-19 Thread Massimo Di Pierro
Please open a ticket about this. I can fix it tonight but I do not want to forget. Massimo On Tuesday, 19 June 2012 16:32:38 UTC-5, pyhead wrote: > > Security vulnerability > > When accessing the admin page on a server with http and https both enbled, > admin may accidentally attempt to login v

Re: [web2py] Re: bootstrap carousel web2py Nightly build

2012-06-19 Thread Andrew
Hi Paolo, Does something need to be added to the standard css files (bootswatch.css or whatever we call it) for this ? On Wednesday, June 20, 2012 8:16:36 AM UTC+12, dundee wrote: > > Thanks for the replies. That fixed worked for me Paolo. > > > On Tue, Jun 19, 2012 at 2:59 PM, LightDot wrote: >

[web2py] Help understanding SQLFORM.accepts/process/validate

2012-06-19 Thread Kory Prince
Hello all. I am attempting to make a custom field of sorts that is composed of other field types. For example this one field will write html for x number of fields and will be stored in the db as list of x elements. If there is some better way in web2py to do this please let me know! So far th

[web2py] Re: foreign key reference and "not null" mutually exclusive. by design, or a bug?

2012-06-19 Thread Ivan
Same problem here! The "notnull=True" parameter doesn't append the "NOT NULL" clause for reference fields. The IS_IN_DB function activates the check at form-level while the notnull parameter should set the constraint at db-level.

[web2py] menu.append() more than one argument

2012-06-19 Thread Annet
In a controller I have the following menu: response.site_submenu = [] if session.vcardsettings: response.site_submenu.append( ['Logo',request.function=='uploadLogo',URL('uploadLogo')], ['Tagline',request.function=='tagline',URL('tagline')], ['Note',request.function=='note',URL('not