[web2py] Re: web2py hosting
fluxflex has gone away. We had an app hosted there. June 30th 2012 was their last day of operation. On Wednesday, September 14, 2011 4:10:53 AM UTC+5:30, monotasker wrote: I've been working on fluxflex for a couple of weeks now and really like it. There are a couple of odd things, though, about the automated deployment of web2py. The biggest is that I can't seem to get at my files! Fluxflex doesn't support ftp--only git--for uploading and downloading files. That would be fine, except that when I clone my git directory at fluxflex all that is downloaded is: icon.png README.md tmp_db_pw and an empty public_html folder Unfortunately I've also found that the support at fluxflex leaves something to be desired--usually several days for a response. So does anyone know what would be going on here? Why are my fluxflex files not in the git import? Ian --
[web2py] Re: web2py 2.0 almost done
Should it not, as a matter of principle, try to maintain mutual accuracy of data? Or at least give the option do so. So, if the same data is updated where-ever, the system should aim for a cascade update, or the next best thing to that. -- Luc. On Wednesday, 8 August 2012 22:17:17 UTC+1, Massimo Di Pierro wrote: more issues have been addressed. In order to fix an issue I had to introduce a slight change of behavior and I am not sure what is the best way to handle it. If you login using a third party service (for example janrain using facebook) and the service sends info about you, if web2py has corresponding fields in auth_user, it stores them. If you edit your profile, logout, change your facebook profile, login again using janrain, should web2py keep the current local profile or update it? The bug report suggested that web2oy should always give preference to the local profile. I changed web2py accordingly. In practice this change will probably not affect anybody because none of the services sends any information stored by auth_user. Yet, please check it. Massimo On Monday, 6 August 2012 23:33:48 UTC-5, Massimo Di Pierro wrote: Web2py 2.0 is almost done. Please try the nightly build. Let us know if it breaks anything. massimo --
[web2py] Stream a couchdb attachment with web2py
Hello, I have some sound files in a couchdb database (not related to web2py). My web2py application has access to this database, and I want to stream the sound files so that they can be listened with the HTML audio tag, like this: audio src=http://www.myserver.com/.../track06.mp3; preload=auto/audio I am planning to do this streaming as follows: response.stream(open(filename),chunk_size=4096) But I have some open questions: 1. My filename is not in the local filesystem, but in a couchdb database, accessible via REST. How can I open that? 2. What kind of request will the audio tag send when it is activated, GET/POST/...? Can this be handled with web2py? Thanks, Daniel --
[web2py] Anybody run web2py apps on GAE in production?
Hi, If you run a web2py powered app on GAE in production, could you share your experiences? Is it very expensive for your needs? Are you OK with the pricing? How many instances do you run simultaneously on average? What kind of traffic do you get? How many requests per second do your apps serve? Do you use Datastore or Cloud SQL? Why? Would you recommend hosting web2py apps on GAE? Thanks! -- Alexei Vinidiktov --
Re: [web2py] Re: How do larger teams develop with Web2py?
Rocha, your post inspires me... On Thursday, August 9, 2012 9:44:38 AM UTC+8, Massimo Di Pierro wrote: LOL On Wednesday, 8 August 2012 20:17:33 UTC-5, rochacbruno wrote: That is how I am used to work: http://programming-motherfucker.com/ --
Re: [web2py] Redirect to requested function
Hi Jonathan, Thanks for your reply. If you can identify your front-end functions, why not just rewrite request.{controller,function} here? if request.args(0) != session.id: request.controller = 'addressbook' request.function = 'router' Because the router determines, what function to redirect to based on a nodes account or the function which did the redirect. I'm not following your requirement here. args(0)!=session.id is your condition for redirecting to the router, right? Yes, in that case the requesting node is a different one then the node which data are stored in session, so these have to be reset. Kind regards, Annet --
[web2py] Re: web2py not reading Amazon SNS Subscription Confirmation requests?
Thanks Massimo! It worked. request.body.read() had the JSON. On Thursday, August 9, 2012 9:42:05 AM UTC+8, Massimo Di Pierro wrote: There is nothing in request.args because I assume the URL is called without args. There is nothing in request.vars because the request contains no HTTP variables. It is an HTTP post with a json data in the request body. HTTP does not know anything about json. Web2py has no clue or way to guess the request body contains json. It may as well be gibberish. Whoever created the protocol should have used a mime multipart content (which is how forms are submitted). Anyway, you can still email yourself: request.env # the headers and request.body.read() # the content of the body and you will get what you want. On Wednesday, 8 August 2012 19:55:49 UTC-5, Osman Masood wrote: Hi all, I'm trying to confirm an Amazon SNS subscription with a web2py controller action. The Amazon SNS subscription format is described herehttp://docs.amazonwebservices.com/sns/latest/gsg/SendMessageToHttp.html#SendMessageToHttp.confirm (through probably not necessary to understand this problem.) My controller action (default/amazon_sns_endpoint) basically just emails request.vars and request.args to myself. It receives a POST request from the subscription service. However, for some reason, it doesn't seem to be able to process the POST request, i.e. request.vars and request.args are always {} and []. (I do, however, get the email.) Maybe web2py messes up when it handles some of the headers? An example POST request looks like this: POST / HTTP/1.1 x-amz-sns-message-type: SubscriptionConfirmation x-amz-sns-message-id: 165545c9-2a5c-472c-8df2-7ff2be2b3b1b x-amz-sns-topic-arn: arn:aws:sns:us-east-1:123456789012:MyTopic x-amz-sns-subscription-arn: arn:aws:sns:us-east-1:123456789012:MyTopic:2bcfbf39-05c3-41de-beaa-fcfcc21c8f55 Content-Length: 1336 Content-Type: text/plain; charset=UTF-8 Host: example.com Connection: Keep-Alive User-Agent: Amazon Simple Notification Service Agent { Type : SubscriptionConfirmation, MessageId : 165545c9-2a5c-472c-8df2-7ff2be2b3b1b, Token : 2336412f37fb687f5d51e6e241d09c805a5a57b30d712f794cc5f6a988666d92768dd60a747ba6f3beb71854e285d6ad02428b09ceece29417f1f02d609c582afbacc99c583a916b9981dd2728f4ae6fdb82efd087cc3b7849e05798d2d2785c03b0879594eeac82c01f235d0e717736, TopicArn : arn:aws:sns:us-east-1:123456789012:MyTopic, Message : You have chosen to subscribe to the topic arn:aws:sns:us-east-1:123456789012:MyTopic.\nTo confirm the subscription, visit the SubscribeURL included in this message., SubscribeURL : https://sns.us-east-1.amazonaws.com/?Action=ConfirmSubscriptionTopicArn=arn:aws:sns:us-east-1:123456789012:MyTopicToken=2336412f37fb687f5d51e6e241d09c805a5a57b30d712f794cc5f6a988666d92768dd60a747ba6f3beb71854e285d6ad02428b09ceece29417f1f02d609c582afbacc99c583a916b9981dd2728f4ae6fdb82efd087cc3b7849e05798d2d2785c03b0879594eeac82c01f235d0e717736;, Timestamp : 2012-04-26T20:45:04.751Z, SignatureVersion : 1, Signature : skvXQIEpH+DcEwjAPg8O9mY8dReBSwksfg2S7WKQcikcNKWLQjwu6A4VbeS0QHVCkhRS7fUQvi2egU3N858fiTDN6bkkOxYDVrY0Ad8L10Hs3zH81mtnPk5uvvolIC1CXGu43obcgFxeL3khZl8IKvO61GWB6jI9b5+gLPoBc1Q=, SigningCertURL : https://sns.us-east-1.amazonaws.com/SimpleNotificationService-f3ecfb7224c7233fe7bb5f59f96de52f.pem; } --
Re: [web2py] Re: How do larger teams develop with Web2py?
That is how I am used to work: http://programming-**motherfucker.com/http://programming-motherfucker.com/ LOL Our ValuesThey Claim To ValueThey Really ValueWe Fucking DoIndividuals and interactions*Tons of billable hours**Programming, Motherfucker*Working software*Tons of pointless tests**Programming, Motherfucker*Customer collaboration*Bleeding clients dry**Programming, Motherfucker*Responding to change*Instability and plausible deniability**Programming, Motherfucker* We think the shit on the left, is really just the con in the middle, and that we really need to just do the thing on the right... Programming, Motherfucker. --
Re: [web2py] web2py 2.0 almost done
What about issues with rocket, is that fixed? (if I remember correctly it was about corruption of big-sized downloads) On Tue, Aug 7, 2012 at 6:33 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Web2py 2.0 is almost done. Please try the nightly build. Let us know if it breaks anything. massimo -- --
Re: [web2py] web2py 2.0 almost done
The corruption, as we could determine has to do with two issues: - SOCKET_TIMEOUT = 1 was too slow, we increased it to 10. - self.conn.sendall was timing out but socket.timeout was not being caught. Now it is. Since this fix we had no more reports of data corruption. Are there other problems that need fixing with rocket? Massimo On Thursday, 9 August 2012 08:17:57 UTC-5, Marin Pranjić wrote: What about issues with rocket, is that fixed? (if I remember correctly it was about corruption of big-sized downloads) On Tue, Aug 7, 2012 at 6:33 AM, Massimo Di Pierro massimo@gmail.comjavascript: wrote: Web2py 2.0 is almost done. Please try the nightly build. Let us know if it breaks anything. massimo -- --
[web2py] Re: web2py 2.0 almost done
Can you help us fix the CSS? On Thursday, 9 August 2012 00:29:58 UTC-5, Andrew wrote: Just a note on IE7 navbar behaviour: The Menu has taken a turn for the worse: Initially the Welcome App Sub Menus dissapeared in : welcome css pathc, issue 896, thanks Angelo They then returned in fixed issue qith clicking on toplevel menus except all of the submenus are displayed when the menu first appears and they are all on top of each other. The login options are still blue, and the space between the navbar and Welcome isn't there. See screen shot. On Thursday, August 9, 2012 9:17:17 AM UTC+12, Massimo Di Pierro wrote: more issues have been addressed. In order to fix an issue I had to introduce a slight change of behavior and I am not sure what is the best way to handle it. If you login using a third party service (for example janrain using facebook) and the service sends info about you, if web2py has corresponding fields in auth_user, it stores them. If you edit your profile, logout, change your facebook profile, login again using janrain, should web2py keep the current local profile or update it? The bug report suggested that web2oy should always give preference to the local profile. I changed web2py accordingly. In practice this change will probably not affect anybody because none of the services sends any information stored by auth_user. Yet, please check it. Massimo On Monday, 6 August 2012 23:33:48 UTC-5, Massimo Di Pierro wrote: Web2py 2.0 is almost done. Please try the nightly build. Let us know if it breaks anything. massimo --
[web2py] Re: Stream a couchdb attachment with web2py
audio src={{=URL('getme',args='track06.mp3http://www.myserver.com/.../track06.mp3 ')}} preload=auto/audio def getme(): import urllib response.headers['Content-Type'] = 'audio/mp3' filename = ''+request.args(0) # fix this! return response.stream(urllib.urlopen(filename)) On Thursday, 9 August 2012 03:54:43 UTC-5, Daniel Gonzalez wrote: Hello, I have some sound files in a couchdb database (not related to web2py). My web2py application has access to this database, and I want to stream the sound files so that they can be listened with the HTML audio tag, like this: audio src=http://www.myserver.com/.../track06.mp3; preload=auto /audio I am planning to do this streaming as follows: response.stream(open(filename),chunk_size=4096) But I have some open questions: 1. My filename is not in the local filesystem, but in a couchdb database, accessible via REST. How can I open that? 2. What kind of request will the audio tag send when it is activated, GET/POST/...? Can this be handled with web2py? Thanks, Daniel --
Re: [web2py] Re: How do larger teams develop with Web2py?
Listen everybody. This thread is hilarious but not very professional. I think most of the people on this thread are hardcore programmers and most of us came to some conclusions: 1) it is not the idea that has value, it is the execution 2) the success of a project is strongly correlated with the skills of the programmers who work on it, the time and love they put in it. 3) it does not really matter how much money is put into a project, if the programmers are not good, and if they do not care about the project, it will not succeed. Is there any value in management and or of software development methods? I think there is. I am not saying which method is best because there is not one size fits all but good programmers in my experience are self disciplined. They follow a methodology to keep track of bugs and systematically fix them. Their methodology may not exactly match named ones (agile or waterfall or other) but it is a methodology. Massimo --
Re: [web2py] Re: How do larger teams develop with Web2py?
I Agree. Good words. On 08/09/2012 10:48 AM, Massimo Di Pierro wrote: Listen everybody. This thread is hilarious but not very professional. I think most of the people on this thread are hardcore programmers and most of us came to some conclusions: 1) it is not the idea that has value, it is the execution 2) the success of a project is strongly correlated with the skills of the programmers who work on it, the time and love they put in it. 3) it does not really matter how much money is put into a project, if the programmers are not good, and if they do not care about the project, it will not succeed. Is there any value in management and or of software development methods? I think there is. I am not saying which method is best because there is not one size fits all but good programmers in my experience are self disciplined. They follow a methodology to keep track of bugs and systematically fix them. Their methodology may not exactly match named ones (agile or waterfall or other) but it is a methodology. Massimo -- --
Re: [web2py] Re: How do larger teams develop with Web2py?
Really funny post Bruno! Agree mostly with Massimo, let's good programmer roll! :) Richard On Thu, Aug 9, 2012 at 9:56 AM, vinicius...@gmail.com vinicius...@gmail.com wrote: I Agree. Good words. On 08/09/2012 10:48 AM, Massimo Di Pierro wrote: Listen everybody. This thread is hilarious but not very professional. I think most of the people on this thread are hardcore programmers and most of us came to some conclusions: 1) it is not the idea that has value, it is the execution 2) the success of a project is strongly correlated with the skills of the programmers who work on it, the time and love they put in it. 3) it does not really matter how much money is put into a project, if the programmers are not good, and if they do not care about the project, it will not succeed. Is there any value in management and or of software development methods? I think there is. I am not saying which method is best because there is not one size fits all but good programmers in my experience are self disciplined. They follow a methodology to keep track of bugs and systematically fix them. Their methodology may not exactly match named ones (agile or waterfall or other) but it is a methodology. Massimo -- -- --
Re: [web2py] Re: web2py 2.0 almost done
I see. I understand it now. Thanks Anthony On Wednesday, August 8, 2012 9:37:51 PM UTC+8, Anthony wrote: On Wednesday, August 8, 2012 5:30:10 AM UTC-4, lyn2py wrote: Does this mean that if I uncomment the jquery-ui in layout.html, the autocomplete will be working even on IE? No, jQuery UI autocomplete is not implemented with web2py. Anthony --
Re: [web2py] Re: web2py 2.0 almost done
It would be good to have OAuth working for web2py 2 Facebook and LinkedIn still have some issues LinkedIn: https://groups.google.com/forum/#!topic/web2py/SbnQEnXEcOg Facebook: (will add bug report once I've gotten LinkedIn login to work) On Thu, Aug 9, 2012 at 11:25 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Can you help us fix the CSS? On Thursday, 9 August 2012 00:29:58 UTC-5, Andrew wrote: Just a note on IE7 navbar behaviour: The Menu has taken a turn for the worse: Initially the Welcome App Sub Menus dissapeared in : welcome css pathc, issue 896, thanks Angelo They then returned in fixed issue qith clicking on toplevel menus except all of the submenus are displayed when the menu first appears and they are all on top of each other. The login options are still blue, and the space between the navbar and Welcome isn't there. See screen shot. On Thursday, August 9, 2012 9:17:17 AM UTC+12, Massimo Di Pierro wrote: more issues have been addressed. In order to fix an issue I had to introduce a slight change of behavior and I am not sure what is the best way to handle it. If you login using a third party service (for example janrain using facebook) and the service sends info about you, if web2py has corresponding fields in auth_user, it stores them. If you edit your profile, logout, change your facebook profile, login again using janrain, should web2py keep the current local profile or update it? The bug report suggested that web2oy should always give preference to the local profile. I changed web2py accordingly. In practice this change will probably not affect anybody because none of the services sends any information stored by auth_user. Yet, please check it. Massimo On Monday, 6 August 2012 23:33:48 UTC-5, Massimo Di Pierro wrote: Web2py 2.0 is almost done. Please try the nightly build. Let us know if it breaks anything. massimo -- --
[web2py] Re: LinkedIn not working? - Am I importing the wrong library?
I have also now tried with http://code.google.com/p/python-linkedin/, but that gave me the type 'exceptions.ImportError' No module named gluon.contrib.login_methods.linkedin_account error. To debug, I tried following the guide on their Google Code page, and was able to get an error: from linkedin import helper Traceback (most recent call last): File stdin, line 1, in module File C:\Python27\lib\site-packages\linkedin\helper.py, line 2, in module import api File C:\Python27\lib\site-packages\linkedin\api.py, line 2, in module from params import *ImportError: No module named params I haven't been able to find the params module. What and where is it? Thanks for all information, Alec Taylor On Thursday, August 9, 2012 2:23:02 PM UTC+10, Alec Taylor wrote: Just trying to test out LinkedIn login, but having some trouble. I've tried placing https://github.com/michaelhelmick/linkedin/blob/master/linkedin.py in web2py\gluon\contrib\login_methods, but I still was getting the linkedin module not found error. Same error was received after a `pip install linkedin`. I also tried removing the try/except and replacing it inline with the contents of that linkedin.py. That gave me a type 'exceptions.ImportError' No module named gluon.contrib.login_methods.linkedin_account error on page refresh. I have been following this guide: http://web2py.com/books/default/chapter/29/9 Am I using the wrong linkedin library? Or is there something else I'm doing wrong? Thanks for all suggestions, Alec Taylor --
[web2py] Problem with Field display in SQLForm.Smartgrid
Hello: I am building a movie database site with web2py. I have a movies table which has a many-to-many relationship with several other items: stars, directors and genres. I am using a SQLForm.Smartgrid declared in my controller like so: def manage_movies(): grid = SQLFORM.smartgrid(db.movie) return locals() Everything seems to be working fine -- all of the reference tables are showing up. However, when I click on, say 'Stars', which is the reference table joining db.movie with db.person, the Movie ID and Star Fields are oddly populated. Attached is a screenshot which should make this clear. https://lh6.googleusercontent.com/-eS6fJPgPv5k/UCMiWvEM_7I/AAc/NzibaZS3H_Y/s1600/Screen+shot+2012-08-08+at+10.35.52+PM.png If I click edit for a Star record, everything is fine. There are dropdowns with the appropriate movie and star selected. I realize I haven't provided any of my model code. Was hoping someone might be able to quickly id the problem without all that. Thanks for your help. --
Re: [web2py] Re: How do larger teams develop with Web2py?
+1 Great words Massimo! its the best conclusion of Programming-Motherfucker method! :) Em 09/08/2012 10:48, Massimo Di Pierro massimo.dipie...@gmail.com escreveu: Listen everybody. This thread is hilarious but not very professional. I think most of the people on this thread are hardcore programmers and most of us came to some conclusions: 1) it is not the idea that has value, it is the execution 2) the success of a project is strongly correlated with the skills of the programmers who work on it, the time and love they put in it. 3) it does not really matter how much money is put into a project, if the programmers are not good, and if they do not care about the project, it will not succeed. Is there any value in management and or of software development methods? I think there is. I am not saying which method is best because there is not one size fits all but good programmers in my experience are self disciplined. They follow a methodology to keep track of bugs and systematically fix them. Their methodology may not exactly match named ones (agile or waterfall or other) but it is a methodology. Massimo -- --
Re: [web2py] Re: LinkedIn not working? - Am I importing the wrong library?
Okay, using the version not from git and installing it both with pip install python-linkedin and placing the helper.py, linkedin.py and model.py in the web2py\gluon\contrib\login_methods directory left me with the aforementioned error: linkedin module not found Eventually after a lot of renaming and pasting of the contents of linkedin.py within web2py\gluon\contrib\login_methods\linkedin_account.py, I was able to get the page to load without error. Here is my modified linkedin_account.py: https://gist.github.com/44a2e6fb4cf3cf75568b Unfortunately on click of the login button I was presented with this page: https://www.linkedin.com/uas/oauth/authorize?oauth_token=True How do I get login with LinkedIn working? Thanks for all suggestions, Alec Taylor On Fri, Aug 10, 2012 at 1:14 AM, Alec Taylor alec.tayl...@gmail.com wrote: I have also now tried with http://code.google.com/p/python-linkedin/, but that gave me the type 'exceptions.ImportError' No module named gluon.contrib.login_methods.linkedin_account error. To debug, I tried following the guide on their Google Code page, and was able to get an error: from linkedin import helper Traceback (most recent call last): File stdin, line 1, in module File C:\Python27\lib\site-packages\linkedin\helper.py, line 2, in module import api File C:\Python27\lib\site-packages\linkedin\api.py, line 2, in module from params import * ImportError: No module named params I haven't been able to find the params module. What and where is it? Thanks for all information, Alec Taylor On Thursday, August 9, 2012 2:23:02 PM UTC+10, Alec Taylor wrote: Just trying to test out LinkedIn login, but having some trouble. I've tried placing https://github.com/michaelhelmick/linkedin/blob/master/linkedin.py in web2py\gluon\contrib\login_methods, but I still was getting the linkedin module not found error. Same error was received after a `pip install linkedin`. I also tried removing the try/except and replacing it inline with the contents of that linkedin.py. That gave me a type 'exceptions.ImportError' No module named gluon.contrib.login_methods.linkedin_account error on page refresh. I have been following this guide: http://web2py.com/books/default/chapter/29/9 Am I using the wrong linkedin library? Or is there something else I'm doing wrong? Thanks for all suggestions, Alec Taylor -- --
[web2py] Re: Cookie chaos- please see this example
To me a default where apps share cookies doesn't seem out of with line with the other things apps share- the default logger for example. Just as making an app-specific logger can be achieved by passing request.application to a new instance, so we can prefix app-specific cookies with the app name. To me it's the more obvious default. Interested to hear what others think. On Thursday, August 9, 2012 12:27:29 AM UTC-4, Massimo Di Pierro wrote: if we default path = '/' then all apps share cookies and that may be a problem. expiration is also not set. They are Cookies.SimpleCookie() objects. On Wednesday, 8 August 2012 22:14:25 UTC-5, Yarin wrote: Got it- added the path and everything's working now. I was not aware cookies are path dependent- I thought they were restricted only by domains/sub-domains. Maybe I'm the only one, but my guess would be that a lot of people are operating under that assumption. For that reason my vote would be to either make the default the root path or at the very least to make clear in the documentation what the default behavior is now. I punched the wall a few times this afternoon trying to understand why my cookies wouldn't persist on the same function call from one request to another, and the whole time was barking up the wrong trees. Also, what's the default expiration value for cookies? On Wednesday, August 8, 2012 9:35:04 PM UTC-4, Massimo Di Pierro wrote: I can reproduce your behavior. The problem is that when you set response.cookies['LAST_FUNCTION'] = request.function you are not setting a path response.cookies['LAST_FUNCTION']['path']='/myapplication' therefore the browser assumes the scope of the cookie is the URL. web2py cannot set the path (scope) automatically because it does not know how your application is exposed. For example: response.cookies['LAST_FUNCTION']['path']='/'+request.application would behave differently depending on the routes. I would not be tremendously opposed to changing this default but I am not convinced there is a better default. On Wednesday, 8 August 2012 18:25:36 UTC-5, Yarin wrote: This is a weird issue turned weirder, but I've at least been able to reproduce it: *Controller:* def func_a(): response.cookies['LAST_FUNCTION'] = request.function return str(request.cookies) def func_b(): response.cookies['LAST_FUNCTION'] = request.function return str(request.cookies) def dump_cookies(): return str(request.cookies) Make 5 calls in succession: /func_a /func_b(LAST_FUNCTION = 'func_a') /func_a(LAST_FUNCTION = 'func_b') /func_b(LAST_FUNCTION = 'func_a') /dump_cookies(LAST_FUNCTION = 'func_b') Everything checks out. Now clear cookies, and try the calls again, but this time with different args for each: /func_a/1 /func_b/2 /func_a/1(LAST_FUNCTION = 'func_a') /func_b/2(LAST_FUNCTION = 'func_b') /dump_cookies-No LAST_FUNCTION cookie- In other words, the cookies are no longer being shared across functions! Please try this yourself and report back. If anyone can make sense of this, I want to hear it... --
[web2py] Table Inheritance (Was Re: KeyError : 'name' when inserting/updating via sqlform.grid)
I figured out that problem is due to the way I have defined Table Inheritance for mother/father/child. If I define fields name and description *directly* in the mother/father/child tables, inserts/updates work OK. Now the question is : What is wrong with the way I've defined the tables ? Here is the code for your reference : name = db.Table(db, 'name', Field('name', 'string', length=128, notnull=True, unique=True)) name_desc = db.Table(db, 'base', name, Field('description', 'text', default='')) db.define_table('mother', name_desc, format='%(name)s') I've also checked that at database (mysql) level both name and description fields are defined for the tables - May be that is why insert/update work via the script. *Why does this fail via web interface - sqlform.grid ?* Thanks, -Mandar On Wednesday, August 8, 2012 11:14:00 PM UTC+5:30, Mandar Vaze wrote: I have posted this query sometime ago via google-group's web interface - but it did not appear in the list - may be it is lost or held in moderation queue (This is my first post) So I am sending this again via normal gmail interface. If this is duplicate - please ignore. I'm using web2py version : Version 2.0.0 (2012-07-26 06:06:10) dev I have tables defined as follows : name = db.Table(db, 'name', Field('name', 'string', length=128, notnull=True, unique=True)) name_desc = db.Table(db, 'base', name, Field('description', 'text', default='')) db.define_table('mother', name_desc, format='%(name)s') db.define_table('father', name_desc, format='%(name)s') db.define_table('child', name_desc, Field('mother', db.mother), Field('father', db.father), format='%(name)s') *I am able to successfully insert data in mother table via script (e.g. db.mother.insert(name=Alice))* But when I use appadmin to insert new record into mother table, I get the following error : I have a sqlform.grid somewhere in the app, I get same error there too ( I think appadmin also uses sqlform.grid internally) Traceback (most recent call last): File /home/mandar/web2py/gluon/restricted.py, line 205, in restricted exec ccode in environment File /home/mandar/web2py/applications/test1/controllers/appadmin.py, line 432, in module File /home/mandar/web2py/gluon/globals.py, line 182, in lambda self._caller = lambda f: f() File /home/mandar/web2py/applications/test1/controllers/appadmin.py, line 127, in insert if form.accepts(request.vars, session): File /home/mandar/web2py/gluon/sqlhtml.py, line 1146, in accepts hideerror=hideerror, File /home/mandar/web2py/gluon/html.py, line 1870, in accepts status = self._traverse(status,hideerror) File /home/mandar/web2py/gluon/html.py, line 793, in _traverse newstatus = c._traverse(status,hideerror) and newstatus File /home/mandar/web2py/gluon/html.py, line 793, in _traverse newstatus = c._traverse(status,hideerror) and newstatus File /home/mandar/web2py/gluon/html.py, line 793, in _traverse newstatus = c._traverse(status,hideerror) and newstatus File /home/mandar/web2py/gluon/html.py, line 793, in _traverse newstatus = c._traverse(status,hideerror) and newstatus File /home/mandar/web2py/gluon/html.py, line 800, in _traverse newstatus = self._validate() File /home/mandar/web2py/gluon/html.py, line 1625, in _validate (value, errors) = validator(value) File /home/mandar/web2py/gluon/validators.py, line 554, in __call__ table = self.dbset.db[tablename] File /home/mandar/web2py/gluon/dal.py, line 6877, in __getitem__ return dict.__getitem__(self, str(key)) KeyError: 'name' Similarly, after populating mother/father and child tables via script when I try to update child record - In the dropdown I see mother's names instead of ID (as expected) but when I select different mother and submit I get same error (traceback may be slightly different - but same KeyError:'name' ) What is wrong with the table definitions ? Thanks, -Mandar P.S: This may be similar to https://groups.google.com/d/msg/web2py/XR4T92l2rJ4/dtTRnO0e7dcJ --
[web2py] Re: Cookie chaos- please see this example
The point is... why use cookies al all when there is an app-level session? If you use cookies it may be because you want to do something that canot be done with sessions. Adding a prefix would get in the way of some possible uses. On Thursday, 9 August 2012 10:40:01 UTC-5, Yarin wrote: To me a default where apps share cookies doesn't seem out of with line with the other things apps share- the default logger for example. Just as making an app-specific logger can be achieved by passing request.application to a new instance, so we can prefix app-specific cookies with the app name. To me it's the more obvious default. Interested to hear what others think. On Thursday, August 9, 2012 12:27:29 AM UTC-4, Massimo Di Pierro wrote: if we default path = '/' then all apps share cookies and that may be a problem. expiration is also not set. They are Cookies.SimpleCookie() objects. On Wednesday, 8 August 2012 22:14:25 UTC-5, Yarin wrote: Got it- added the path and everything's working now. I was not aware cookies are path dependent- I thought they were restricted only by domains/sub-domains. Maybe I'm the only one, but my guess would be that a lot of people are operating under that assumption. For that reason my vote would be to either make the default the root path or at the very least to make clear in the documentation what the default behavior is now. I punched the wall a few times this afternoon trying to understand why my cookies wouldn't persist on the same function call from one request to another, and the whole time was barking up the wrong trees. Also, what's the default expiration value for cookies? On Wednesday, August 8, 2012 9:35:04 PM UTC-4, Massimo Di Pierro wrote: I can reproduce your behavior. The problem is that when you set response.cookies['LAST_FUNCTION'] = request.function you are not setting a path response.cookies['LAST_FUNCTION']['path']='/myapplication' therefore the browser assumes the scope of the cookie is the URL. web2py cannot set the path (scope) automatically because it does not know how your application is exposed. For example: response.cookies['LAST_FUNCTION']['path']='/'+request.application would behave differently depending on the routes. I would not be tremendously opposed to changing this default but I am not convinced there is a better default. On Wednesday, 8 August 2012 18:25:36 UTC-5, Yarin wrote: This is a weird issue turned weirder, but I've at least been able to reproduce it: *Controller:* def func_a(): response.cookies['LAST_FUNCTION'] = request.function return str(request.cookies) def func_b(): response.cookies['LAST_FUNCTION'] = request.function return str(request.cookies) def dump_cookies(): return str(request.cookies) Make 5 calls in succession: /func_a /func_b(LAST_FUNCTION = 'func_a') /func_a(LAST_FUNCTION = 'func_b') /func_b(LAST_FUNCTION = 'func_a') /dump_cookies(LAST_FUNCTION = 'func_b') Everything checks out. Now clear cookies, and try the calls again, but this time with different args for each: /func_a/1 /func_b/2 /func_a/1(LAST_FUNCTION = 'func_a') /func_b/2(LAST_FUNCTION = 'func_b') /dump_cookies-No LAST_FUNCTION cookie- In other words, the cookies are no longer being shared across functions! Please try this yourself and report back. If anyone can make sense of this, I want to hear it... --
[web2py] Re: Web2Py compute fields not working on update
Has anyone found a way to fix this yet? Or is there a thumbnail module out now? Like django's http://djangothumbnails.com/ Brandon On Monday, June 18, 2012 10:24:05 AM UTC-6, Brandon Reynolds wrote: I have this problem when i try to generate thumbnails. If the field is empty it inserts the photo thumb into the thumbnail. But when i try to update that record the thumbnail doesn't change. Here is my model: # coding: utf8 from image import THUMBER db.define_table('park', Field('park_name', requires=IS_NOT_EMPTY()), Field('park_city', requires=IS_NOT_EMPTY()), Field('park_state', requires=IS_NOT_EMPTY()), Field('park_address', requires=IS_NOT_EMPTY()), Field('park_zip', requires=IS_NOT_EMPTY()), Field('country', default=USA, notnull=True, readable=False, writable=False), Field('park_phone', requires=IS_MATCH('[\d\-\(\) ]+')), Field('park_fax', requires=IS_EMPTY_OR(IS_MATCH('[\d\-\(\) ]+'))), Field('park_phone_2', 'string', requires=IS_EMPTY_OR(IS_MATCH('[\d\-\(\) ]+'))), Field('photo1', 'upload'), Field('photo_thumb1', 'upload', readable=False, writable=False), Field('photo2', 'upload'), Field('photo_thumb2', 'upload', readable=False, writable=False), Field('photo3', 'upload'), Field('photo_thumb3', 'upload', readable=False, writable=False), Field('photo4', 'upload'), Field('photo_thumb4', 'upload', readable=False, writable=False), Field('photo5', 'upload'), Field('photo_thumb5', 'upload', readable=False, writable=False), Field('manager', requires=IS_NOT_EMPTY()), Field('manager_email', requires=IS_EMAIL()), Field('spaces', 'integer', requires=IS_NOT_EMPTY()), Field('vacant', 'integer'), Field('lot_rent', 'integer', requires=IS_NOT_EMPTY()), Field('water', 'boolean'), Field('sewer', 'boolean'), Field('trash', 'boolean'), Field('pool', 'boolean'), Field('playground', 'boolean'), Field('clubhouse', 'boolean'), Field('laundromat', 'boolean'), Field('rv_spaces', 'boolean'), Field('storage', 'boolean'), Field('handicap_accessible', 'boolean'), Field('community_description', 'text'), format='%(park_name)s') db.define_table('home', Field('pid', notnull=True, readable=False, writable=False), Field('lot'), Field('year', length=4, requires=IS_NOT_EMPTY()), Field('make'), Field('model'), Field('width', requires=IS_NOT_EMPTY()), Field('length', requires=IS_NOT_EMPTY()), Field('wide', requires=IS_NOT_EMPTY()), Field('for_sale', 'boolean', default=True), Field('beds', requires=IS_NOT_EMPTY()), Field('baths', requires=IS_NOT_EMPTY()), Field('fridge', 'boolean'), Field('stove', 'boolean'), Field('dishwasher', 'boolean'), Field('microwave', 'boolean'), Field('washer', 'boolean'), Field('dryer', 'boolean'), Field('photo1', 'upload'), Field('photo1_text'), Field('photo_thumb1', 'upload', readable=False, writable=False), Field('photo2', 'upload'), Field('photo2_text'), Field('photo_thumb2', 'upload', readable=False, writable=False), Field('photo3', 'upload'), Field('photo3_text'), Field('photo_thumb3', 'upload', readable=False, writable=False), Field('photo4', 'upload'), Field('photo4_text'), Field('photo_thumb4', 'upload', readable=False, writable=False), Field('photo5', 'upload'), Field('photo5_text'), Field('photo_thumb5', 'upload', readable=False, writable=False), Field('price',requires=IS_NOT_EMPTY()), Field('description', 'text', requires=IS_NOT_EMPTY()), Field('posted_on', 'datetime', readable=False, writable=False)) db.define_table('state', Field('name'), Field('full_name')) db.define_table('wide', Field('type'), format='%(type)s') db.park.park_state.requires = IS_IN_DB(db, 'state.name', '%(full_name)s (%(name)s)', zero=T('Select State')) db.home.wide.requires = IS_IN_DB(db, 'wide.type', '%(type)s', zero=T('Select Home Type')) db.park.photo_thumb1.compute = lambda row: THUMBER(row.photo1, photo_thumb1, 144, 115) db.park.photo_thumb2.compute = lambda row: THUMBER(row.photo2, photo_thumb2, 144, 115) db.park.photo_thumb3.compute = lambda row: THUMBER(row.photo3, photo_thumb3, 144, 115) db.park.photo_thumb4.compute = lambda row: THUMBER(row.photo4, photo_thumb4, 144, 115) db.park.photo_thumb5.compute = lambda row: THUMBER(row.photo5, photo_thumb5, 144, 115) db.home.photo_thumb1.compute = lambda row: THUMBER(row.photo1, photo_thumb1, 144, 115) db.home.photo_thumb2.compute = lambda row: THUMBER(row.photo2, photo_thumb2, 144, 115) db.home.photo_thumb3.compute = lambda row: THUMBER(row.photo3, photo_thumb3, 144, 115) db.home.photo_thumb4.compute = lambda row: THUMBER(row.photo4, photo_thumb4, 144, 115) db.home.photo_thumb5.compute = lambda row: THUMBER(row.photo5, photo_thumb5, 144, 115) Here is my controller: def index(): return locals() def parks(): if request.args(0): parks = db(db.park.park_state==request.args(0)).select(orderby=db.park.park_city|db.park.park_name) else: parks =
[web2py] Re: Cookie chaos- please see this example
Good point- I just looked at what i was trying to do and session is really all i need, don't know why I thought differently.. On Thursday, August 9, 2012 11:45:46 AM UTC-4, Massimo Di Pierro wrote: The point is... why use cookies al all when there is an app-level session? If you use cookies it may be because you want to do something that canot be done with sessions. Adding a prefix would get in the way of some possible uses. On Thursday, 9 August 2012 10:40:01 UTC-5, Yarin wrote: To me a default where apps share cookies doesn't seem out of with line with the other things apps share- the default logger for example. Just as making an app-specific logger can be achieved by passing request.application to a new instance, so we can prefix app-specific cookies with the app name. To me it's the more obvious default. Interested to hear what others think. On Thursday, August 9, 2012 12:27:29 AM UTC-4, Massimo Di Pierro wrote: if we default path = '/' then all apps share cookies and that may be a problem. expiration is also not set. They are Cookies.SimpleCookie() objects. On Wednesday, 8 August 2012 22:14:25 UTC-5, Yarin wrote: Got it- added the path and everything's working now. I was not aware cookies are path dependent- I thought they were restricted only by domains/sub-domains. Maybe I'm the only one, but my guess would be that a lot of people are operating under that assumption. For that reason my vote would be to either make the default the root path or at the very least to make clear in the documentation what the default behavior is now. I punched the wall a few times this afternoon trying to understand why my cookies wouldn't persist on the same function call from one request to another, and the whole time was barking up the wrong trees. Also, what's the default expiration value for cookies? On Wednesday, August 8, 2012 9:35:04 PM UTC-4, Massimo Di Pierro wrote: I can reproduce your behavior. The problem is that when you set response.cookies['LAST_FUNCTION'] = request.function you are not setting a path response.cookies['LAST_FUNCTION']['path']='/myapplication' therefore the browser assumes the scope of the cookie is the URL. web2py cannot set the path (scope) automatically because it does not know how your application is exposed. For example: response.cookies['LAST_FUNCTION']['path']='/'+request.application would behave differently depending on the routes. I would not be tremendously opposed to changing this default but I am not convinced there is a better default. On Wednesday, 8 August 2012 18:25:36 UTC-5, Yarin wrote: This is a weird issue turned weirder, but I've at least been able to reproduce it: *Controller:* def func_a(): response.cookies['LAST_FUNCTION'] = request.function return str(request.cookies) def func_b(): response.cookies['LAST_FUNCTION'] = request.function return str(request.cookies) def dump_cookies(): return str(request.cookies) Make 5 calls in succession: /func_a /func_b(LAST_FUNCTION = 'func_a') /func_a(LAST_FUNCTION = 'func_b') /func_b(LAST_FUNCTION = 'func_a') /dump_cookies(LAST_FUNCTION = 'func_b') Everything checks out. Now clear cookies, and try the calls again, but this time with different args for each: /func_a/1 /func_b/2 /func_a/1(LAST_FUNCTION = 'func_a') /func_b/2(LAST_FUNCTION = 'func_b') /dump_cookies-No LAST_FUNCTION cookie- In other words, the cookies are no longer being shared across functions! Please try this yourself and report back. If anyone can make sense of this, I want to hear it... --
[web2py] Re: How do larger teams develop with Web2py?
Must admit site is funny; I almost bought the t-shirt. I don't mean to imply any particular methodology (even though I do tend to favour evolutionary, functional prototyping methods hence my interest in Web2py). I'm more interested in how larger web dev projects are affected (or not) by the integrated nature of web2py, regardless of the dev methology used. Can larger teams work collaboratively just as easily with web2py as with say very lightweight frameworks (or perhaps more easily)? My belief is that they can, but it is only my belief. There are some who say that the architecture of web2py is likely to make it more difficult to separate the concerns of the various team members. -- Luc On Wednesday, 8 August 2012 21:39:20 UTC+1, Luc Chase wrote: What particular constraints and advantages does using web2py tend to bring for larger project development teams as opposed to those working solo or in very small teams? I assume for example these roles benefit from rapid feedback and ability to adjust requirements more easily? - Project stakeholder (client or business owner) - Project manager - Producer - Editor/copywriter - Information architect - Business-systems analyst - Tech lead - Database administrator - Quality assurance engineer But are these roles less-able or more-able to work in parallel? - Graphic designer - HTML developer - Developer --
[web2py] Re: Cookie chaos- please see this example
To me a default where apps share cookies doesn't seem out of with line with the other things apps share- the default logger for example. Cookies are for end-user functionality; the logger is for development/debugging. For the most part, the apps don't share anything. Just as making an app-specific logger can be achieved by passing request.application to a new instance, so we can prefix app-specific cookies with the app name. To me it's the more obvious default. If the apps are truly independent and unrelated, I would think using a cookie would more likely be for some app-specific functionality. On the other hand, in most cases, you probably don't have multiple apps running on the same domain, or if you do, those apps are related and might need to share cookies. But it still might be safer to require the developer to set the path explicitly. Note, I think this is reasonably well documented in the book: http://web2py.com/books/default/chapter/29/4#Cookies. Anthony --
Re: [web2py] Re: How do larger teams develop with Web2py?
Luc, I don't see that. Web2py allows your team to work colaboratively. We work this way in our company. By the way, I'd say some characteristics enforce this separation. In Django, for example, you must have your routes planned and templates coded to allow programmers to work. Without them, you cannot see any running code. In Web2py you can quick off immediately because you don't need to plan urls in advance and you have default views. This way, your frontend devs can be disconnected from your backend devs. Later, you can worry about standardized urls and don't change anything in your app. We're working this way with great success. -- Vinicius Assef On 08/09/2012 01:25 PM, Luc Chase wrote: Must admit site is funny; I almost bought the t-shirt. I don't mean to imply any particular methodology (even though I do tend to favour evolutionary, functional prototyping methods hence my interest in Web2py). I'm more interested in how larger web dev projects are affected (or not) by the integrated nature of web2py, regardless of the dev methology used. Can larger teams work collaboratively just as easily with web2py as with say very lightweight frameworks (or perhaps more easily)? My belief is that they can, but it is only my belief. There are some who say that the architecture of web2py is likely to make it more difficult to separate the concerns of the various team members. -- Luc On Wednesday, 8 August 2012 21:39:20 UTC+1, Luc Chase wrote: What particular constraints and advantages does using web2py tend to bring for larger project development teams as opposed to those working solo or in very small teams? I assume for example these roles benefit from rapid feedback and ability to adjust requirements more easily? - Project stakeholder (client or business owner) - Project manager - Producer - Editor/copywriter - Information architect - Business-systems analyst - Tech lead - Database administrator - Quality assurance engineer But are these roles less-able or more-able to work in parallel? - Graphic designer - HTML developer - Developer --
Re: [web2py] Re: web2py 2.0 almost done
Hi Massimo, I think I cannot complete the bootstrap/web2py css merging in time for 2.0, it's really a lot of work and I'm a bit busy these days. Btw, i'm fixing the bug I introduced with issue 896 and I want to share a thought with you. Actually, there is no way to maintain a mobile first approach and make it working on IE other than add something like this to the scaffolding: !-- Makes bootswatch working on IE 7/8 -- !--[if (lt IE 9)] link rel=stylesheet href=/responsivekit/static/css/bootswatch_ie.css ![endif]-- This will make speedier the whole css on not IE browsers because we remove IE specific rules (smaller css), but has the downside to require an extra http get on IE. What do you think? 2012/8/9 Alec Taylor alec.tayl...@gmail.com It would be good to have OAuth working for web2py 2 Facebook and LinkedIn still have some issues LinkedIn: https://groups.google.com/forum/#!topic/web2py/SbnQEnXEcOg Facebook: (will add bug report once I've gotten LinkedIn login to work) On Thu, Aug 9, 2012 at 11:25 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Can you help us fix the CSS? On Thursday, 9 August 2012 00:29:58 UTC-5, Andrew wrote: Just a note on IE7 navbar behaviour: The Menu has taken a turn for the worse: Initially the Welcome App Sub Menus dissapeared in : welcome css pathc, issue 896, thanks Angelo They then returned in fixed issue qith clicking on toplevel menus except all of the submenus are displayed when the menu first appears and they are all on top of each other. The login options are still blue, and the space between the navbar and Welcome isn't there. See screen shot. On Thursday, August 9, 2012 9:17:17 AM UTC+12, Massimo Di Pierro wrote: more issues have been addressed. In order to fix an issue I had to introduce a slight change of behavior and I am not sure what is the best way to handle it. If you login using a third party service (for example janrain using facebook) and the service sends info about you, if web2py has corresponding fields in auth_user, it stores them. If you edit your profile, logout, change your facebook profile, login again using janrain, should web2py keep the current local profile or update it? The bug report suggested that web2oy should always give preference to the local profile. I changed web2py accordingly. In practice this change will probably not affect anybody because none of the services sends any information stored by auth_user. Yet, please check it. Massimo On Monday, 6 August 2012 23:33:48 UTC-5, Massimo Di Pierro wrote: Web2py 2.0 is almost done. Please try the nightly build. Let us know if it breaks anything. massimo -- -- -- Profile: http://it.linkedin.com/in/compagnucciangelo --
[web2py] Re: How do larger teams develop with Web2py?
I think others should share their view on this but I will add my two cents (not sure very web2py specific). Most of the best projects I have seen in web2py are written by small teams (same goes for most open source web apps I have seen in my life). In web2py there is an order in which you do things. first you write the models, then you write the controllers, finally you apply the views. The fact that there is an oder and that very little repetition of code it means it is difficult for people to work in parallel on the same project during the initial phase. This means that going from 0 to a working prototype is better done by a small team (1-3 people). Things change after that. A small team does not make good testers and does not make good documentation. There are all things that can be parallelized and are best done by different people. Things are also different if a project is comprised of modules that are independent or if the project is designed from the beginning as a set of plugins and modules. For example if your project is comprised of many apps they can be worked on independently and in parallel. Of if the app is required to talk with third party services, it is reasonable to have different people work in parallel to create modules to interface with those services. I can say web2py itself is now being worked on in parallel. Different people are more or less in change of different modules and we work on them independently on fixing bugs and adding features. This is one under a global quality control enforced by Anthony and Jonathan. We have some unwritten rules by which we operate (good: decrease size, fix bugs, add features, portablity; bad: change of behavior, bloated code) and usually we do not even need much discussion on proposed changes when they affect a single module or fall clearly in one's domain of expertise. Many of our discussions are about adding new features that may affect multiple parts of the code, what the consequences may be for users, and whether the proposed approach is sufficiently general. Massimo On Thursday, 9 August 2012 11:25:08 UTC-5, Luc Chase wrote: Must admit that site is funny; I almost bought the t-shirt. I don't mean to imply any particular methodology (even though I do tend to favour evolutionary, functional prototyping methods hence my interest in Web2py). I'm more interested in how larger web dev projects are affected (or not) by the integrated nature of web2py, regardless of the dev methology used. Can larger teams work collaboratively just as easily with web2py as with say very lightweight frameworks (or perhaps more easily)? My belief is that they can, but it is only my belief. There are some who say that the architecture of web2py is likely to make it more difficult to separate the concerns of the various team members. -- Luc On Wednesday, 8 August 2012 21:39:20 UTC+1, Luc Chase wrote: What particular constraints and advantages does using web2py tend to bring for larger project development teams as opposed to those working solo or in very small teams? I assume for example these roles benefit from rapid feedback and ability to adjust requirements more easily? - Project stakeholder (client or business owner) - Project manager - Producer - Editor/copywriter - Information architect - Business-systems analyst - Tech lead - Database administrator - Quality assurance engineer But are these roles less-able or more-able to work in parallel? - Graphic designer - HTML developer - Developer --
Re: [web2py] Re: Cookie chaos- please see this example
The book doesn't describe the defaults. I think mentioning that cookies will be set to the specific URL, args and all, would be helpful. On Thu, Aug 9, 2012 at 12:30 PM, Anthony abasta...@gmail.com wrote: To me a default where apps share cookies doesn't seem out of with line with the other things apps share- the default logger for example. Cookies are for end-user functionality; the logger is for development/debugging. For the most part, the apps don't share anything. Just as making an app-specific logger can be achieved by passing request.application to a new instance, so we can prefix app-specific cookies with the app name. To me it's the more obvious default. If the apps are truly independent and unrelated, I would think using a cookie would more likely be for some app-specific functionality. On the other hand, in most cases, you probably don't have multiple apps running on the same domain, or if you do, those apps are related and might need to share cookies. But it still might be safer to require the developer to set the path explicitly. Note, I think this is reasonably well documented in the book: http://web2py.com/books/default/chapter/29/4#Cookies. Anthony -- --
Re: [web2py] Re: web2py 2.0 almost done
This may be ok but where do I get bootswatch_ie.css from? On Thursday, 9 August 2012 11:43:28 UTC-5, AngeloC wrote: Hi Massimo, I think I cannot complete the bootstrap/web2py css merging in time for 2.0, it's really a lot of work and I'm a bit busy these days. Btw, i'm fixing the bug I introduced with issue 896 and I want to share a thought with you. Actually, there is no way to maintain a mobile first approach and make it working on IE other than add something like this to the scaffolding: !-- Makes bootswatch working on IE 7/8 -- !--[if (lt IE 9)] link rel=stylesheet href=/responsivekit/static/css/bootswatch_ie.css ![endif]-- This will make speedier the whole css on not IE browsers because we remove IE specific rules (smaller css), but has the downside to require an extra http get on IE. What do you think? 2012/8/9 Alec Taylor alec.t...@gmail.com javascript: It would be good to have OAuth working for web2py 2 Facebook and LinkedIn still have some issues LinkedIn: https://groups.google.com/forum/#!topic/web2py/SbnQEnXEcOg Facebook: (will add bug report once I've gotten LinkedIn login to work) On Thu, Aug 9, 2012 at 11:25 PM, Massimo Di Pierro massimo@gmail.com javascript: wrote: Can you help us fix the CSS? On Thursday, 9 August 2012 00:29:58 UTC-5, Andrew wrote: Just a note on IE7 navbar behaviour: The Menu has taken a turn for the worse: Initially the Welcome App Sub Menus dissapeared in : welcome css pathc, issue 896, thanks Angelo They then returned in fixed issue qith clicking on toplevel menus except all of the submenus are displayed when the menu first appears and they are all on top of each other. The login options are still blue, and the space between the navbar and Welcome isn't there. See screen shot. On Thursday, August 9, 2012 9:17:17 AM UTC+12, Massimo Di Pierro wrote: more issues have been addressed. In order to fix an issue I had to introduce a slight change of behavior and I am not sure what is the best way to handle it. If you login using a third party service (for example janrain using facebook) and the service sends info about you, if web2py has corresponding fields in auth_user, it stores them. If you edit your profile, logout, change your facebook profile, login again using janrain, should web2py keep the current local profile or update it? The bug report suggested that web2oy should always give preference to the local profile. I changed web2py accordingly. In practice this change will probably not affect anybody because none of the services sends any information stored by auth_user. Yet, please check it. Massimo On Monday, 6 August 2012 23:33:48 UTC-5, Massimo Di Pierro wrote: Web2py 2.0 is almost done. Please try the nightly build. Let us know if it breaks anything. massimo -- -- -- Profile: http://it.linkedin.com/in/compagnucciangelo --
Re: [web2py] Re: Cookie chaos- please see this example
The fact is, there is no default. The default is determined by the browser behavior when the cookie has no attributes. On Thursday, 9 August 2012 11:59:13 UTC-5, Yarin wrote: The book doesn't describe the defaults. I think mentioning that cookies will be set to the specific URL, args and all, would be helpful. On Thu, Aug 9, 2012 at 12:30 PM, Anthony abas...@gmail.com javascript:wrote: To me a default where apps share cookies doesn't seem out of with line with the other things apps share- the default logger for example. Cookies are for end-user functionality; the logger is for development/debugging. For the most part, the apps don't share anything. Just as making an app-specific logger can be achieved by passing request.application to a new instance, so we can prefix app-specific cookies with the app name. To me it's the more obvious default. If the apps are truly independent and unrelated, I would think using a cookie would more likely be for some app-specific functionality. On the other hand, in most cases, you probably don't have multiple apps running on the same domain, or if you do, those apps are related and might need to share cookies. But it still might be safer to require the developer to set the path explicitly. Note, I think this is reasonably well documented in the book: http://web2py.com/books/default/chapter/29/4#Cookies. Anthony -- --
Re: [web2py] Re: Cookie chaos- please see this example
On Thursday, August 9, 2012 12:59:13 PM UTC-4, Yarin wrote: The book doesn't describe the defaults. I think mentioning that cookies will be set to the specific URL, args and all, would be helpful. Note, web2py isn't setting the path at all -- if you don't set a path, there is none. In that case, browsers assume the path of the requested resource -- see http://en.wikipedia.org/wiki/HTTP_cookie#Domain_and_Path. This is not specific to web2py but simply how cookies work. Anyway, I went ahead and added a note to the book pointing this out. Anthony --
Re: [web2py] Re: web2py on appfog
Hi Mandar, I have tried pythonanywhere. You are right that they are slow. They have been having some problems (there is a post on the forums related to that), which they are fixing. It appears they are also going to move from Apache to nginx server. I hope speeds improve once they have fixed the issues, since their customer service is first class and their prices are better than other hosts. On Thu, Aug 9, 2012 at 12:43 AM, Mandar Vaze mandarv...@gmail.com wrote: I have been using pythonanywhere last few days (Free account for testing purposes) Deployment is easy - They have a big deploy web2py app button :) They give you access to bash/mysql console via browser - Very nice. Paid accounts get native ssh access too. Their response time for support queries also has been decent. Only problem - it seems slow. I say seems because I have no benchmark numbers. Since I'm new to web2py - it maybe problem with how i've coded my app. Anyone else using pythonanywhere ? Especially paid account ? Would you recommend it for long term and/or production deployment ? -Mandar On Sunday, August 5, 2012 11:26:00 PM UTC+5:30, curiouslearn wrote: Thanks for sharing that Spiffytech. I think it would be helpful to new users like me if on web2py page we collect information on which are good hosts and easy instructions on how to deploy web2py on these hosts. On Sun, Jul 29, 2012 at 12:04 AM, spiffytech spiff...@gmail.com wrote: Tonight I threw up a copy of my personal site, just to see if AppFog is worth looking into. Perhaps my experience would have been better if I tried during business hours while their live chat support was open, but I don't plan to use AppFog after this experience. The highlights: They advertise unlimited apps, but you're limited by how many apps you can squeeze into the RAM your account gets. Sure, you don't have the hard cap of 10 apps like App Engine (still?) gives you, but unlimited isn't really true AppFog's founder wants you to believe they're proving PaaS doesn't have to be slow and expensive, but I found AppFog to be slow, and their pricing gets nutty-expensive very fast Getting my app working at all was a trying experience, and AppFog doesn't offer much in the way of documentation or debug output to help you No sign of a cron system, so you'll be relying on web2py's built-in cron (didn't check if it works there, but I assume so) All apps have a 100MB disk limit, and I don't see a way to buy more. Better hope you're apps don't get very big! You do have a writable filesystem, for what that's worth with the 100MB disk use limit. I didn't check whether all instances access the same FS (that's kind of an important way so design the service) My conclusion: If you want a free place to host something that (really, really) doesn't need to be performant, AppFog is a decent choice because: It has a writable filesystem, which sets it apart from App Engine It has MySQL, which sets it apart from App Engine It looks more likely to stick around than some of the other free web host services that I've seen mentioned here However, to get that free hosting you'll have to put up with terrible performance (or highly variable performance if it magically speeds up by tomorrow morning), poor documentation, and a tricky and opaque setup procedure. On to doing stuff, and statistics! First off, I could not find any links on their site instructing me on how to configure a Python app to work on AppFog. I eventually gave up and resorted to Googling for a tutorial, which led me to this section in AppFog's docs. Not sure how you are supposed to find that. That link isn't too helpful, though- it shows how to make a Flask site that works on AppFog, and links to working Bottle and Django sites, but doesn't spell out how to make a generic WSGI site work. To make my simple web2py site work, I had to do the following: mv wsgihandler.py wsgi.py # AppFog needs wsgi.py. I tried a symlink instead of a move, but couldn't make AppFog work in that arrangement ln -s wsgi.py wsgihandler.py # This ensures updates to web2py affect your wsgi.py gem install af af login af push appname # This gives you an Amazon East app. I can't figure out how to use `af` to deploy to a different infrastructure I tried creating an app on the Rackspace infrastructure through AppFog's web admin `af update appname`, but couldn't get my app to start. It didn't start automatically, and `af start appname --debug` tells me I don't have the run mode available. So no Rackspace for me. Once I got my app running on AppFog's Amazon EC2 infrastructure (after a number of false starts related to not having wsgi.py) I noticed my app ran very slowly. The front page of my app doesn't really do anything; it could almost be a static HTML file, yet it was unbearably slow on
[web2py] Table helper functions
Hi got a rather complex table which displays database entries in short form with links to the full display of that entry. here is a shortened version of the currently working table I used a for loop to create each row trtd{{=i.Title}}/tdtd{{=XML( .join(i.Content.split( )[0:25]) )}}...{{=A(more,_href=URL(r=request,f='Article',vars=dict(id=i.id)))}}/td/tr I like to convert this html to the python helper functions. Because they just look a lot nicer. but I just can't do the conversion I either get error messages of invalid syntax or I get no display at all if I remove the equal signs. The endresult look something like this: TR(TD(...),TD(...),...,_class=TRclass) Thanks for your help guys. --
[web2py] Re: Table helper functions
This should do it: TR(i.title,XML( .join(i.Content.split( )[0:25]),A(more,_href=URL(r=request,f='Article',vars=dict(id=i.id Notice the TD are automatic when obvious. On Thursday, 9 August 2012 12:44:19 UTC-5, BlueShadow wrote: Hi got a rather complex table which displays database entries in short form with links to the full display of that entry. here is a shortened version of the currently working table I used a for loop to create each row trtd{{=i.Title}}/tdtd{{=XML( .join(i.Content.split( )[0:25]) )}}...{{=A(more,_href=URL(r=request,f='Article',vars=dict(id=i.id )))}}/td/tr I like to convert this html to the python helper functions. Because they just look a lot nicer. but I just can't do the conversion I either get error messages of invalid syntax or I get no display at all if I remove the equal signs. The endresult look something like this: TR(TD(...),TD(...),...,_class=TRclass) Thanks for your help guys. --
Re: [web2py] Re: Cookie chaos- please see this example
Thanks Anthony- much clearer On Thu, Aug 9, 2012 at 1:22 PM, Anthony abasta...@gmail.com wrote: On Thursday, August 9, 2012 12:59:13 PM UTC-4, Yarin wrote: The book doesn't describe the defaults. I think mentioning that cookies will be set to the specific URL, args and all, would be helpful. Note, web2py isn't setting the path at all -- if you don't set a path, there is none. In that case, browsers assume the path of the requested resource -- see http://en.wikipedia.org/wiki/HTTP_cookie#Domain_and_Path. This is not specific to web2py but simply how cookies work. Anyway, I went ahead and added a note to the book pointing this out. Anthony -- --
[web2py] Just a quick eyeball on this, perhaps?
Can anyone tell just by looking at this what the problem with the ID and Star fields might be? The record is actually fine. When I click Edit, everything is as it should be. Sorry for not providing the full background on this, for brevity's sake. Was wondering if someone can see the problem just by looking at this. https://lh6.googleusercontent.com/-eS6fJPgPv5k/UCMiWvEM_7I/AAc/NzibaZS3H_Y/s1600/Screen+shot+2012-08-08+at+10.35.52+PM.png --
Re: [web2py] favicon
Gone! Richard On Wed, Aug 8, 2012 at 2:25 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I removed and moved the favicon(s) in the images subfolder. Chan you please check it? On Wednesday, 8 August 2012 13:14:04 UTC-5, Richard wrote: Hello, I read this comment in layout of welcome app for 1.99.4 (sorry if it gone) : !-- Place favicon.ico and apple-touch-icon.png in the root of your domain and delete these references -- It is about those 2 lines : link rel=shortcut icon href={{=URL('static','**favicon.ico')}} type=image/x-icon link rel=apple-touch-icon href={{=URL('static','**favicon.png')}} I think that those links are the proper way to insert favicon base on w3c : http://www.w3.org/2005/10/**howto-faviconhttp://www.w3.org/2005/10/howto-favicon So the comment is miss leading I think. Should be remove if still there! Richard -- --
[web2py] Re: Just a quick eyeball on this, perhaps?
move_id is None because either the reference does not exist, or the record it points to is represented as None star looks to be a Set, or the results of a query. something has gone wrong in the setup of the table or in the representation of that field. On Thursday, August 9, 2012 1:00:06 PM UTC-7, Mike Girard wrote: Can anyone tell just by looking at this what the problem with the ID and Star fields might be? The record is actually fine. When I click Edit, everything is as it should be. Sorry for not providing the full background on this, for brevity's sake. Was wondering if someone can see the problem just by looking at this. https://lh6.googleusercontent.com/-eS6fJPgPv5k/UCMiWvEM_7I/AAc/NzibaZS3H_Y/s1600/Screen+shot+2012-08-08+at+10.35.52+PM.png --
[web2py] Re: Web2Py compute fields not working on update
If you look at issue 822 you will see an example of a thumb that works on update. As the comments say, you have to not set writeable to false for the thumb. If you do set writeable to false then compute only works on add not edit or update. So my experience is that compute for images to create a thumb does work on update. Peter On Thursday, August 9, 2012 5:04:28 PM UTC+1, Brandon Reynolds wrote: Has anyone found a way to fix this yet? Or is there a thumbnail module out now? Like django's http://djangothumbnails.com/ Brandon On Monday, June 18, 2012 10:24:05 AM UTC-6, Brandon Reynolds wrote: I have this problem when i try to generate thumbnails. If the field is empty it inserts the photo thumb into the thumbnail. But when i try to update that record the thumbnail doesn't change. Here is my model: # coding: utf8 from image import THUMBER db.define_table('park', Field('park_name', requires=IS_NOT_EMPTY()), Field('park_city', requires=IS_NOT_EMPTY()), Field('park_state', requires=IS_NOT_EMPTY()), Field('park_address', requires=IS_NOT_EMPTY()), Field('park_zip', requires=IS_NOT_EMPTY()), Field('country', default=USA, notnull=True, readable=False, writable=False), Field('park_phone', requires=IS_MATCH('[\d\-\(\) ]+')), Field('park_fax', requires=IS_EMPTY_OR(IS_MATCH('[\d\-\(\) ]+'))), Field('park_phone_2', 'string', requires=IS_EMPTY_OR(IS_MATCH('[\d\-\(\) ]+'))), Field('photo1', 'upload'), Field('photo_thumb1', 'upload', readable=False, writable=False), Field('photo2', 'upload'), Field('photo_thumb2', 'upload', readable=False, writable=False), Field('photo3', 'upload'), Field('photo_thumb3', 'upload', readable=False, writable=False), Field('photo4', 'upload'), Field('photo_thumb4', 'upload', readable=False, writable=False), Field('photo5', 'upload'), Field('photo_thumb5', 'upload', readable=False, writable=False), Field('manager', requires=IS_NOT_EMPTY()), Field('manager_email', requires=IS_EMAIL()), Field('spaces', 'integer', requires=IS_NOT_EMPTY()), Field('vacant', 'integer'), Field('lot_rent', 'integer', requires=IS_NOT_EMPTY()), Field('water', 'boolean'), Field('sewer', 'boolean'), Field('trash', 'boolean'), Field('pool', 'boolean'), Field('playground', 'boolean'), Field('clubhouse', 'boolean'), Field('laundromat', 'boolean'), Field('rv_spaces', 'boolean'), Field('storage', 'boolean'), Field('handicap_accessible', 'boolean'), Field('community_description', 'text'), format='%(park_name)s') db.define_table('home', Field('pid', notnull=True, readable=False, writable=False), Field('lot'), Field('year', length=4, requires=IS_NOT_EMPTY()), Field('make'), Field('model'), Field('width', requires=IS_NOT_EMPTY()), Field('length', requires=IS_NOT_EMPTY()), Field('wide', requires=IS_NOT_EMPTY()), Field('for_sale', 'boolean', default=True), Field('beds', requires=IS_NOT_EMPTY()), Field('baths', requires=IS_NOT_EMPTY()), Field('fridge', 'boolean'), Field('stove', 'boolean'), Field('dishwasher', 'boolean'), Field('microwave', 'boolean'), Field('washer', 'boolean'), Field('dryer', 'boolean'), Field('photo1', 'upload'), Field('photo1_text'), Field('photo_thumb1', 'upload', readable=False, writable=False), Field('photo2', 'upload'), Field('photo2_text'), Field('photo_thumb2', 'upload', readable=False, writable=False), Field('photo3', 'upload'), Field('photo3_text'), Field('photo_thumb3', 'upload', readable=False, writable=False), Field('photo4', 'upload'), Field('photo4_text'), Field('photo_thumb4', 'upload', readable=False, writable=False), Field('photo5', 'upload'), Field('photo5_text'), Field('photo_thumb5', 'upload', readable=False, writable=False), Field('price',requires=IS_NOT_EMPTY()), Field('description', 'text', requires=IS_NOT_EMPTY()), Field('posted_on', 'datetime', readable=False, writable=False)) db.define_table('state', Field('name'), Field('full_name')) db.define_table('wide', Field('type'), format='%(type)s') db.park.park_state.requires = IS_IN_DB(db, 'state.name', '%(full_name)s (%(name)s)', zero=T('Select State')) db.home.wide.requires = IS_IN_DB(db, 'wide.type', '%(type)s', zero=T('Select Home Type')) db.park.photo_thumb1.compute = lambda row: THUMBER(row.photo1, photo_thumb1, 144, 115) db.park.photo_thumb2.compute = lambda row: THUMBER(row.photo2, photo_thumb2, 144, 115) db.park.photo_thumb3.compute = lambda row: THUMBER(row.photo3, photo_thumb3, 144, 115) db.park.photo_thumb4.compute = lambda row: THUMBER(row.photo4, photo_thumb4, 144, 115) db.park.photo_thumb5.compute = lambda row: THUMBER(row.photo5, photo_thumb5, 144, 115) db.home.photo_thumb1.compute = lambda row: THUMBER(row.photo1, photo_thumb1, 144, 115) db.home.photo_thumb2.compute = lambda row: THUMBER(row.photo2, photo_thumb2, 144, 115) db.home.photo_thumb3.compute = lambda row: THUMBER(row.photo3, photo_thumb3, 144, 115) db.home.photo_thumb4.compute = lambda row: THUMBER(row.photo4,
Re: [web2py] Problems with restful + PUT
try to replace return dict(GET=GET, POST=POST, PUT=PUT, DELETE=DELETE) withreturn locals() I dont know, but maybe its the problem On Wed, Aug 8, 2012 at 10:49 PM, Tito Garrido titogarr...@gmail.com wrote: Hi folks, *I have a simple table:* *db.define_table('estadio', Field('cod_estadio','id'), Field('nome_estadio'), Field('cidade'),migrate=False) * *A simple entry:* *estadio.cod_estadio**estadio.nome_estadio* *estadio.cidade**1**A Definir* *A Definir* and using Bruno's example in web2pyslice: 1. @request.restful() 2. def api(): 3. response.view = 'generic.'+request.extension 4. def GET(*args,**vars): 5. patterns = 'auto' 6. parser = db.parse_as_rest(patterns,args,vars) 7. if parser.status == 200: 8. return dict(content=parser.response) 9. else: 10. raise HTTP(parser.status,parser.error) 11. def POST(table_name,**vars): 12. return db[table_name].validate_and_insert(**vars) 13. def PUT(table_name,record_id,**vars): 14. return db(db[table_name]._id==record_id).update(**vars) 15. def DELETE(table_name,record_id): 16. return db(db[table_name]._id==record_id).delete() 17. return dict(GET=GET, POST=POST, PUT=PUT, DELETE=DELETE) *but when I try to:* * curl -i -H Accept: application/json -X PUT -d nome_estadio='teste http://127.0.0.1:8080/ws/default/api/estadio/cod-estadio/1.json* *it returns:* HTTP/1.1 400 BAD REQUEST Server: nginx Date: Thu, 09 Aug 2012 01:41:44 GMT Content-Type: text/html; charset=UTF-8 Connection: keep-alive Set-Cookie: session_id_ws=xx-65e0b712-7d93-4b21-a553-d06ce06af2a2; Path=/ Content-Length: 540 invalid arguments!-- //-- *What am I missing here? Thanks in advance!* -- Linux User #387870 . _/_õ|__| ..º[ .-.___.-._| . . . . .__( o)__( o).:___ -- --
[web2py] Re: DAL belongs() fails on App Engine
the query and the error message do not match. your query has no orderby, yet the error message suggests there is an orderby property set. this confuses me. i do: db(db.table.id.belongs([list of items not more than 30 long])).select() all the time on GAE and it works for me (latest stable web2py, and the last time i checked trunk though that was a few weeks ago) note that cache does nothing on selects on GAE due to the inability to serialize Rows objects to memcache (at least i think that is the limitation) cfh On Thursday, August 9, 2012 10:40:33 AM UTC-7, spiffytech wrote: I'm trying to use the DAL belongs clause on App Engine and am getting an error. posts = db(db.posts.id.belongs(post_ids)).select(db.posts.ALL, cache=( cache.ram, 60)) Produces: BadArgumentError: First ordering property must be the same as inequality filter property, if specified for this query; received __key__, expected post_date Some Googling suggests this can be due to not providing a sort key. I tried orderby=db.posts.post_date with no success. What could be going wrong? I'm using the latest trunk web2py, but tested all the way back to 1.99.3. --
[web2py] Re: Anybody run web2py apps on GAE in production?
i think there are other threads on this (or at least similar) topics. i have multiple live apps on GAE: www.starmakerstudios.com (plus iOS backend services) www.diginn.com www.elizabethscanvas.org they all have *very* different usage profiles and costs. given that i have spend 0 hours doing sysadmin on production GAE servers in years it has been worth it to me. my largest app probably would need at least a half time sysadmin to keep running smoothly. though i did get bit by google's pricing model change last year and it took lots of developer hours to adjust to the new pricingbut we have cleaner much more efficient code as a result. instances run from 1 to as much as 40 depending on which app/traffic. my highest usage app gets 30-50 requests per second on average. i use datastore cause cloud SQL didn't exist when i started. i suspect datastore is cheaper, though i don't know. it depends on your app type for hosting on GAE. don't do stats processing on GAE - the request limitations are horrible to deal with. if you serve lots of short requests that display small/medium amounts of data, or update individual bits of data at a time it seems to be pretty good. think through the types of request you want to do, and the costs of sysadmin vs working in the GAE way. that should give your a way to frame your debate. feel free to ask more questions cfh On Thursday, August 9, 2012 2:16:56 AM UTC-7, Alexei Vinidiktov wrote: Hi, If you run a web2py powered app on GAE in production, could you share your experiences? Is it very expensive for your needs? Are you OK with the pricing? How many instances do you run simultaneously on average? What kind of traffic do you get? How many requests per second do your apps serve? Do you use Datastore or Cloud SQL? Why? Would you recommend hosting web2py apps on GAE? Thanks! -- Alexei Vinidiktov --
[web2py] Re: DAL belongs() fails on App Engine
I've narrowed the problem down further- the exception is caused by a common_filter attached to my posts table: common_filter = lambda query: db.posts.post_date = request.now I'm not sure why that would trigger the orderby error, though. Also, is there some significance to limiting the belongs lists to 30 items? On Thursday, August 9, 2012 4:24:13 PM UTC-4, howesc wrote: the query and the error message do not match. your query has no orderby, yet the error message suggests there is an orderby property set. this confuses me. i do: db(db.table.id.belongs([list of items not more than 30 long])).select() all the time on GAE and it works for me (latest stable web2py, and the last time i checked trunk though that was a few weeks ago) note that cache does nothing on selects on GAE due to the inability to serialize Rows objects to memcache (at least i think that is the limitation) cfh On Thursday, August 9, 2012 10:40:33 AM UTC-7, spiffytech wrote: I'm trying to use the DAL belongs clause on App Engine and am getting an error. posts = db(db.posts.id.belongs(post_ids)).select(db.posts.ALL, cache=( cache.ram, 60)) Produces: BadArgumentError: First ordering property must be the same as inequality filter property, if specified for this query; received __key__, expected post_date Some Googling suggests this can be due to not providing a sort key. I tried orderby=db.posts.post_date with no success. What could be going wrong? I'm using the latest trunk web2py, but tested all the way back to 1.99.3. --
[web2py] Re: Just a quick eyeball on this, perhaps?
I guess so, but it's fairly straightforward. Like I said, when I click on the actual record, the movie and star fields are correctly populated. On Thursday, August 9, 2012 4:18:25 PM UTC-4, howesc wrote: move_id is None because either the reference does not exist, or the record it points to is represented as None star looks to be a Set, or the results of a query. something has gone wrong in the setup of the table or in the representation of that field. On Thursday, August 9, 2012 1:00:06 PM UTC-7, Mike Girard wrote: Can anyone tell just by looking at this what the problem with the ID and Star fields might be? The record is actually fine. When I click Edit, everything is as it should be. Sorry for not providing the full background on this, for brevity's sake. Was wondering if someone can see the problem just by looking at this. https://lh6.googleusercontent.com/-eS6fJPgPv5k/UCMiWvEM_7I/AAc/NzibaZS3H_Y/s1600/Screen+shot+2012-08-08+at+10.35.52+PM.png --
[web2py] SQLFORM and Nyromodal
Hi, I´m have working a custom SQLFORM in update mode, into a modal popup, when I try to submit changes the popup disappear obviously, but it isn't make any changes. But if I try the code out from the modal, it's make the changes without problems... Any Idea? Thanks in advance. Christian. --
[web2py] Re: DAL belongs() fails on App Engine
i had to look up common_filters.based on your experience i would assume that this is being implemented as a query filter rather than getting results from the DB and then filtering them. so what is must be causing in your case is: posts = db((db.posts.id.belongs(post_ids)) (db.posts.post_date=request.now)).select(db.posts.ALL,orderby=db.posts.post_date, cache =(cache.ram, 60)) it *might* work if you put an orderby on that is db.posts.id|db.posts.post_date i'm not sure. you might have to remove the common filter for this query and then filter the results. (i don't have experience with common filters and how they are implemented) GAE has a restriction on IN queries (web2py belongs queries) that they have no more than 30 items in the list. because i said so says google. On Thursday, August 9, 2012 1:57:13 PM UTC-7, spiffytech wrote: I've narrowed the problem down further- the exception is caused by a common_filter attached to my posts table: common_filter = lambda query: db.posts.post_date = request.now I'm not sure why that would trigger the orderby error, though. Also, is there some significance to limiting the belongs lists to 30 items? On Thursday, August 9, 2012 4:24:13 PM UTC-4, howesc wrote: the query and the error message do not match. your query has no orderby, yet the error message suggests there is an orderby property set. this confuses me. i do: db(db.table.id.belongs([list of items not more than 30 long])).select() all the time on GAE and it works for me (latest stable web2py, and the last time i checked trunk though that was a few weeks ago) note that cache does nothing on selects on GAE due to the inability to serialize Rows objects to memcache (at least i think that is the limitation) cfh On Thursday, August 9, 2012 10:40:33 AM UTC-7, spiffytech wrote: I'm trying to use the DAL belongs clause on App Engine and am getting an error. posts = db(db.posts.id.belongs(post_ids)).select(db.posts.ALL, cache=( cache.ram, 60)) Produces: BadArgumentError: First ordering property must be the same as inequality filter property, if specified for this query; received __key__, expected post_date Some Googling suggests this can be due to not providing a sort key. I tried orderby=db.posts.post_date with no success. What could be going wrong? I'm using the latest trunk web2py, but tested all the way back to 1.99.3. --
[web2py] Re: Just a quick eyeball on this, perhaps?
Can you show the model and grid code? On Thursday, August 9, 2012 4:00:06 PM UTC-4, Mike Girard wrote: Can anyone tell just by looking at this what the problem with the ID and Star fields might be? The record is actually fine. When I click Edit, everything is as it should be. Sorry for not providing the full background on this, for brevity's sake. Was wondering if someone can see the problem just by looking at this. https://lh6.googleusercontent.com/-eS6fJPgPv5k/UCMiWvEM_7I/AAc/NzibaZS3H_Y/s1600/Screen+shot+2012-08-08+at+10.35.52+PM.png --
[web2py] Dynamic Ajax Content and Jquery
I guess this is really more of a jquery question but I figured there may be some easier web2py builtin way to do this... I'm doing some custom auto completion on an input field and thought the example from the book made more sense for my usage (as opposed to the built in autocomplete widget). That part is working great: ** book example code: form input type=text id=month name=month style=width: 250px /br / div style=position: absolute; id=suggestions class=suggestions/div /form script jQuery(#month).keyup(function(){ ajax('month_selector', ['month'], 'suggestions')}); /script Okay so the problem I'm having is that instead of Months like the example above, I am returning divs with class of 'button' and using jquery ui to try to turn those into buttons after they are loaded in. I'm having trouble with the jquery syntax here. right now I have: jQuery(.big_search).keyup(function(){ ajax('partial_search', ['big_search'], 'search_hint')}); $('.button').button(); }); The buttons flash for a second and quickly disappear. Can someone throw me some pointers here or a better place to look? Thanks in Advance! --
[web2py] Re: Dynamic Ajax Content and Jquery
Here is your code reformatted: jQuery(.big_search).keyup(function() { ajax('partial_search', ['big_search'], 'search_hint') }); $('.button').button(); }); The call to .button() happens outside the .keyup() callback (unless that was a copy/paste error). Even inside, though, I don't think it will wait for the ajax call to complete. Instead, you might consider using the jQuery .load() or .ajax() functions directly, both of which take a callback (which executes after the ajax call completes). Or you could set up a separate .ajaxSuccess() event handler: jQuery('.big_search').ajaxSuccess(function(e, xhr, settings) { if (settings.url == 'partial_search') { jQuery('.button').button(); } }); Anthony On Thursday, August 9, 2012 6:24:38 PM UTC-4, Mike wrote: I guess this is really more of a jquery question but I figured there may be some easier web2py builtin way to do this... I'm doing some custom auto completion on an input field and thought the example from the book made more sense for my usage (as opposed to the built in autocomplete widget). That part is working great: ** book example code: form input type=text id=month name=month style=width: 250px /br / div style=position: absolute; id=suggestions class=suggestions/div /form script jQuery(#month).keyup(function(){ ajax('month_selector', ['month'], 'suggestions')}); /script Okay so the problem I'm having is that instead of Months like the example above, I am returning divs with class of 'button' and using jquery ui to try to turn those into buttons after they are loaded in. I'm having trouble with the jquery syntax here. right now I have: jQuery(.big_search).keyup(function(){ ajax('partial_search', ['big_search'], 'search_hint')}); $('.button').button(); }); The buttons flash for a second and quickly disappear. Can someone throw me some pointers here or a better place to look? Thanks in Advance! --
[web2py] Re: Dynamic Ajax Content and Jquery
That did it! You were correct that I had a copy and paste error above. I believe you are also correct that I should have done this with .load() instead. I didn't know there was an ajaxSuccess() handler -- I was struggling to try to get it to work with .live() and .delegate() but your method works for me. Thanks again for the help man. Really appreciate web2py and this community. --Mike On Thursday, August 9, 2012 7:02:11 PM UTC-4, Anthony wrote: Here is your code reformatted: jQuery(.big_search).keyup(function() { ajax('partial_search', ['big_search'], 'search_hint') }); $('.button').button(); }); The call to .button() happens outside the .keyup() callback (unless that was a copy/paste error). Even inside, though, I don't think it will wait for the ajax call to complete. Instead, you might consider using the jQuery .load() or .ajax() functions directly, both of which take a callback (which executes after the ajax call completes). Or you could set up a separate .ajaxSuccess() event handler: jQuery('.big_search').ajaxSuccess(function(e, xhr, settings) { if (settings.url == 'partial_search') { jQuery('.button').button(); } }); I'm not familiar with jQuery UI .button(), though, so there may be other problems with your approach. Anthony On Thursday, August 9, 2012 6:24:38 PM UTC-4, Mike wrote: I guess this is really more of a jquery question but I figured there may be some easier web2py builtin way to do this... I'm doing some custom auto completion on an input field and thought the example from the book made more sense for my usage (as opposed to the built in autocomplete widget). That part is working great: ** book example code: form input type=text id=month name=month style=width: 250px /br / div style=position: absolute; id=suggestions class=suggestions/div /form script jQuery(#month).keyup(function(){ ajax('month_selector', ['month'], 'suggestions')}); /script Okay so the problem I'm having is that instead of Months like the example above, I am returning divs with class of 'button' and using jquery ui to try to turn those into buttons after they are loaded in. I'm having trouble with the jquery syntax here. right now I have: jQuery(.big_search).keyup(function(){ ajax('partial_search', ['big_search'], 'search_hint')}); $('.button').button(); }); The buttons flash for a second and quickly disappear. Can someone throw me some pointers here or a better place to look? Thanks in Advance! --
[web2py] Re: Stream a couchdb attachment with web2py
Thanks Massimo, this is working! What I am not able to get is the time-slider to work in the audio element. I guess that since I am streaming the audio file, the browser has no way of knowing the size. Is there a way to solve this problem? Is it possible to send the size of the audio file in the response headers? I am dealing with mp3 files mainly. I am not sure if it is possible to know beforehand (without reading/decoding the full mp3 file) the length of the audio track. I would say that the mp3 format (and other audio formats) must have some metadata at the beginning of the file specifying things like duration, volume, ... but I am not familiar with these details. And as a more general problem: is it possible at all to randomly access a streaming audio file? I would say that this is not possible. Any ideas / workarounds to get the slider working? Thanks, Daniel On Thursday, August 9, 2012 3:29:25 PM UTC+2, Massimo Di Pierro wrote: audio src={{=URL('getme',args='track06.mp3http://www.myserver.com/.../track06.mp3 ')}} preload=auto/audio def getme(): import urllib response.headers['Content-Type'] = 'audio/mp3' filename = ''+request.args(0) # fix this! return response.stream(urllib.urlopen(filename)) On Thursday, 9 August 2012 03:54:43 UTC-5, Daniel Gonzalez wrote: Hello, I have some sound files in a couchdb database (not related to web2py). My web2py application has access to this database, and I want to stream the sound files so that they can be listened with the HTML audio tag, like this: audio src=http://www.myserver.com/.../track06.mp3; preload=auto /audio I am planning to do this streaming as follows: response.stream(open(filename),chunk_size=4096) But I have some open questions: 1. My filename is not in the local filesystem, but in a couchdb database, accessible via REST. How can I open that? 2. What kind of request will the audio tag send when it is activated, GET/POST/...? Can this be handled with web2py? Thanks, Daniel --
[web2py] Re: Just a quick eyeball on this, perhaps?
Model: db.define_table('movie', Field('title','string'), Field('api_id', 'string'), Field('average_rating', 'double'), Field('released', 'integer'), Field('mpaa_rating', 'string'), Field('synopsis', 'text'), Field('short_synopsis', 'text'), Field('created', 'datetime','datetime', default=request.now), Field('modified', 'datetime','datetime', default=request.now), format = '%(title)s') db.define_table('person', Field('name', 'string'), Field('api_id', 'string'), Field('birthday', 'date'), Field('created', 'datetime','datetime', default=request.now), Field('modified', 'datetime','datetime', default=request.now), format = '%(name)s') db.define_table('star', Field('movie_id', db.movie), Field('star', db.person), Field('created', 'datetime','datetime', default=request.now), Field('modified', 'datetime','datetime', default=request.now)) Grid code: @auth.requires_login() def manage_movies(): grid = SQLFORM.smartgrid(db.movie) return locals() Thanks for taking a look. Apologies if this is a really lame mistake. Trust that I do RTFM. On Thursday, August 9, 2012 6:16:58 PM UTC-4, Anthony wrote: Can you show the model and grid code? On Thursday, August 9, 2012 4:00:06 PM UTC-4, Mike Girard wrote: Can anyone tell just by looking at this what the problem with the ID and Star fields might be? The record is actually fine. When I click Edit, everything is as it should be. Sorry for not providing the full background on this, for brevity's sake. Was wondering if someone can see the problem just by looking at this. https://lh6.googleusercontent.com/-eS6fJPgPv5k/UCMiWvEM_7I/AAc/NzibaZS3H_Y/s1600/Screen+shot+2012-08-08+at+10.35.52+PM.png --
[web2py] Re: Just a quick eyeball on this, perhaps?
I fixed it. My column names were screwed up. Sorry. On Thursday, August 9, 2012 11:20:31 PM UTC-4, Mike Girard wrote: Model: db.define_table('movie', Field('title','string'), Field('api_id', 'string'), Field('average_rating', 'double'), Field('released', 'integer'), Field('mpaa_rating', 'string'), Field('synopsis', 'text'), Field('short_synopsis', 'text'), Field('created', 'datetime','datetime', default=request.now), Field('modified', 'datetime','datetime', default=request.now), format = '%(title)s') db.define_table('person', Field('name', 'string'), Field('api_id', 'string'), Field('birthday', 'date'), Field('created', 'datetime','datetime', default=request.now), Field('modified', 'datetime','datetime', default=request.now), format = '%(name)s') db.define_table('star', Field('movie_id', db.movie), Field('star', db.person), Field('created', 'datetime','datetime', default=request.now), Field('modified', 'datetime','datetime', default=request.now)) Grid code: @auth.requires_login() def manage_movies(): grid = SQLFORM.smartgrid(db.movie) return locals() Thanks for taking a look. Apologies if this is a really lame mistake. Trust that I do RTFM. On Thursday, August 9, 2012 6:16:58 PM UTC-4, Anthony wrote: Can you show the model and grid code? On Thursday, August 9, 2012 4:00:06 PM UTC-4, Mike Girard wrote: Can anyone tell just by looking at this what the problem with the ID and Star fields might be? The record is actually fine. When I click Edit, everything is as it should be. Sorry for not providing the full background on this, for brevity's sake. Was wondering if someone can see the problem just by looking at this. https://lh6.googleusercontent.com/-eS6fJPgPv5k/UCMiWvEM_7I/AAc/NzibaZS3H_Y/s1600/Screen+shot+2012-08-08+at+10.35.52+PM.png --
[web2py] Re: Initialize one-time configuration data in DB
If they must be in the database, use a script to import them and run it once python web2py.py -S yourapp -M -N -R yourscript.py Yes, the data must be in the db. By 'import them' in the script, do you mean import the database abstraction layer stuff by web2py, and use it to insert the data? Thanks! --
[web2py] auth.user_group_role() method
This method seems to be still in trunk (http://code.google.com/p/web2py/source/browse/gluon/tools.py#2832), as I cannot find it in the latest stable. It takes a user id and return the name/role of the group that user is in. However, it doesn't seem to be able to work with custom groups. For example, if I do auth.settings.create_user_groups = False and create two custom groups (e.g. 'students' and 'teachers') to accomodate all the users. This auth.user_group_role() method probably will fail because it assume that every group follows the naming convention which is set by: http://code.google.com/p/web2py/source/browse/gluon/tools.py#963. Can someone confirm whether this is indeed the case. Thanks! --
[web2py] Re: auth.user_group_role() method
I don't think that's the purpose of this method. It appears its only purpose is to provide the user-specific role assigned to each user upon registration, which is only relevant if auth.settings.create_user_groups is set. It might be a good idea if it checked for auth.settings.create_user_groups and returned None in that case rather than generating an error, though. Anthony On Friday, August 10, 2012 12:14:20 AM UTC-4, cyan wrote: This method seems to be still in trunk ( http://code.google.com/p/web2py/source/browse/gluon/tools.py#2832), as I cannot find it in the latest stable. It takes a user id and return the name/role of the group that user is in. However, it doesn't seem to be able to work with custom groups. For example, if I do auth.settings.create_user_groups = False and create two custom groups (e.g. 'students' and 'teachers') to accomodate all the users. This auth.user_group_role() method probably will fail because it assume that every group follows the naming convention which is set by: http://code.google.com/p/web2py/source/browse/gluon/tools.py#963. Can someone confirm whether this is indeed the case. Thanks! --
Re: [web2py] Re: web2py 2.0 almost done
Hi Massimo, I'm writing it right now to fix ie issues! Please be patient until fixed! 2012/8/9 Massimo Di Pierro massimo.dipie...@gmail.com This may be ok but where do I get bootswatch_ie.css from? On Thursday, 9 August 2012 11:43:28 UTC-5, AngeloC wrote: Hi Massimo, I think I cannot complete the bootstrap/web2py css merging in time for 2.0, it's really a lot of work and I'm a bit busy these days. Btw, i'm fixing the bug I introduced with issue 896 and I want to share a thought with you. Actually, there is no way to maintain a mobile first approach and make it working on IE other than add something like this to the scaffolding: !-- Makes bootswatch working on IE 7/8 -- !--[if (lt IE 9)] link rel=stylesheet href=/responsivekit/static/** css/bootswatch_ie.css ![endif]-- This will make speedier the whole css on not IE browsers because we remove IE specific rules (smaller css), but has the downside to require an extra http get on IE. What do you think? 2012/8/9 Alec Taylor alec.t...@gmail.com It would be good to have OAuth working for web2py 2 Facebook and LinkedIn still have some issues LinkedIn: https://groups.google.com/**forum/#!topic/web2py/**SbnQEnXEcOghttps://groups.google.com/forum/#!topic/web2py/SbnQEnXEcOg Facebook: (will add bug report once I've gotten LinkedIn login to work) On Thu, Aug 9, 2012 at 11:25 PM, Massimo Di Pierro massimo@gmail.com wrote: Can you help us fix the CSS? On Thursday, 9 August 2012 00:29:58 UTC-5, Andrew wrote: Just a note on IE7 navbar behaviour: The Menu has taken a turn for the worse: Initially the Welcome App Sub Menus dissapeared in : welcome css pathc, issue 896, thanks Angelo They then returned in fixed issue qith clicking on toplevel menus except all of the submenus are displayed when the menu first appears and they are all on top of each other. The login options are still blue, and the space between the navbar and Welcome isn't there. See screen shot. On Thursday, August 9, 2012 9:17:17 AM UTC+12, Massimo Di Pierro wrote: more issues have been addressed. In order to fix an issue I had to introduce a slight change of behavior and I am not sure what is the best way to handle it. If you login using a third party service (for example janrain using facebook) and the service sends info about you, if web2py has corresponding fields in auth_user, it stores them. If you edit your profile, logout, change your facebook profile, login again using janrain, should web2py keep the current local profile or update it? The bug report suggested that web2oy should always give preference to the local profile. I changed web2py accordingly. In practice this change will probably not affect anybody because none of the services sends any information stored by auth_user. Yet, please check it. Massimo On Monday, 6 August 2012 23:33:48 UTC-5, Massimo Di Pierro wrote: Web2py 2.0 is almost done. Please try the nightly build. Let us know if it breaks anything. massimo -- -- -- Profile: http://it.linkedin.com/in/**compagnucciangelohttp://it.linkedin.com/in/compagnucciangelo -- -- Profile: http://it.linkedin.com/in/compagnucciangelo --