[web2py] Three suggestion tickets opened, please review and comment

2012-03-08 Thread nick name
I have opened 3 suggestion tickets on the tracker at http://code.google.com/p/web2py/issues/list Issue 701 : Suggestion: lightweight DAL select processing - x10 to x100 speedup with large query results Issue 702

[web2py] Re: How to display reference field in sqltable?

2012-03-08 Thread nick name
On Thursday, March 8, 2012 8:52:34 PM UTC-5, Edward Shave wrote: > > Many thanks for reply, unfortunately it didn't work in this instance... I > wonder if it is because the table is referencing itself? By coincidence, I noticed the same problem earlier myself and opened ticket #700 http://code.

[web2py] Re: DAL speed - an idea

2012-03-08 Thread Anthony
Nice. I added a comment. On Friday, March 9, 2012 12:41:26 AM UTC-5, nick name wrote: > > > > On Friday, February 10, 2012 12:04:59 AM UTC-5, Massimo Di Pierro wrote: >> >> open a ticket, this can be done. I like the idea of passing a >> processor. >> > > Opened in http://code.google.com/p/web2p

[web2py] Re: DAL speed - an idea

2012-03-08 Thread nick name
On Friday, February 10, 2012 12:04:59 AM UTC-5, Massimo Di Pierro wrote: > > open a ticket, this can be done. I like the idea of passing a > processor. > Opened in http://code.google.com/p/web2py/issues/detail?id=701 with discussion and a much improved suggestion of how to handle this.

Re: [web2py] Re: Get the Image from the database filtered on the email id

2012-03-08 Thread Sanjeet Kumar
Ok Anthony Thanks

[web2py] Re: Many to Many?

2012-03-08 Thread lyn2py
Nope, your way is the better way :) On Friday, March 9, 2012 8:14:57 AM UTC+8, Derek wrote: > > Let's say I am designing a database. > > It has these elements: > Companies, Locations, Servers > > Each company has one location, and one or more servers. > Each server has one and only one location. >

Re: [web2py] Re: Get the Image from the database filtered on the email id

2012-03-08 Thread Anthony
On Thursday, March 8, 2012 11:31:01 PM UTC-5, Sanjeet Kumar wrote: > > Ok Anthony how can we automate that I mean we should probably make it so the DAL automatically handles deleting old files for upload fields upon update so you don't have to handle it explicitly in your app code. Anthony

Re: [web2py] Re: Get the Image from the database filtered on the email id

2012-03-08 Thread Sanjeet Kumar
Ok Anthony how can we automate that

Re: [web2py] Re: Get the Image from the database filtered on the email id

2012-03-08 Thread Sanjeet Kumar
ok Antony On Fri, Mar 9, 2012 at 9:50 AM, Anthony wrote: > Anthony i have one more question regarding this when the employee will >> update his image than the updated images are shown but i guess the one more >> problem here is the previous images are not deleted from our database so >> how the

Re: [web2py] Re: Get the Image from the database filtered on the email id

2012-03-08 Thread Anthony
> > Anthony i have one more question regarding this when the employee will > update his image than the updated images are shown but i guess the one more > problem here is the previous images are not deleted from our database so > how the previous image will be deleted when the employee will upd

[web2py] Re: db.mytable.myfield.represent= ???

2012-03-08 Thread Anthony
> > The more I look at the examples and read the explanation the less sense I > can make of it? There is no doubt it works (at least sometimes) because I > have pasted modifed versions into my code and seen it works. Problem is I > don't understand how to use it in general. > "represent" shoul

Re: [web2py] Re: Get the Image from the database filtered on the email id

2012-03-08 Thread Sanjeet Kumar
Anthony i have one more question regarding this when the employee will update his image than the updated images are shown but i guess the one more problem here is the previous images are not deleted from our database so how the previous image will be deleted when the employee will update the image.

Re: [web2py] Re: get the dynamically value from the list and send the mail by using the cron job

2012-03-08 Thread Sanjeet Kumar
Thanks Kim i will try this On Thu, Mar 8, 2012 at 5:03 AM, Sean Kim wrote: > Not really sure what you're saying, but I assume that basically you > want to email the company with due date that matches current date. > Wouldn't this work? > > currentdate = datetime.date.today() > for row in db(db.c

Re: [web2py] Re: get the dynamically value from the list and send the mail by using the cron job

2012-03-08 Thread Sanjeet Kumar
Thanks Alan On Thu, Mar 8, 2012 at 3:24 AM, Alan Etkin wrote: > If you want to avoid redundant mails, you can set a sequence of sent > id's and compare them at every loop iteration > > for message to send: >if not (the message was sent): >send the email > > Also, you should store ema

Re: [web2py] Re: Get the Image from the database filtered on the email id

2012-03-08 Thread Sanjeet Kumar
Thanks Anthony On Wed, Mar 7, 2012 at 8:40 PM, Anthony wrote: > URL('default', 'download', args=db(db.employee.email_id == > some_id).select().first().image) > > This assumes you have the standard download() function in your default.py > controller: > > def download(): > return response.down

[web2py] db.mytable.myfield.represent= ???

2012-03-08 Thread Edward Shave
below is an extract from the book which describes the field represent feature - *represent can be None or can point to a function that takes a field value and returns an alternate representation for the field value. Examples: * *1. 2. 3. 4.* *db.mytable.name.represent = lambda na

[web2py] Re: How to display reference field in sqltable?

2012-03-08 Thread Anthony
On Thursday, March 8, 2012 8:52:34 PM UTC-5, Edward Shave wrote: > > Many thanks for reply, unfortunately it didn't work in this instance... I > wonder if it is because the table is referencing itself? > > Anyway I have found the following works but I wonder about the efficiency? > > *db.account.

[web2py] Re: How to display reference field in sqltable?

2012-03-08 Thread Edward Shave
Many thanks for reply, unfortunately it didn't work in this instance... I wonder if it is because the table is referencing itself? Anyway I have found the following works but I wonder about the efficiency? *db.account.transfer_acc.represent= lambda value:db.account[value].name* On Thursday, 8

[web2py] [login_method] This code is right?

2012-03-08 Thread sungchi
I want to separation of the default login and google login. *models/db.py:* from gluon.contrib.login_methods.gae_google_account import GaeGoogleAccount *view/default/googlelogin.html:* {{=form}} *controller/default.py* def login(): if auth.user_id: redirect(session.old_referer) l

[web2py] Re: Many to Many?

2012-03-08 Thread pbreit
I don't really understand the question but I would think something like this: db.define_table('company', Field('name')) db.define_table('server', Field('name'), Field('company', db.company), Field('location', db.location)) db.define_table('location', Field('name')) Or since

Re: [web2py] pycon 2012

2012-03-08 Thread Ovidio Marinho
Unfortunately I can not be there with everyone, but I'm happy to have contributed to theweb2py can be there. Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 8

[web2py] Many to Many?

2012-03-08 Thread Derek
Let's say I am designing a database. It has these elements: Companies, Locations, Servers Each company has one location, and one or more servers. Each server has one and only one location. So, company "Telefónica de España" has location "Madrid". They have four servers, "Pablo", "Alejandro", "Gu

[web2py] Re: List comprehension with Storage() object

2012-03-08 Thread Derek
ah, I thought he was trying to call 'append' on every object. In that case, this is what i'd do... li = x.toLowerCase() for x in leases but yours solution is probably what he was wanting. On Thursday, March 8, 2012 5:05:00 PM UTC-7, pbreit wrote: > > Oh, wow, that was easy: > > li = [lease

[web2py] Re: List comprehension with Storage() object

2012-03-08 Thread pbreit
Oh, wow, that was easy: li = [lease.id for lease in leases] On Thursday, March 8, 2012 3:57:09 PM UTC-8, pbreit wrote: > > I can't seem to figure out how to do this in a one-line with list > comprehension: > > li = [] > for lease in leases: > li.append(lease.id) >

[web2py] List comprehension with Storage() object

2012-03-08 Thread pbreit
I can't seem to figure out how to do this in a one-line with list comprehension: li = [] for lease in leases: li.append(lease.id)

[web2py] Re: Current user's username? Customized access control with Auth and LDAP?

2012-03-08 Thread Aaron
Thank you, sir! This looks just right for my group needs (though I'm not sure how I'd get a list of the current user's groups). Also, as I mentioned, I'm new to LDAP, so if you could provide sample LDIF files for the groups, that'd help greatly. Unfortunately I'm also using OpenLDAP, so I can't

[web2py] pycon 2012

2012-03-08 Thread Massimo Di Pierro
I am at PyCon with Mariano. I remind you we will have an Open Space tomorrow (place TBD) and we may go out for dinner tonight. Let us know if you are around and want to join. We will be in front of registration at around 7pm. Massimo

Re: [web2py] Re: The Winners! Web2py Application Exhibition Version 3.0

2012-03-08 Thread Massimo Di Pierro
I will not accept this donation. Winners should keep all their prizes. They deserve it. Yet I appreciate it very much. On Thursday, 8 March 2012 09:40:00 UTC-6, NetAdmin wrote: > > Phyo, > > I'll donate $20 to the Web2py Project, but I still need to know how to > send the $30 dollars to you. > >

[web2py] hg and git have diverged again

2012-03-08 Thread nick name
As of yesterday, hg has a few files that neither git repo (mdipierro and web2py) does. Surprisingly, the git push run make 9 minutes later, but seems to lag behind the hg. Only in web2py.hg/applications/admin/controllers: webservices.py Only in web2py.hg/applications/admin/views/debug: breakpoin

[web2py] Re: CRUD .represent question #2

2012-03-08 Thread Gian Luca Decurtins
> > That's not how it works. When the table is defined, if you have > Field('location', db.location, ...) with no explicit "represent=...", then > it will automatically set the "represent" attribute for you based on the > _format attribute of the db.location table. However, if you set an explic

[web2py] Re: accessing to static folder via .load is broken

2012-03-08 Thread smoggy
just submited the ticket in google code.

Re: [web2py] Re: @auth.requires_membership(VCARD or ROOT)

2012-03-08 Thread Anthony
Right -- the first argument to auth.requires is "condition", which can either be something that evaluates to True or False or a single callable. On Thursday, March 8, 2012 2:13:33 PM UTC-5, Richard wrote: > > And only need one lambda : > > #WORKS > @auth.requires(lambda: auth.has_membership('grou

Re: [web2py] Web2py + uWSGI and timeouts!!

2012-03-08 Thread Roberto De Ioris
> When i check i got this error : > > 1. > 2. > 3. > 4. > 5. > 6. > > 7. > 8. > 9. > 10. > 11. > > Traceback (most recent call last): > > File "/home/v3ss/WorkSpace/FastTract/web2py/gluon/main.py", line > 447, in wsgibase > > parse_get_post_vars(request, environ) > File "/home/v3ss/WorkSpa

[web2py] Re: Current user's username? Customized access control with Auth and LDAP?

2012-03-08 Thread szimszon
Group control is already in ldap_auth.py: http://www.web2pyslices.com/slice/show/1476/ldap-auth-with-allowed-groups-and-manage-groups And I work now on storing first name, last name, and email user prefs from ldap. I think I can send a patch to Massimo tomorrow. 2012. március 8., csütörtök 20:2

Re: [web2py] Re: redirect fails in module

2012-03-08 Thread Richard Vézina
You could also try by just passing the parameter to URL and not invoking the request.application, request.controllers, etc. Try : URL(a="application", c="your controller"...) Richard On Thu, Mar 8, 2012 at 4:26 PM, Richard Vézina wrote: > If it is only at redirect, I think it's because you don

[web2py] Data Fixtures

2012-03-08 Thread Bruce Wade
Hi, I have seen lots of postings about people wanting to pre-load data (fixtures) in web2py. However I have never found a standard solution. What are the best practices? Also before someone suggests putting them in the models directory I don't think that is a good idea. I would prefer something m

Re: [web2py] Re: redirect fails in module

2012-03-08 Thread Richard Vézina
If it is only at redirect, I think it's because you don't use current. I can't explain the rational, but just try, you may be suprise... redirect(URL(request.application, request.controller, 'index')) Richard On Thu, Mar 8, 2012 at 2:23 PM, Cliff wrote: > I can see both the form and crumb_trai

[web2py] looking for tutorial extends user and related to an other app

2012-03-08 Thread bussiere adrien
Hello i'am looking for tutorial to : Extends user add field to database. Then : an app street an app buildint link building field with street field And more tutorial Regards Bussiere

[web2py] Re: The Winners! Web2py Application Exhibition Version 3.0

2012-03-08 Thread mikech
Next time I would be willing to contribute towards the prize. I think this is a good way to feed the web2py ecosystem. Mike On Wednesday, March 7, 2012 10:49:33 AM UTC-8, NetAdmin wrote: > > > 1st Place Prize $100 > > Brian Cottingham from the U.S. was the First Place Winner. > His entr

[web2py] Re: Error on File Upload

2012-03-08 Thread Phyo Arkar
Here is uwsgi log. Its seriouly timing out ... what should i do. Only 1 upload of large file (>300 MB) is saved , else is not written. [pid: 24243|app: 0|req: 1/1] 127.0.0.1 () {36 vars in 663 bytes} [Fri Mar 9 03:25:27 2012] GET /admin => generated 3773 bytes in 448 msecs (HTTP/1.1 200) 6 heade

[web2py] Error on File Upload

2012-03-08 Thread Phyo Arkar
Here with uWSGI setup i am getting this error: File "/home/v3ss/WorkSpace/FastTract/web2py/gluon/fileutils.py", line 376, in copystream data = src.read(chunk_size) IOError: error waiting for wsgi.input data It happens when file size > 300 MB. I am running using uwsgi. #!/bin/bash ./uwsg

Re: [web2py] Web2py + uWSGI and timeouts!!

2012-03-08 Thread Phyo Arkar
When i check i got this error : 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. Traceback (most recent call last): File "/home/v3ss/WorkSpace/FastTract/web2py/gluon/main.py", line 447, in wsgibase parse_get_post_vars(request, environ) File "/home/v3ss/WorkSpace/FastTract/web2py/gluon/main.py", line

[web2py] Re: appadmin ticket

2012-03-08 Thread pbreit
I normally see: from gluon.tools import Auth auth = Auth(db) auth.define_tables()

Re: [web2py] Web2py + uWSGI and timeouts!!

2012-03-08 Thread Phyo Arkar
Another problem with uWSGI i am wirting a custom uploader (multipart form/data) But after it finished writing data to file , i can no longer upload another , uwsgi gives no response. What can be the cause? On Thu, Mar 8, 2012 at 10:05 PM, Phyo Arkar wrote: > Oh thanks a lot! > > I will add

[web2py] global search form

2012-03-08 Thread web-dev-m
Hey everyone, Thank you so much for your help on my previous issues. I am trying to create a global search form. I followed Massimo's example on the social networking example to get a great form working. I then embedded it in a model and posted the view into my common layout. I followed the sl

Re: [web2py] {{=_name.replace('_',' ')}}

2012-03-08 Thread Vinicius Assef
Why didn't it work? What was the error message you received? On Thu, Mar 8, 2012 at 4:22 AM, Annet wrote: > In a view I have th following code to generate a vertical menu: > > {{for _name,_active,_link in response.admin_menu:}} >   >     onclick="web2py_component('{{=_link}}','component')">{{=_n

Re: [web2py] Re: The Winners! Web2py Application Exhibition Version 3.0

2012-03-08 Thread Mr admin
My Pleasure! Mr.NetAdmin On Thu, Mar 8, 2012 at 1:15 PM, spiffytech wrote: > Yay! Thanks for putting on the contest! > > > On Wednesday, March 7, 2012 1:49:33 PM UTC-5, NetAdmin wrote: >> >> >> 1st Place Prize $100 >> >> Brian Cottingham from the U.S. was the First Place Winner. >> His e

[web2py] Re: Current user's username? Customized access control with Auth and LDAP?

2012-03-08 Thread Aaron
Also, what meaning does the @auth.requires_membership() decorator have in the context of LDAP authentication? Based on my limited knowledge of LDAP (pretty much what's on http://ldapman.org/articles/intro_to_ldap.html), it doesn't look like LDAP implements groups; the closest thing to it would

[web2py] Re: redirect fails in module

2012-03-08 Thread Cliff
I can see both the form and crumb_trail. That's the strange part - everything works fine up to the redirect. I will try calling trashit as you suggest, though. It had occurred to me that it might be a possibility. But I don't understand why it should not work... On Mar 8, 2:11 pm, Richard Vézi

[web2py] Re: The Winners! Web2py Application Exhibition Version 3.0

2012-03-08 Thread spiffytech
Yay! Thanks for putting on the contest! On Wednesday, March 7, 2012 1:49:33 PM UTC-5, NetAdmin wrote: > > > 1st Place Prize $100 > > Brian Cottingham from the U.S. was the First Place Winner. > His entry of MobleBlur is a mobile-friendly interface > to the Newsblur RSS reading website.

Re: [web2py] Re: @auth.requires_membership(VCARD or ROOT)

2012-03-08 Thread Richard Vézina
And only need one lambda : #WORKS @auth.requires(lambda: auth.has_membership('group1') or auth.has_membership('group2')) # First aptemp NOT WORKING @auth.requires(lambda: auth.has_membership('group1') or lambda: auth.has_membership('group2')) :) Richard On Thu, Mar 8, 2012 at 2:04 PM, Anthony

Re: [web2py] Re: redirect fails in module

2012-03-08 Thread Richard Vézina
Ok then, I think you have to map your form ### Controller: def trash(): import trash_it return trash_it.trashit(request, session,response, db) >From trash_it.trashit() return : return dict( form=form, crumb_trail=crumb_trail) So, your controller trash() function should look like this...

Re: [web2py] Re: @auth.requires_membership(VCARD or ROOT)

2012-03-08 Thread Anthony
Good point -- if your auth.requires(...) includes conditions that do database hits, it is better to put the conditions inside a lambda so the db hits only happen when the decorated action is actually called and not every time the controller is loaded (i.e., when other actions within the control

Re: [web2py] orderby function

2012-03-08 Thread Richard Vézina
Ok, now I understand your problem... I would need to see the model definition of : db.MusicListener Also, I suggest you start simple and use the full path of web2py query syntax after when it works with the long query syntax you can short them as you want. But first keep it simple... Wait for yo

[web2py] Re: redirect fails in module

2012-03-08 Thread Cliff
Yes, it works. Every controller has a trash function because every index table has a trash link. Similar to the way grid has a delete button on its index tables. It is like this: def index(): query = db.sometable.is_active==True if such_and_such: query = query & db.sometable.somefield==

Re: [web2py] Re: @auth.requires_membership(VCARD or ROOT)

2012-03-08 Thread Richard Vézina
With lambda is better for speed : https://groups.google.com/forum/#!msg/web2py/A0z8DSZdYTo/H_1N6_4MZfEJ Richard On Thu, Mar 8, 2012 at 4:09 AM, Annet wrote: > Hi Bruno, > > Thanks for your reply. > > > Kind regards, > > Annet

[web2py] EMAIL validator

2012-03-08 Thread Bruce Wade
Hi, I found a situation where an valid email is being returned as an invalid email. The domain is 126.com which is actually valid. -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com

[web2py] Re: EMAIL validator

2012-03-08 Thread Bruce Wade
It worked the 3rd time, maybe copying from excel added some extra garbage data the first 2 times. On Thu, Mar 8, 2012 at 10:22 AM, Bruce Wade wrote: > Hi, > > I found a situation where an valid email is being returned as an invalid > email. > > The domain is 126.com which is actually valid. > >

[web2py] Re: bug? -- commented for loop

2012-03-08 Thread weheh
Hmm, it's been a long long time since I read the doc about the views. But I don't recall reading about this behavior. I will have to go back and take a look again. On the surface of it, forbidding inline comments does not seem like a useful behavior when used within the {{ }}. As in this case, I ha

Re: [web2py] Re: redirect fails in module

2012-03-08 Thread Richard Vézina
If you bring your module trashit function into controller does it work? Make what you try to do (I mean define a "page" controller function into module) and what the utility to put the trash function into module? Modules are useful for function you want to use every where (any controller files) wi

[web2py] [FYI] GestiónLibre v1.0.0

2012-03-08 Thread Alan Etkin
New version of the desktop open source ERP software for small and medium-sized business that is built over web2py interfaces. User's manual (spanish), all-in-one installer and source code available under AGPLv3 license at: http://code.google.com/p/gestionlibre As of now, the application supports

Re: [web2py] my app not works with web2py 1.99.7

2012-03-08 Thread Richard Vézina
Ping! Richard On Wed, Mar 7, 2012 at 10:48 AM, Richard Vézina wrote: > I use to download source package and make my update by my own (manually). > I don't use the update feature. > > Here most of my db.py that contain db connection and all related auth > configuration : > > db=DAL('postgres://U

[web2py] Re: redirect fails in module

2012-03-08 Thread Cliff
Here is the controller ### Controller: def trash(): import trash_it return trash_it.trashit(request, session,response, db) On Mar 8, 12:06 pm, Richard Vézina wrote: > I didn't see rapidly other problem in the code... > > The only thing I could suspect is if you use directly (I mean call

Re: [web2py] Re: redirect fails in module

2012-03-08 Thread Richard Vézina
I didn't see rapidly other problem in the code... The only thing I could suspect is if you use directly (I mean call the module trashit function from the URL) trashit... Since it is a parameted function if won't be allowed to execute it from the URL. We don't see your controller... Also, maybe

[web2py] Re: redirect fails in module

2012-03-08 Thread Cliff
Richard, Thanks for the hints. You can pass the response object to a module directly, without using current. I have other modules that work this way; the only problem is the long parms list. I know the html imports are working correctly because the form renders. I suspect the http imports are w

[web2py] Re: CRUD .represent question #2

2012-03-08 Thread Anthony
> > I've removed the two lines, but the behavior is still the same. So there > must be an other error in my code? > Hmm, I would think it should work -- not sure what the problem is. > My idea is that the format does specify the string for db.object.location > and the db.object.location.repr

Re: [web2py] orderby function

2012-03-08 Thread greenguerilla
Hi Richard, my_user is an instance of db.auth_user, e.g. my_user = db.auth_user[1] or my_user = db(db.auth_user).select().first() sorry my terminology is a bit rubbish, the crux of my problem is how to order records in a particular table according to the number of records in a different tab

Re: [web2py] redirect fails in module

2012-03-08 Thread Richard Vézina
You may check if those import are working properly : from html import FORM, H2, P, BR, INPUT, URL from http import HTTP, redirect Could it be possible that it should be import like this : from gluon.html import FORM?? Richard On Thu, Mar 8, 2012 at 11:09 AM, Richard Vézina wrote: > I think

Re: [web2py] redirect fails in module

2012-03-08 Thread Richard Vézina
I think you will need to read a bit about current, current.response, current.request, etc. Richard On Thu, Mar 8, 2012 at 11:04 AM, Cliff wrote: > What am I doing wrong? > > This code works fine in a controller. When moved to a module it fails > with a 303 error. > Here is the code: > > ### C

[web2py] redirect fails in module

2012-03-08 Thread Cliff
What am I doing wrong? This code works fine in a controller. When moved to a module it fails with a 303 error. Here is the code: ### Controller: def trash(): import trash_it return trash_it.trashit(request, session,response, db) ## module trash_it.py from html import FORM, H2, P, BR, IN

[web2py] Re: No models vs. conditional models -- what's the advantage?

2012-03-08 Thread Cliff
Anthony, Bruno, Thank you. I guess I will spend some time studying Bruno's no models example. On Mar 8, 10:45 am, Bruno Rocha wrote: > another advantage is the fact that you can import modules, you cannot > import models. it is very nice to import your tables on external scripts. > > http://zer

Re: [web2py] Re: No models vs. conditional models -- what's the advantage?

2012-03-08 Thread Bruno Rocha
another advantage is the fact that you can import modules, you cannot import models. it is very nice to import your tables on external scripts. http://zerp.ly/rochacbruno Em 08/03/2012 12:11, "Anthony" escreveu: > I think an additional advantage of the module approach is that the module > only h

Re: [web2py] Re: The Winners! Web2py Application Exhibition Version 3.0

2012-03-08 Thread Mr admin
Phyo, I'll donate $20 to the Web2py Project, but I still need to know how to send the $30 dollars to you. Thanks for your donation. Mr.NetAdmin On Thu, Mar 8, 2012 at 7:41 AM, Phyo Arkar wrote: > Thank you very much Mr NetAdmin! > > Can you donate 20$ from my Prize money to web2py project pl

Re: [web2py] Web2py + uWSGI and timeouts!!

2012-03-08 Thread Phyo Arkar
Oh thanks a lot! I will add --close-on-exec then. i also trying --cpu-affinity On Thu, Mar 8, 2012 at 9:31 PM, Roberto De Ioris wrote: > > > Hello > > > > I am testing web2py with uWSGI and some request have random timeout > (after > > IO Heavy operation is started , but it is spawned using >

[web2py] Re: CRUD .represent question #2

2012-03-08 Thread Gian Luca Decurtins
> > db.object.location.represent = lambda location, row: \ >>A(location,_href=URL('location', 'update', args=(location.id), >> user_signature=True)) >> > > In the above line, you have specified your own "represent" attribute for > the "location" field, so it will not use the "format"

[web2py] Error with 1.99.7

2012-03-08 Thread Jose
Hello, This error happened with version 1.99.7. I'm back to 1.99.4 and fixes. The database is SQLServer. Failure to connect, tried 5 times: Traceback (most recent call last): File "/home/web2py/gluon/dal.py", line 5955, in __init__ self._adapter = ADAPTERS[self._dbname](*args) File "/home/web

[web2py] Re: No models vs. conditional models -- what's the advantage?

2012-03-08 Thread Anthony
I think an additional advantage of the module approach is that the module only has to be loaded once (when it is first imported), but the model files have to be read on every request. Anthony On Thursday, March 8, 2012 10:04:11 AM UTC-5, Cliff wrote: > > Certainly we want to avoid processing un

[web2py] Current user's username? Customized access control with Auth and LDAP?

2012-03-08 Thread Aaron
I'm using gluon.tools.Auth and the default ldap_auth login_method to provide access control to my web2py application. Now, once the user has successfully logged in (@auth.require_login() passes), I want to find out which user is logged in, and some of this user's attributes. I could get addition

[web2py] Re: Web2py binary distribution and psycopg2 driver

2012-03-08 Thread Sundar
I tried the binary of 1.99.7 and the driver pg8000. I am getting the error message global name 'psycopg2_adapt' is not defined Where am I going wrong? Sundar === On Thursday, January 12, 2012 12:51:50 AM UTC+5:30, Massimo Di Pierro wrote: > > w

[web2py] Re: CRUD .represent question #2

2012-03-08 Thread Anthony
> > db.object.location.represent = lambda location, row: \ >A(location,_href=URL('location', 'update', args=(location.id), > user_signature=True)) > In the above line, you have specified your own "represent" attribute for the "location" field, so it will not use the "format" attribu

[web2py] No models vs. conditional models -- what's the advantage?

2012-03-08 Thread Cliff
Certainly we want to avoid processing unnecessary table definitions with every request. It seems to me that the simplest solution is something like this: if request.controller=='foo': db.define_table('foo', Field...) # main table db.define_table('foo_one_to_many', Field(foo_id, db.foo...)...)

Re: [web2py] Web2py + uWSGI and timeouts!!

2012-03-08 Thread Roberto De Ioris
> Hello > > I am testing web2py with uWSGI and some request have random timeout (after > IO Heavy operation is started , but it is spawned using > subprocess.Popen()) > And then progress is selected from DB Every 5 Seconds (Progress Percent > Insert,Commit to db is only done at each 5% intervals)

[web2py] Re: how to access auth.is_logged_in() from modules?

2012-03-08 Thread Anthony
> > I have a lot of tables. I split them up among multiple model files to > help with organization. My app is highly dynamic and data are changing > in all the tables constantly. If I understand it correctly, putting > the tables in modules and setting track_changes(False) would mean the > tab

[web2py] Re: Migration on Datastore

2012-03-08 Thread David Phillips
Yes, that worked. Thanks for the suggestion, Massima. On Mar 7, 5:12 pm, Massimo Di Pierro wrote: > can you try Field('description', 'text', length = 2048), > > > > > > > > On Wednesday, 7 March 2012 15:48:51 UTC-6, David Phillips wrote: > > > I have an App Engine web app in production. I defined

[web2py] CRUD .represent question #2

2012-03-08 Thread Gian Luca Decurtins
Hi all A crud.select on the object-table does only display the ID of the corresponding location, and not as expected ( '%(id)s: %(country)s, %(city)s, %(street)s, %(name)s' ). What is wrong here? Do I have to restart the webserver if I change the format part of define_table? Cheers -Luca. db.

[web2py] query using groupby and distinct count

2012-03-08 Thread Fabiano Faver
I`m trying to select distinct printers used in each day but i`m not managing to use the distinct argument count = db.contadores.id_impressora.count() for row in db((db.contadores.id>0)&(db.contadores.data<=today)).select(db.contadores.data,count,groupby=db.contadores.data): print row.con

Re: [web2py] Re: The Winners! Web2py Application Exhibition Version 3.0

2012-03-08 Thread Phyo Arkar
Thank you very much Mr NetAdmin! Can you donate 20$ from my Prize money to web2py project please! Thanks ! On Thu, Mar 8, 2012 at 2:19 AM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > Congratulations. Excellent work! And Thanks to Mr. Admin for organizing >> the competition. > >

[web2py] Web2py + uWSGI and timeouts!!

2012-03-08 Thread Phyo Arkar
Hello I am testing web2py with uWSGI and some request have random timeout (after IO Heavy operation is started , but it is spawned using subprocess.Popen()) And then progress is selected from DB Every 5 Seconds (Progress Percent Insert,Commit to db is only done at each 5% intervals) At the IO Heav

[web2py] ImportError, after making 1.99.4 -> 1.99.7 -> 1.99.4

2012-03-08 Thread Jose
I upgraded to 1.99.7, but errors occurred when connecting to the database. Then I went back to 1.99.4 and now I have more than 100 errors Traceback (most recent call last): File "/home/web2py/gluon/restricted.py", line 194, in restricted in code it raises a RestrictedError containing the

Re: [web2py] YASQ 2 (yet another smartgrid question)

2012-03-08 Thread Martin Weissenboeck
Great! I have spent some hours looking for a solution - now it could be done in one line. Thank you VERY MUCH. I think these great features should be well documented. 2012/3/7 Johann Spies > On 7 March 2012 15:59, Martin Weissenboeck wrote: > >> Hi, >> I have a smartgrid-table with a lot of pe

Re: [web2py] Re: Help with Cherokee, uwsgi in application with many uploads

2012-03-08 Thread Jose
El jueves 8 de marzo de 2012 05:04:36 UTC-3, Phyo Arkar escribió: > > You set timeout to 120 secs : > 120 > 120 > > is that what you expected ? > > All right. The question is so slow, with very small files. There is > something in the settings that you can play to improve performance? > > Ad

[web2py] Re: How to display reference field in sqltable?

2012-03-08 Thread Alan Etkin
This should tell web2py to display the name instead of the id in references db.define_table('account', ..., format='%(name)s') You can find more info in the book's chapter 6.5, "Record representation" On 7 mar, 20:52, Edward Shave wrote: > *I have the following table definition...* > * > * > *d

[web2py] Re: twitter Bootstrap + web2py Poll

2012-03-08 Thread peter
This sounds great. Could you give a little more info on how to combine the two repositories Thanks Peter On Mar 8, 10:26 am, Martín Mulone wrote: > I'm working adapting grid to bootstrap 2.0. > > Base app:  https://bitbucket.org/mulonemartin/bootstrap > Web2py patch:  https://github.com/mulonemar

Re: [web2py] response.menu with bootstrap dropdown menu

2012-03-08 Thread Martín Mulone
The menu helper (web2py) is not compatible with twitter bootstrap menu. 2012/3/7 Paolo > Hi all, > I have a simple problem that I haven't solved yet. Using the twitter > bootstrap theme I am not able to create a dropdown menu playing with the > MENU helper. According to [1], an anchor to create

Re: [web2py] bug? -- commented for loop

2012-03-08 Thread Bruno Rocha
thats not a bug, thats the behavior of template system. You can have comments only as first character on a line. allowed {{#comment}} disallowed {{=foo # this will print foo }} as far as I remember, if I am not wrong... this has a good purpose and it is related of the literal '#' character. y

[web2py] Re: appadmin ticket

2012-03-08 Thread weheh
Pretty standard stuff: # Eclipse if False: request = current.request session = current.session response = current.response T = current.t cache = current.cache from gluon.tools import * db = DAL('postgres://.', pool_size=20) auth = Auth(globals(), db) mail = Mail(globals()

[web2py] bug? -- commented for loop

2012-03-08 Thread weheh
this works when placed inside a view: {{ def myfunc(rows): text=[] for x in rows: text.append(...stuff...) pass pass }} this gets ticketed when inside a view: {{ def myfunc(rows): text=[] for x in rows: # AN INNOCENT COMMENT THAT CAUSES TICKET text.append(...s

[web2py] Re: @auth.requires_membership(VCARD or ROOT)

2012-03-08 Thread Annet
Hi Bruno, Thanks for your reply. Kind regards, Annet

Re: [web2py] @auth.requires_membership(VCARD or ROOT)

2012-03-08 Thread Bruno Rocha
I always use this way: @auth,requires(auth.has_membership('vcard') or auth.has_membership('root') or auth.has_membership('other')) def action(): . @auth.requires_membership does not support a list of conditions. On Thu, Mar 8, 2012 at 5:19 AM, Annet wrote: > In a controller I decorate

[web2py] @auth.requires_membership(VCARD or ROOT)

2012-03-08 Thread Annet
In a controller I decorate functions like this: @auth.requires_membership(VCARD or ROOT) so far I didn't get any error. Is this the correct syntax to allow more than one group of users to access a function? Kind regards, Annet

  1   2   >