[web2py] DAL / connection pool leaking objects?

2012-03-22 Thread nick name
In one of my management scripts (which runs continuously, after setting up a web2py environment), I copy a complete sqlite database directory from another server (copied_db.sqlite, and *.table), open them with "DAL('sqlite://copiedfile.sqlite', auto_import=True, path='/tmp/copy_path)". I copy t

[web2py] bug in auth -- reset_password_onaccept doesn't exist ...

2012-03-22 Thread weheh
I'm doing some more of this modal stuff for my login/password routines and ran into this problem. Probably an oversight in the code (lots of moving parts there!) Traceback (most recent call last): File "N:\web2py\gluon\restricted.py", line 204, in restricted exec ccode in environment File

Re: [web2py] Getting started in Web2py

2012-03-22 Thread Bruno Rocha
You can use eclipse to develop your web2py apps and avoid the alt+tab problem. If you really like the "IDE experience" I suggest you to try wingIDE. Also you can just use a terminal with emacs, VI or whatever you like to work. No need to even open the web admin interface. The documentation, at a

[web2py] Re: auth.login() from inside a component in a dialog

2012-03-22 Thread weheh
Anthony, I tried your raise HTTP(200, response.render()) vs. my raise HTTP(200, SCRIPT(response.js)) I ran into a ticket complaining about my form not being defined, so I'm back to my SCRIPT(). Traceback (most recent call last): File "N:\web2py\gluon\restricted.py", line 204, in restric

[web2py] missing FROM-clause entry

2012-03-22 Thread Limedrop
Running Web2py 1.99.7 and using a model based on the wiki in the book (http://web2py.com/books/default/chapter/29/3#A-wiki). I want to report a unique list of comments for a particular webpage, for a particular tag (I've added a many-to-many tag table). I use a form to build a query, which ends u

[web2py] Getting started in Web2py

2012-03-22 Thread SeamusJP
Hi, I am developing a new project, new to python. Project is mainly for CRUD, display data on website, and easy management of back end. I started Djangobook and finished it, I felt like it was great and I could go in to eclipse, create my models, validate, and then make my forms on site..pretty

[web2py] Re: cross-domain auth

2012-03-22 Thread Carlos
I'm building a SaaS (Software as a Service) / cloud platform with multiple apps/services (websites being one of them). If you or anyone else can think of a solution to cross-domain cookies/auth, using the exact same sessions, please let me know. Thanks. On Thursday, March 22, 2012 8:28:35 PM

[web2py] Re: auth.login() from inside a component in a dialog

2012-03-22 Thread weheh
No, in fact it's not going anywhere in particular. I tried 200 then decided 303. Probably will return to 200. Thanks again. On Mar 23, 11:12 am, Anthony wrote: > > Thank you Anthony. You're my hero. Wasn't so hard after all. For those > > following, I did it by putting the response.js in myonacce

[web2py] Re: auth.login() from inside a component in a dialog

2012-03-22 Thread Anthony
> > Thank you Anthony. You're my hero. Wasn't so hard after all. For those > following, I did it by putting the response.js in myonaccept(form) > function and then, the last thing to do in that function is > > HTTP(303,SCRIPT(response.js)) > Typically, a 303 response would also set a "Locatio

[web2py] Re: auth.login() from inside a component in a dialog

2012-03-22 Thread Anthony
> > @anthony: actually, on closer inspection, the doc does go into some > details: > http://web2py.com/books/​default/chapter/29/4#HTTP-and-​redirect > > but I'm still experimenting with how to get it to execute a script. Someth

[web2py] auth.login() from inside a component in a dialog [closed]

2012-03-22 Thread weheh
.

[web2py] Re: auth.login() from inside a component in a dialog

2012-03-22 Thread weheh
Thank you Anthony. You're my hero. Wasn't so hard after all. For those following, I did it by putting the response.js in myonaccept(form) function and then, the last thing to do in that function is HTTP(303,SCRIPT(response.js)) That did the trick. @pbreit: After it's all said and done, I am more

Re: [web2py] Re: sqlite on production

2012-03-22 Thread Vasile Ermicioi
> > developers themselves say 'dont use it for sites that have 100k hits/day I disagree, look here http://www.sqlite.org/whentouse.html Generally speaking, any site that gets fewer than 100K hits/day should work fine with SQLite. The 100K hits/day figure is a conservative estimate, not a hard up

[web2py] Re: auth.login() from inside a component in a dialog

2012-03-22 Thread weheh
@anthony: actually, on closer inspection, the doc does go into some details: http://web2py.com/books/default/chapter/29/4#HTTP-and-redirect but I'm still experimenting with how to get it to execute a script.

[web2py] Re: cross-domain auth

2012-03-22 Thread Anthony
> > In summary, I need to have single-sign-on access across multiple websites, > each website optionally running with its own full domain (not sub-domain). > > A single web2py app is already taking care of everything, except the > cross-domain session/auth. > Got it. I'm just curious why it has

[web2py] Re: auth.login() from inside a component in a dialog

2012-03-22 Thread weheh
@anothony: I'm not sure how to do the raise HTTP() and get it to execute the response.js. I looked in the doc but it's pretty thin on the subject. I'm going to look at the source to get an idea of how web2py does it (I've always been curious about this), but in the mean time, if you could shed some

[web2py] Re: cross-domain auth

2012-03-22 Thread Carlos
Hi Anthony, In summary, I need to have single-sign-on access across multiple websites, each website optionally running with its own full domain (not sub-domain). A single web2py app is already taking care of everything, except the cross-domain session/auth. Thanks. On Thursday, March 22, 201

[web2py] Re: cross-domain auth

2012-03-22 Thread Anthony
I'm not sure if you can share a cookie across domains (though you can share across sub-domains). So, you have a single web2py app accessible via two different domains, and you want a given user to be logged into this single app but able to access it from either domain simultaneously? Can you ex

[web2py] Re: efficient DB queries

2012-03-22 Thread Anthony
> > i use: > > ids = [...generate your list of ids...] > > rows = db(db.board.id.belongs(ids[0:​30]).select() > for i in range(30,len(ids), 30): > rows & db(db.board.id.belongs(ids[i:​i+30]).select() > > so that gets me my "in" statement working with GAE's 30 items per in limit. > According to

[web2py] Re: efficient DB queries

2012-03-22 Thread howesc
i use: ids = [...generate your list of ids...] rows = db(db.board.id.belongs(ids[0:30]).select() for i in range(30,len(ids), 30): rows & db(db.board.id.belongs(ids[i:i+30]).select() so that gets me my "in" statement working with GAE's 30 items per in limit. On Wednesday, March 21, 2012 10:05:

[web2py] Re: Smarttable & SQLFORM.grid

2012-03-22 Thread greenpoise
Thanks..I thought I was in that chapter...Thanks again..will try the examples. d On Thursday, 22 March 2012 16:15:23 UTC-7, Alan Etkin wrote: > > I think you mean SQLFORM.smartgrid. > > Book's 7.8 section (the features are explained there): > > "... > A SQLFORM.smartgrid looks a lot like a

[web2py] Re: Smarttable & SQLFORM.grid

2012-03-22 Thread Alan Etkin
I think you mean SQLFORM.smartgrid. Book's 7.8 section (the features are explained there): "... A SQLFORM.smartgrid looks a lot like a grid, in fact it contains a grid but it is designed to take as input not a query but only one table and to browse said table and selected referencing tables. ..."

[web2py] Re: exceptions in modules

2012-03-22 Thread Ed Greenberg
I have to point out that my line except CustomException.CustomException: was earlier just except CustomException: The first version was an attempt during testing, and was accidentally pasted into the message. I've also tried except CustomException as e: and except CustomException, (

[web2py] exceptions in modules

2012-03-22 Thread Ed Greenberg
I have some modules that I've written, called from a Web2Py controller. I use this: class CustomException(Exception): def __init__(self, errno, strerror): self.errno = errno self.strerror = strerror def __str__(self): return repr(str(self.errno)+"-"+self.strerror) Down

[web2py] Re: Modules: how to access db

2012-03-22 Thread Dave Cole
I just ran into this problem too and decided to solve it like this: in my controller: from gluon import current a_module = local_import('a_module') def a_function(): a_module.something_cool(auth, current) The db connection is available as auth.db, and the request, session, and response ar

[web2py] Re: cross-domain auth

2012-03-22 Thread Carlos
Thanks Anthony. If I visit mydomain1.com and mydomain2.com (both pointing to the same web2py app) from the same browser, will both get the exact same session id cookie?. Aside from CAS, is there any other way (web2py / javascript) that both domains share the same session cookie?. Thanks again

Re: [web2py] Re: Systems Management Web App for Ubuntu

2012-03-22 Thread Eduardo Bergavera
Hi Stodge, Thank for your reply. The tool is somewhat designed to manage and provision cloud servers. However, the project encourages collaborative development at this moment rather than making use of it. Thanks again. On Thu, Mar 22, 2012 at 9:46 PM, Stodge wrote: > Does this share any function

[web2py] Re: creating relationship between two tables

2012-03-22 Thread Anthony
On Thursday, March 22, 2012 6:27:03 PM UTC-4, Derek wrote: > > Well, it appears to have been caused by me manually deleting the tables in > the database, hoping that web2py will recreate them. Apparently, web2py > does not know if the tables exist or not, and assumes that they do, since > it has

[web2py] Re: Validating Registration fields

2012-03-22 Thread Anthony
On Thursday, March 22, 2012 6:09:25 PM UTC-4, Peter G. wrote: > > I'm using the auth.settengs.extra_fields to add an extra upload field for > the user to upload an avatar, how can I add an IS_IMAGE validator to the > upload field so that the user can't upload random files? When you define the f

[web2py] Re: creating relationship between two tables

2012-03-22 Thread Derek
Well, it appears to have been caused by me manually deleting the tables in the database, hoping that web2py will recreate them. Apparently, web2py does not know if the tables exist or not, and assumes that they do, since it has a log that it created the tables in the first place. That's why I g

[web2py] Re: infinite loop with form.process().accepted

2012-03-22 Thread Anthony
> >if form.process().accepted: >i = form.vars.nmbreinvit >invitsgenere = generate_invitation(i) > Try: invitsgenere = generate_invitation(int(i)) In your form, the submitted value is stored as a string, and as a string it will always evaluate to > i in your generate_invitat

[web2py] Re: featured web2py apps

2012-03-22 Thread selecta
I know pyMantis would need some clean up but it has some really nice an unique features http://pymantis.org/ source: https://sourceforge.net/scm/?type=hg&group_id=304012 On Thursday, September 22, 2011 8:52:05 PM UTC+2, Massimo Di Pierro wrote: > > I think we should make a list of featured web2p

[web2py] Smarttable & SQLFORM.grid

2012-03-22 Thread greenpoise
Are these two equivalents?? I remember using smartables at some point. What I liked about it was the search feature without having to press any button to search for my text within a table. Does SQLFORM.grid provides something similar?? Thanks d

[web2py] Re: creating relationship between two tables

2012-03-22 Thread Derek
Yeah, I know. Baffles me. Here's the traceback. I guess I'll go open an issue. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. Traceback (most recent call last): File "C:\Temp\web2py\gluon\restricted.py", line 204, in restricted exec ccode in environment File "C:/Temp/web2py/ap

[web2py] Validating Registration fields

2012-03-22 Thread Peter G.
I'm using the auth.settengs.extra_fields to add an extra upload field for the user to upload an avatar, how can I add an IS_IMAGE validator to the upload field so that the user can't upload random files? Also, how would I add an IS_ALPHANUMERIC to the built in First name and Last name form fiel

[web2py] Re: creating relationship between two tables

2012-03-22 Thread Anthony
> > I'll try adding the format to see if that helps. I was using 'database >>> administration' so maybe it's not using a SQLFORM there. >> >> Yes, appadmin uses SQLFORM and should show the dropdown as well (but only if the referenced table has a format specified or you add the validator manual

[web2py] infinite loop with form.process().accepted

2012-03-22 Thread bussiere adrien
i don't understand : def generate_invitation(number,word=4,num=1,numdigit=5): code = [ ['BELCHER', 'FIX', 'EEL', 'PANZERBOY', 'DESK_JOCKEY', 'CHILLED', 'ENFORCER', 'CHERRY_PICKING', 'COUNTRY_CLUB', 'BOMBSHELL', 'PLUGGED_IN', 'FINI', 'LEGIT', 'JAM', 'BONED_OUT', 'BLADE', 'ROUST', 'SAMURAI', 'D

[web2py] Re: creating relationship between two tables

2012-03-22 Thread Derek
On Thursday, March 22, 2012 2:08:06 PM UTC-7, Anthony wrote: > > Yes, it works on sqlite, it doesn't seem to enforce the reference, it >> asked me to manually type the reference, and when i put in something >> invalid, it put it as a zero instead of giving me an error in the form. >> According

Re: [web2py] Re: sqlite on production

2012-03-22 Thread Derek
It doesn't scale in the sense that you can't cluster sqlite, it writes everything in a single file, and the developers themselves say 'dont use it for sites that have 100k hits/day'. On Wednesday, March 21, 2012 1:06:38 PM UTC-7, Vasile Ermicioi wrote: > > > > >> It is not recommended. All updat

[web2py] Re: creating relationship between two tables

2012-03-22 Thread Anthony
> > Yes, it works on sqlite, it doesn't seem to enforce the reference, it > asked me to manually type the reference, and when i put in something > invalid, it put it as a zero instead of giving me an error in the form. > According to the web2py documentation, this should be the default: > > ref

[web2py] Re: SQLForm text and newlines

2012-03-22 Thread Brian F
That worked perfectly. Thanks! On Thursday, March 22, 2012 3:06:37 PM UTC-4, Anthony wrote: > > Something like: > > db.mytable.myfield.default = 'some\ntext\nwith\nline\​nbreaks' > db.mytable.myfield.represent = lambda v, r: XML(v.replace('\n', '')) > db.mytable.myfield.writable = False > > With w

[web2py] Re: How to upload tables with images ?

2012-03-22 Thread Derek
Ah, that's what I love about web2py and python - things like this are not too difficult to accomplish, especially since a lot of it is built into the standard libraries. , On Thursday, March 22, 2012 11:19:16 AM UTC-7, LeMogwaï wrote: > > Thank you Anthony, you helped me for the first step. > >

[web2py] Re: creating relationship between two tables

2012-03-22 Thread Derek
Yes, it works on sqlite, it doesn't seem to enforce the reference, it asked me to manually type the reference, and when i put in something invalid, it put it as a zero instead of giving me an error in the form. According to the web2py documentation, this should be the default: reference IS_IN_D

[web2py] Re: SQLForm text and newlines

2012-03-22 Thread Anthony
Something like: db.mytable.myfield.default = 'some\ntext\nwith\nline\nbreaks' db.mytable.myfield.represent = lambda v, r: XML(v.replace('\n', '')) db.mytable.myfield.writable = False With writable=False, no value will actually be submitted with the form -- the default value will simply be insert

[web2py] Re: cross-domain auth

2012-03-22 Thread Anthony
Have you looked into using CAS (http://web2py.com/books/default/chapter/29/9#Central-Authentication-Service)? On Thursday, March 22, 2012 2:16:42 PM UTC-4, Carlos wrote: > > Hi, > > I'm wondering if it's possible to have cross-domain auth in web2py > (different domains pointing to the same web2p

[web2py] Re: How to upload tables with images ?

2012-03-22 Thread Anthony
Looks like you're on the right track. On Thursday, March 22, 2012 2:19:16 PM UTC-4, LeMogwaï wrote: > > Thank you Anthony, you helped me for the first step. > > I found the SQLFORM.factory concept and together with your info, I've been > able to get my file and start to process it. > > Now, here

[web2py] Re: efficient DB queries

2012-03-22 Thread Wikus van de Merwe
This is not the best way. It will run a separate query for each board id. On GAE you want to do as much as you can in a single query. So the best way is to construct a list of GAE keys and get all entities together. Unfortunately, AFAIK, there is no support for GAE batch queries in DAL. You can,

[web2py] Re: How to upload tables with images ?

2012-03-22 Thread LeMogwaï
Thank you Anthony, you helped me for the first step. I found the SQLFORM.factory concept and together with your info, I've been able to get my file and start to process it. Now, here is how my action looks like: @auth.requires_login() def dbimport(): result = "Please, upload a packed databa

[web2py] cross-domain auth

2012-03-22 Thread Carlos
Hi, I'm wondering if it's possible to have cross-domain auth in web2py (different domains pointing to the same web2py app and sharing the same cookie)?. I believe this is not possible because cookies (web2py's session cookie) can not be shared across domains, correct?. Or is there some kind o

[web2py] Re: auth.login() from inside a component in a dialog

2012-03-22 Thread pbreit
Why waste so much time and energy overcomplicating something that works perfectly out-of-the-box? 99% of projects do not benefit from a modal login. Modal log-ins can actually be worse since they don't always work everywhere and they don't always have a unique URL where you can send people. S

[web2py] Re: zip xls file and return it in response

2012-03-22 Thread Derek
http://docs.python.org/library/zipfile.html It's part of the python standard library. On Thursday, March 22, 2012 6:03:41 AM UTC-7, Neveen Adel wrote: > > Hello, > > Am generating xls file using the following code: > response.headers['Content-​Type'] = > gluon.contenttype.contenttype(​'.

[web2py] Re: creating relationship between two tables

2012-03-22 Thread Anthony
> > Well, it is trying to create the contacts table before it creates the > customers table. That's the problem. I don't know if that's an issue in the > DAL or if I just need to re-arrange the statements in my db.py - they are > correctly ordered in the db.py - it seems that it wants to create

[web2py] SQLForm text and newlines

2012-03-22 Thread Brian F
I am prefilling a field in an SQLForm, but there are other fields that the user will fill out. The text I am prefilling I would like to display, but not allow the user to edit it. I am setting the writable to false, but the problem is the text I am filling with has multiple lines all separated b

[web2py] Re: creating relationship between two tables

2012-03-22 Thread Derek
Well, it is trying to create the contacts table before it creates the customers table. That's the problem. I don't know if that's an issue in the DAL or if I just need to re-arrange the statements in my db.py - they are correctly ordered in the db.py - it seems that it wants to create the assoc

[web2py] Re: Modify T() function

2012-03-22 Thread Anthony
> > Just a simpler idea : as the language file is a python dictionary, why > not put the comment in a python comment? > > "source string": "target string", #comment > It sounds like he wants to be able to specify the comment in the application code where T() is called -- e.g., T('my string',

[web2py] Re: Conditional Fields

2012-03-22 Thread Wikus van de Merwe
There are two separated things here. One is presentation of required attributes only, the other is validation of the from. The first one could be solved with the "conditional field" approach described in the book. If you are not sure what are the ids for generated form elements, simply view the g

[web2py] Re: SQLForm.grid : how to change the way column are rendered

2012-03-22 Thread sebsto
Thanks for your quick answer. I figure it out just right now, here is my. It's working as expected !! def formatFlag(value): if value == 1: icon = 'msg_received' elif value ==0: icon = 'msg_sent' return IMG(_src=URL('static', 'images/%s.png' % i

Re: [web2py] Re: Conditional Fields

2012-03-22 Thread Richard Vézina
Ok, if I am understanding correctly you want a complex validation. I mean validating a field base on the input of an other field. Default web2py validator are applying only to one field at a time. It is possible to do what you ask for, but it will require that you implement your own validator. You

[web2py] Re: SQLForm.grid : how to change the way column are rendered

2012-03-22 Thread Wikus van de Merwe
You can use a format string to define the data representation, read this: http://web2py.com/books/default/chapter/29/6#Record-representation To get the icons, instead of a format string, pass a function that generates the required HTML code.

[web2py] Re: Modify T() function

2012-03-22 Thread Cédric Mayer
Just a simpler idea : as the language file is a python dictionary, why not put the comment in a python comment? "source string": "target string", #comment Cedric On 22 mar, 15:53, Anthony wrote: > > I am working on a translation enhancement project on sahana-eden[1]. > > sahana-eden uses the tr

[web2py] Re: How do I group the list by value and make it table in HTML?

2012-03-22 Thread Wikus van de Merwe
You can simply loop over a sorted list (first by the state, then by name): city_list = [('Huntsville', 'AL'), ('Decatur', 'AL'), ('Anchorage', 'NV'), ('Nome', 'AK'),('Selma', 'AL'), ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ')] sorted_list = sorted(city_list, key=lambda x: (x[1],[0])

[web2py] Re: Book translation

2012-03-22 Thread Miguel
Count on me to translate the book to Spanish! -- Miguel On Tuesday, December 27, 2011 6:03:31 PM UTC+2, Mirek Zvolský wrote: > > I want start translation of the book 4th edition (czech language). > Can I read somewhere hints, how to do it? > Idea: Can we have menu item in web2py.com/book (Transl

Re: [web2py] Re: [video] websockets com web2py e tornado

2012-03-22 Thread Richard Vézina
Thank you Bruno! Richard On Thu, Mar 22, 2012 at 8:25 AM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > +1 > > > On Thursday, 22 March 2012 05:23:17 UTC-5, Ramos wrote: > >> I disaggree. >> >> I´m portuguese and Bruno is perfect explaining websockets in web2py! >> Add english subtitle

[web2py] SQLForm.grid : how to change the way column are rendered

2012-03-22 Thread sebsto
Hello, I just discovered SQLForm.grid ! Waow, geat job !! I'd like to customize some columns in the generated table. Example use case : - Use the pretty date formatting instead of displaying the raw date ("yesterday", etc ...) - Use an icon instead of a status flag. Is it possible ? How to

[web2py] Re: How to get pound sign in url or work around it?

2012-03-22 Thread Chris May
I might have missed something. Are you trying to move the viewport to the element with the id after the hash? If so, would you be able to use: document.location.hash = "tabs=2"; Does that work? On Wednesday, March 21, 2012 5:39:08 PM UTC-4, Cliff wrote: > > Thanks, Jonathan. I appreciate th

[web2py] Re: How to upload tables with images ?

2012-03-22 Thread Anthony
Upon submission of the form, you should find the file itself in request.vars.f_photo.file (and the filename in request.vars.f_photo.filename). Anthony On Thursday, March 22, 2012 9:11:10 AM UTC-4, LeMogwaï wrote: > > Greetings, > > I'm starting with web2py and it seems to be the right tool I ne

[web2py] Re: Modify T() function

2012-03-22 Thread Anthony
> > I am working on a translation enhancement project on sahana-eden[1]. > sahana-eden uses the translation feature of web2py. Is it possible to have > a modified T() function so that the developer can leave a comment for the > translator, for example T("This is a SAMPLE", "keep SAMPLE as it is

[web2py] How to upload tables with images ?

2012-03-22 Thread LeMogwaï
Greetings, I'm starting with web2py and it seems to be the right tool I need for my project. My point is to upload a zip file to update or fill in a database (several tables) including pictures. This will be a feature of my application and (auth) users will be allowed to use this feature. Her

[web2py] Modify T() function

2012-03-22 Thread Kalpa Welivitigoda
Hi, I am working on a translation enhancement project on sahana-eden[1]. sahana-eden uses the translation feature of web2py. Is it possible to have a modified T() function so that the developer can leave a comment for the translator, for example T("This is a SAMPLE", "keep SAMPLE as it is") whe

[web2py] Re: auth.login() from inside a component in a dialog

2012-03-22 Thread tsvim
I think this actually is a bug. I haven't looked at it more, but I changed my default controller/function to home/index When I login (regular login except for the following lines in my model) it returns me to default/index (my old controller still exists there until I finished refactoring the co

[web2py] Re: Systems Management Web App for Ubuntu

2012-03-22 Thread Stodge
Does this share any functionality with: http://cloudsilverlining.org/ Cheers On Mar 22, 8:43 am, Eduardo Bergavera wrote: > Hi Everyone! > > I would like to ask some guidance regarding anyone who may be > interested in developing web-based python app for systems management > in Ubuntu. The web-a

[web2py] Systems Management Web App for Ubuntu

2012-03-22 Thread Eduardo Bergavera
Hi Everyone! I would like to ask some guidance regarding anyone who may be interested in developing web-based python app for systems management in Ubuntu. The web-app acts as centralized interface to manage cloud based or physical Ubuntu servers in one location. I'd like it to be developed using w

[web2py] Re: SQLFORM & deletable=True -- buggy behavior

2012-03-22 Thread Anthony
> > No, I'm only using the web2py_trap_form out of the cookbook. The rest > of the web2py_ajax.js file is the same. > If the name of the file is web2py_ajax.js, it's probably old -- it was changed to web2py.js quite a while ago. Anthony

[web2py] Re: auth.login() from inside a component in a dialog

2012-03-22 Thread Anthony
> > When the browser receives a redirect response, it immediately issues the > redirect request without further processing the XHR object, so the > client-side web2py JS code never gets to process the > web2py-component-command header. > Note, this is not a web2py issue -- this is how XHR work

[web2py] Re: auth.login() from inside a component in a dialog

2012-03-22 Thread Anthony
> > > I believe auth.settings.login_next only has an effect when there is no > > session._auth_next (i.e., when the user goes directly to the login URL > > rather than getting there via an internal link or redirect). > > Your logic is sound, but I'm afraid this is not the case. I am > directly

[web2py] Re: using janrain and normal registration

2012-03-22 Thread Hassan Alnatour
its not redirecting at all and i changed the URL to URL('default', 'user', args='profile') but still nothing is happening ,, what to do ??!

[web2py] Re: using janrain and normal registration

2012-03-22 Thread Anthony
> > if auth.user and not auth.user.complete_registration: > if not (request.controller,request.function) == > ('default','user'): > redirect(URL('default','user/profile')) > Are you getting an error, or is it just not redirecting at all? In either case, change the URL call to URL

[web2py] Re: auth.login() from inside a component in a dialog

2012-03-22 Thread weheh
Hi Anthony, again, many thanks for your valuable contributions to this group. > I believe auth.settings.login_next only has an effect when there is no > session._auth_next (i.e., when the user goes directly to the login URL > rather than getting there via an internal link or redirect). Your logic

Re: [web2py] Re: Package max file size

2012-03-22 Thread Marco Tulio Cicero de M. Porto
Could it be a limitation on the "max file size" on apache then? I saw something similar on Nginx (had to manually add on the config file a configuration with the maximum file size). Thanks for the atention, Marco Tulio 2012/3/22 Massimo Di Pierro > They are tar gzipped files. I do not know if

[web2py] Re: creating relationship between two tables

2012-03-22 Thread Anthony
> > I've seen both, and I think that the second doesn't make a foreign key > constraint, it just creates an int field... not sure though. Field('customer', 'reference customers') and Field('customer', db.customers) are equivalent (behind the scenes, when you do type=db.customers, it is conver

[web2py] Re: using janrain and normal registration

2012-03-22 Thread Hassan Alnatour
It works but now when anyone registers with janrain his data is messing so i used this code but its not redirecting : auth.settings.extra_fields['auth_user']= [ Field('Country'), Field('City'), Field('gender',requires=IS_IN_SET(genders,zero=None)), Field('complete_registration',default=

[web2py] zip xls file and return it in response

2012-03-22 Thread Neveen Adel
Hello, Am generating xls file using the following code: response.headers['Content-Type'] = gluon.contenttype.contenttype('.xls') response.headers['Content-disposition'] = 'attachment; filename=file.xls' today = str(datetime.today()) wbk.save("temp1"+today+".xls") f = ope

[web2py] Re: creating relationship between two tables

2012-03-22 Thread Anthony
> > I think it needs to be 'reference db.customers' 'reference customers' is the correct syntax (it assumes the "customers" table is in the same db, so no need to include "db."). Anthony

[web2py] Re: auth.login() from inside a component in a dialog

2012-03-22 Thread Anthony
> > First, I ran into the problem I describe in another thread, which is > that I'm forced to do this: > > session._auth_next = auth.settings.login_next = URL(c='user', > f='login') > > because otherwise, session._auth_next will drive me to the default > index. > I believe auth.settings.logi

[web2py] Re: using janrain and normal registration

2012-03-22 Thread Anthony
> > auth.settings.login_form = ExtendedLoginForm(request,auth, other_form) > Looks like the book is not up-to-date -- if you're using the current web2py, I think the above should be: auth.settings.login_form = ExtendedLoginForm(auth, other_form) Anthony

Re: [web2py] Re: [video] websockets com web2py e tornado

2012-03-22 Thread Massimo Di Pierro
+1 On Thursday, 22 March 2012 05:23:17 UTC-5, Ramos wrote: > > I disaggree. > > I´m portuguese and Bruno is perfect explaining websockets in web2py! > Add english subtitles!!! > > > > Sorry, this is in Portuguese and should go only to Brazilian groups... >> >> >> >> On Thu, Mar 22, 2012 at 5:10 A

[web2py] Re: Online book is down (producing internal error)

2012-03-22 Thread Anthony
Yes, the problem was brief.

[web2py] using janrain and normal registration

2012-03-22 Thread Hassan Alnatour
Dear ALL , i want to use janrain and normal registration at the same time so i did this : from gluon.contrib.login_methods.rpx_account import RPXAccount url = "http://localhost:8000/%s/default/user/login"; % request.application from gluon.contrib.login_methods.extended_login_form import Extende

Re: [web2py] Re: [video] websockets com web2py e tornado

2012-03-22 Thread António Ramos
I disaggree. I´m portuguese and Bruno is perfect explaining websockets in web2py! Add english subtitles!!! 2012/3/22 Bruno Rocha > Sorry, this is in Portuguese and should go only to Brazilian groups... > > > > On Thu, Mar 22, 2012 at 5:10 AM, Bruno Rocha wrote: > >> >> *Curso De Python .c

[web2py] Re: The python brochure

2012-03-22 Thread Massimo Di Pierro
I know about it but I did not see it. I believe it is framework agnostic. Yet we should look at it. We should make our own brochures perhaps. On Thursday, 22 March 2012 04:24:23 UTC-5, mcm wrote: > > Hello Massimo, > > http://brochure.getpython.info/ > > > do you know anything about it? should

[web2py] Re: Environment variable LD_LIBRARY_PATH

2012-03-22 Thread Massimo Di Pierro
try: import os os.environ['LD_LIBRARY_PATH'] = '' On Wednesday, 21 March 2012 14:10:57 UTC-5, surfnet3 wrote: > > How can I set the environment variable LD_LIBRARY_PATH for web2py?

[web2py] Re: Online book is down (producing internal error)

2012-03-22 Thread Massimo Di Pierro
> > Seems to work now. >

[web2py] Re: Package max file size

2012-03-22 Thread Massimo Di Pierro
They are tar gzipped files. I do not know if there is a limit. If there is a very large. On Wednesday, 21 March 2012 09:20:12 UTC-5, Marco Tulio wrote: > > Hi, > > Packages are a really cool feature. > They allow you to backup your application (including all the tables, > views, controllers, a

Re: [web2py] Re: DAL or SQL?

2012-03-22 Thread Niphlod
""" In my original posting, I said: "the periods table has id, date, start_time, end_time (and other fields)". I suppose I assumed that the presence of a 'date' field implied that the *_time fields were indeed of type time, but I'm sorry if that wasn't clear. """ my point was: my model implied da

Re: [web2py] Re: DAL or SQL?

2012-03-22 Thread Keith Edmunds
> Perhaps you could add the seconds as a virtual lazy field. That sounds worth investigating, thanks. > We shall come to an agreement when you explain plainly what is your real > model... it seems that your start and end columns are "time" and not > "datetime"... Time fields don't have a "seconds

[web2py] Re: [video] websockets com web2py e tornado

2012-03-22 Thread Bruno Rocha
Sorry, this is in Portuguese and should go only to Brazilian groups... On Thu, Mar 22, 2012 at 5:10 AM, Bruno Rocha wrote: > > *Curso De Python .com.br > * > > websockets com tornado, web2py, Python, jQuery, > > [image: websockets com tornado, web2py, Python,

[web2py] auth.login() from inside a component in a dialog

2012-03-22 Thread weheh
I'm trying to do the modal login thing. I'm LOADing the auth login form into a div, which is id'd as a dialog for jquery ui. Should be a snap, right? Wrong. It's not working at all. First, I ran into the problem I describe in another thread, which is that I'm forced to do this: session._auth_next

Re: [web2py] Re: DAL or SQL?

2012-03-22 Thread Niphlod
We shall come to an agreement when you explain plainly what is your real model... it seems that your start and end columns are "time" and not "datetime"... Time fields don't have a "seconds()" method, only datetime!

[web2py] Re: SQLFORM & deletable=True -- buggy behavior

2012-03-22 Thread weheh
No, I'm only using the web2py_trap_form out of the cookbook. The rest of the web2py_ajax.js file is the same. I'll check out the latest web2py.js later today. On Mar 22, 2:12 pm, Anthony wrote: > Are you using the entire web2py_ajax.js file from the cookbook? If so, much > of it is out of date a

[web2py] Re: open web2py it self when deployed

2012-03-22 Thread Derek
yes, deployed it's not a good idea, but for a development server, it can work. On Tuesday, March 20, 2012 9:02:07 PM UTC-7, Anthony wrote: > > On Tuesday, March 20, 2012 7:23:15 PM UTC-4, Derek wrote: >> >> Comment out these two lines... >> >> #elif (remote_addr not in hosts) and (remote_addr !=

  1   2   >