[web2py] Re: SQLFORM.smartgrid: TSV CSV export with hidden cols only shows visible cols
Yes, I've found the bug, too. But I can confirm as fixed in current trunk = Version 2.4.1 alpha.2 (2013-01-30 14:25:06) Cheers, Nico -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Debugging in a server
Hello Mariano, Regarding to the tickets I've seen that they are stored in my errors directory, so I can read them there (they are not well formatted, but at least I can see the error). For me is more important how to insert and read traces, and following your idea I will check if there is any logging facility in my server admin panel. I will try python logging module too. Thank you very much! El viernes, 1 de febrero de 2013 03:41:29 UTC+1, Mariano Reingart escribió: AFAIK you could store the tickets in the db or coping the files and open them locally (maybe in another web2py instance) Code traces will go to your web server logging facility (if any). If you cannot access that, you could create a temp file and write the logs there. For more advanced methods, please check also the python logging module. Best regards, Mariano Reingart http://www.sistemasagiles.com.ar http://reingart.blogspot.com On Wed, Jan 30, 2013 at 4:09 PM, Wonton rfer...@gmail.com javascript: wrote: Hello everyone, Finally I have my project working in my local server so I've uploaded it to the real server (via FTP to the applications directory). It's working almost perfctly, but some features are giving errors and other are simply not working (they return incorrect data). My problem, I have no admin access to the server (https is disabled by the server admin and nowadays it's not possible to enable it). The errors return their tickets but the errors directories, both in my project directory and in admin directory, are empty. In this environment how could I debug my project? Is there any way to check the tickets? And is there any way to insert code traces to check what is happening? I inserted this code when debugging locally and saw the traces in my terminal, but now, running web2py in the server, I can't launch it from a terminal, so where could I see my traces?. Any help will be very appreciated. Kind regards! -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: create query for join multiple table
Your model is not saving somewhere the company_id related to a sale. (i.e. if multiple users have the same company, then this query won't return all the sales of the given company) If all data in company means all data of the current user then it's easy. db( (db.auth_user.id == auth.user_id) (db.sale.created_by == db.auth_user.id) (db.company.id == db.auth_user.company_id) # (db.product.id == db.sale.product_id) ##just if you want to fetch product details ).select() If instead means all data of the company the current user belongs to then it's easier to split it in two queries company_id = db(db.auth_user.id == auth.user_id).select().first().company_id db( (db.auth_user.company_id == company_id) (db.sale.created_by == db.auth_user.id) (db.company.id == db.auth_user.company_id) # (db.product.id == db.sale.product_id) ##just if you want to fetch product details ).select() On Friday, February 1, 2013 7:45:35 AM UTC+1, 黄祥 wrote: hi, how to create query for join multiple table? my goal is to select all data in company and show it in invoice page. *db.sale.created_by* refer to *db.auth_user.id* *db.auth_user.company_id* refer to *db.company.id* * * any suggestion, solutions or hints for this case? * * here is the model that i've used and some of query that i've tested in controller but have not work. *# model :* auth = Auth(db) db.define_table('company', Field('company_name', label=T('Company Name')), Field('address', 'text', label=T('address')), Field('zip', label=T('Zip')), Field('city', label=T('City')), Field('country', label=T('Country')), Field('phone', label=T('Phone')), Field('fax', label=T('Fax')), Field('email', label=T('Email')), Field('website', label=T('Website')), auth.signature, format='%(company_name)s') auth.settings.extra_fields['auth_user']=[ Field('address', 'text', label=T('address')), Field('zip', label=T('Zip')), Field('city', label=T('City')), Field('country', label=T('Country')), Field('phone', label=T('Phone')), Field('company_id', 'reference company', label=T('Company ID'))] auth.define_tables(username=False, signature=False) db.define_table('product', Field('product_name', label=T('Product Name')), Field('quantity', 'integer', label=T('Quantity')), Field('unit_price', 'double', label=T('Unit Price')), auth.signature, format='%(product_name)s') db.define_table('sale', Field('invoice_no', label=T('Invoice No.')), Field('product_id', 'reference product', label=T('Product ID')), Field('quantity', 'integer', label=T('Quantity')), Field('unit_price', 'double', label=T('Unit Price')), Field('total_price', 'double', label=T('Total Price')), Field('grand_total', 'double', label=T('Grand Total')), Field('note', 'text', label=T('Note')), auth.signature) the controller i've tried to use but have not run : *first* rows= db((db.company.id==db.auth_user.company_id) (db.sale.created_by==db.auth_user.id)).select().first() *second* people_and_their_companies=db(db.auth_user.company_id==db.company.id) row=people_and_their_companies(db.sale.created_by==request.args (0)).select().first() *third* invoices_created_by=db(db.sale.invoice_no==request.args(0)).select(db.sale.created_by).first() query=(db.auth_user.id==invoices_created_by)(db.auth_user.company_id== db.company.id) rows=db(query).select() *fourth* invoices_created_by=db(db.sale.invoice_no==request.args(0)).select(db.sale.created_by).first() companies=db(db.company.id==db.auth_user.company_id)(db.company.id ==invoices_created_by.created_by).select().first() thank you so much before -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: wiki: how to cache media files?
you have to alter the default download() function to return cache headers. The theoretical problem is that web2py (and then the wiki) doesn't know when the image stored in a table would be updated, so it doesn't issue any cache headers by default. On Thursday, January 31, 2013 9:49:21 PM UTC+1, Paolo valleri wrote: Hi all, today I discovered that wiki media, actually they are all images, they are always requested to the server and never cached by the client. In other words, even if I have already visited the page I do a get to download all the images instead of using those in the browser cache as commonly happens with for js or css. Is it a problem of my configuration or of wiki it self? paolo -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Preferred method for banning email domains from registering?
You're right. I remember having disproportionate trouble getting the @ sign in the regex and never bothered revisiting the code to add it in. (My original code was for internal company use and used force='..regex_here...' to ensure the emails were from a set number of internal domains, so it wasn't so important)... On Friday, February 1, 2013 3:21:55 AM UTC, rh wrote: On Thu, 31 Jan 2013 07:31:22 -0800 (PST) Andrew Buchan andy...@gmail.com javascript: wrote: Lamps, I believe using banned is the best way of doing it. You would cover multiple domains in the regex. The following snippet would ensure that addresses ending in gmail.com or hotmail.com fail registration... auth_table.email.requires = [ IS_EMAIL(error_message = auth.messages.invalid_email, banned = '^.*gmail\.com$|^.*hotmail\.com$'), IS_NOT_IN_DB(db, auth_table.email) ] This would also match blogmail.com or redhotmail.com, etc. better to be more specific but I'm not sure what happens to those values. That list would get cumbersome if you had to block many domains. regards, Andy. On Thursday, January 31, 2013 12:29:18 PM UTC, Lamps902 wrote: Hi, web2py users. Is there a preferred method for banning a set of email domains from registering? I know that the IS_EMAIL() validator has a banned parameter, but is this the best way to go about this task? If so, is there a way to pass multiple domains to the banned parameter (I don't think it accepts a list)? Also, is this: ('^.*\domain_you_want_to_ban.com(|\..*)$') a reasonable regex for this purpose? Thank you. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py +unsub...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] IDE plugin what to use?
Hi I am totally new to web2py and thinking of skipping Django to get things done in Web2py instead. But - I really like working in an IDE if possible. Is there any Eclipse web2py plugin - I find it quite messy to add headers for every controller manually. Learned about WingIDE but I dont like non FOSS software at all. Sincerely yours Mika -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Web2Py on OpenShift
Hello, On Friday, June 8, 2012 8:37:39 PM UTC+5:30, Andrew wrote: You can find it here: - https://github.com/prelegalwonder/openshift_web2py I followed this guide. This is what I have : I've created an application which stays in application folder of web2py source. I did following to push the app on open shift : 1) Created OpenShift account. Setting up environment on my ubuntu machine. 2) Using rhc app create -a web2py -t python-2.6 I created the web2py folder/application on my system and open shift account. 3) Then I've copied all the content which includes the web2py source and above application inside folder created in step 2. 4) The I did : (a) git add . (b) git commit -a -m message (c) git push 5) Everything works fine and the application/web2py is deployed. However when I go to the app URL. It still showing : Welcome To OpenShift page. I did appended following to the app URL : appURL/welcome/default/index still web2py isn't up. May anyone please let me know where am I going wrong ? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] cache.shelve files cause lockups when moved between 32 64 bit machines
I have two computers that I work on: a 32-bit netbook and a 64-bit desktop. Sometimes I will rsync my entire working copy of the web2py application I'm working on from one machine to the other, rather than getting a fresh copy. When I do this from the netbook to the desktop, the web2py server starts normally (no error messages), but when I try to access the application, the web browser hangs forever. One really strange side effect is that it also attempts to open a connection to the IP address 64.99.64.32. (I'm not sure what significance this IP has, but if you Google it you see a number of other pieces of software that also appear to use it when things go wrong.) Anyhow, the first thing I tried -- deleting all the .pyc files -- had no effect, so I did a full diff between the directory tree from the netbook, versus a fresh copy checked out directly to the 64-bit machine, and the only thing that differed was the ./web2py/applications/*/cache/cache.shelve files. I deleted them, and everything worked normally again. Is this a known issue? Is it Python's fault for not knowing that a .shelve file came from the wrong architecture? Or should I just be doing a make clean from web2py every time I'm on a different machine (I notice that removing all the cache directories is in there)? ~Felix. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] IDE plugin what to use?
Just go with Sublime Text 2! 2013/2/1 Mika Sjöman mikasjo...@gmail.com Hi I am totally new to web2py and thinking of skipping Django to get things done in Web2py instead. But - I really like working in an IDE if possible. Is there any Eclipse web2py plugin - I find it quite messy to add headers for every controller manually. Learned about WingIDE but I dont like non FOSS software at all. Sincerely yours Mika -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: I seem to block the server if I forget about dbg.set_trace
Maybe I'm doing something wrong, because I get the same problem on mac with the latest git. I change the welcome app like so from gluon.debug import dbg def index(): example action using the internationalization operator T and flash rendered by views/default/index.html or views/generic.html if you need a simple wiki simple replace the two lines below with: return auth.wiki() response.flash = T(Welcome to web2py!) dbg.set_trace() return dict(message=T('Hello World')) visit the page (with no debugger open) and the same thing happens. No more connections to the server possible. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Web2py Mail not working yet, telnet and smtplib working
Hi Everyone, Been trying this for a while now with no luck. telnet works 127.0.0.1 25 and I can send mail through that. I then open up python shell and send email successful also, however whenever I want to send a email through web2py I get this in the postfix log: Feb 1 10:45:06 ip-10-248-23-190 sendmail[25678]: r11Aj6Hd025678: localhost [127.0.0.1] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA Has anyone come across this. It's got me stumped. The above statement means it connects and then decides to hangup with out issuing any command. This is my mailing code. mail.send(to=['t...@example.com'], subject='Message from Espressobility', message='Some text for the messsage', reply_to='te...@example.com') Simple yet doesn't want to work. Postfix has default settings. This is my mail settings mail= auth.settings.mailer mail.settings.server = 'localhost:25' or '127.0.0.1:25' mail.settings.sender = 'te...@example.com' mail.settings.login = None Look forward to your comments. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Coding of the future?
On Thursday, January 31, 2013 7:26:45 AM UTC-5, Johann Spies wrote: When webeditors become as good as emacs, vim, bluefish, I will consider it. For now I did not find any editor that can compete with them. I am a die-hard Emacs user, but I find the web editing facilities in web2py good enough for just entering code and quick edits. If I was doing major refactoring I think I'd use Emacs, but I can get quite a lot of my day-to-day development done just using the browser-based IDE. In some ways I actually like the minimalism of the web2py development environment. Have you tried Eclipse? That thing has more buttons and dials than the space shuttle. Nick -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: wiki: how to cache media files?
Hi Niphlod, I don't know very well which header I have to set, can you give me an example? The 304 is sent by the server to the user accordingly to the user's request. Given that, If my upload file as a modified_on field I can actually understand if I have to return the whole file (http: 200) or a 304. Is it correct? If yes, I would propose to implement something like that for download(): if the field as the modified_on field we can decide between 200/304, is the field doesn't have the modified_on field we return always a 200. Paolo 2013/2/1 Niphlod niph...@gmail.com you have to alter the default download() function to return cache headers. The theoretical problem is that web2py (and then the wiki) doesn't know when the image stored in a table would be updated, so it doesn't issue any cache headers by default. On Thursday, January 31, 2013 9:49:21 PM UTC+1, Paolo valleri wrote: Hi all, today I discovered that wiki media, actually they are all images, they are always requested to the server and never cached by the client. In other words, even if I have already visited the page I do a get to download all the images instead of using those in the browser cache as commonly happens with for js or css. Is it a problem of my configuration or of wiki it self? paolo -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Old app and 2.4.1-alpha.2+timestamp.2013.01.18.10.00.28 and form submission get 'Consecutive update'
I wonder if somebody could help me. I have an old app with a simple form but if I try to submit in second time. I change some value than press Submit button (after that I got an extra # in the end of the url) than I change some value and press Submit button I end up with this flash message: A record change was detected. Consecutive update self-submissions are notallowed . Try re-submitting or refreshing the form page. Ubuntu Firefox 18.0.1 Thanks. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: wiki: how to cache media files?
let me explain better (PS: untested but should work that way) every file that is returned by the download() function does not carry any of the cache headers (to be fair, it includes one that basically says it expires now) 304 + no content or 200 + the entire content is a step lower when a request is made with the If-Modified-Since header will check the mtime of the file and response.stream() will handle that (the logic is defined in gluon/streamer.py), returning 304 if the file has not been modified or a 200 if the file is indeed more recent. However, cache headers are useful to avoid even the requests that will end in a probable 304. In a static wiki with images, if you're sure that the published images will never change, you can enforce cache headers that will set the item to expire in some point in the future when cache headers are returned the browser will avoid a request with the if-modified-since header entirely. To return cache headers, you can use something like (taken from static asset management in gluon/main.py) response.headers['Cache-Control'] = 'max-age=31536' response.headers['Expires'] = 'Thu, 31 Dec 2037 23:59:59 GMT' This will ensure that the item would not been requested until 31 Dec 2037 (the effect is that a user will download the image one time only and will never request that image to the server again). On Friday, February 1, 2013 1:40:07 PM UTC+1, Paolo valleri wrote: Hi Niphlod, I don't know very well which header I have to set, can you give me an example? The 304 is sent by the server to the user accordingly to the user's request. Given that, If my upload file as a modified_on field I can actually understand if I have to return the whole file (http: 200) or a 304. Is it correct? If yes, I would propose to implement something like that for download(): if the field as the modified_on field we can decide between 200/304, is the field doesn't have the modified_on field we return always a 200. Paolo 2013/2/1 Niphlod nip...@gmail.com javascript: you have to alter the default download() function to return cache headers. The theoretical problem is that web2py (and then the wiki) doesn't know when the image stored in a table would be updated, so it doesn't issue any cache headers by default. On Thursday, January 31, 2013 9:49:21 PM UTC+1, Paolo valleri wrote: Hi all, today I discovered that wiki media, actually they are all images, they are always requested to the server and never cached by the client. In other words, even if I have already visited the page I do a get to download all the images instead of using those in the browser cache as commonly happens with for js or css. Is it a problem of my configuration or of wiki it self? paolo -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] MySQL, self-reference, and null values
Dear All, I have a 'page' model with a sef-reference: db.define_table('page', Field('parent', 'reference page', readable=False, writable=False), Field('title', unique=True, notnull=True) //more fields not important here ) When I insert a new page via appadmin without specifying a 'parent', everything is OK with sqlite Since I moved my database to mysql, I have an error : class '_mysql_exceptions.IntegrityError' (1452, 'Cannot add or update a child row: a foreign key constraint fails (`dommartin25`.`page`, CONSTRAINT `page_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `page` (`id`) ON DELETE CASCADE)') How can I allow null values for the 'parent' field? Thank you -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Web2Py on OpenShift
Hi Chetan :) So there's two steps in the github project readme.md that I want to clarify whether you ran or not: git remote add upstream -m master git://github.com/prelegalwonder/openshift_web2py.git git pull -s recursive -X theirs upstream master Doing that instead of just checking out the project separately will make sure you get things like the setup.py, wsgi/application (wsgi handler) and .openshift directory with the action_hooks that handle things like pre and post deploy as well as deploy setup when git push is called. Simply checking out the github project and copying over the web2py directory into your newly created projects wsgi/ folder isn't enough as that's just the runtime files for web2py and none of the config that tells OpenShift to use it. So if you don't want to use the above two git statements, you also need to copy the following for starters: 1.) application from github project to your-project/wsgi/ 2.) .openshift from github project to your-project/ 3.) setup.pyfrom github project to your-project/ 4.) libs/gluon from github project to your-project/libs (also make sure gluon is symlinked from your-project/wsgi/web2py/gluon - your-project/libs/gluon Try that and redo your git add . from the project root, commit and push and let me know how it goes. The fastest way is to just follow the README.MD verbatim. Cheers, Andrew On Thursday, January 31, 2013 10:57:30 PM UTC-6, Chetan Patil wrote: Hello, On Friday, June 8, 2012 8:37:39 PM UTC+5:30, Andrew wrote: You can find it here: - https://github.com/prelegalwonder/openshift_web2py I followed this guide. This is what I have : I've created an application which stays in application folder of web2py source. I did following to push the app on open shift : 1) Created OpenShift account. Setting up environment on my ubuntu machine. 2) Using rhc app create -a web2py -t python-2.6 I created the web2py folder/application on my system and open shift account. 3) Then I've copied all the content which includes the web2py source and above application inside folder created in step 2. 4) The I did : (a) git add . (b) git commit -a -m message (c) git push 5) Everything works fine and the application/web2py is deployed. However when I go to the app URL. It still showing : Welcome To OpenShift page. I did appended following to the app URL : appURL/welcome/default/index still web2py isn't up. May anyone please let me know where am I going wrong ? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: wiki: how to cache media files?
I get it,thank for explaing. I tryed a test,it seems that main.py overwrites the default headers setting them as no-cache,no-store and so on. I have to test it more. Moreover wiki media are handled by users,i don't know how they behave with them. Something 'automatic' would be really nice to have. Paolo Il giorno 01/feb/2013 15:47, Niphlod niph...@gmail.com ha scritto: let me explain better (PS: untested but should work that way) every file that is returned by the download() function does not carry any of the cache headers (to be fair, it includes one that basically says it expires now) 304 + no content or 200 + the entire content is a step lower when a request is made with the If-Modified-Since header will check the mtime of the file and response.stream() will handle that (the logic is defined in gluon/streamer.py), returning 304 if the file has not been modified or a 200 if the file is indeed more recent. However, cache headers are useful to avoid even the requests that will end in a probable 304. In a static wiki with images, if you're sure that the published images will never change, you can enforce cache headers that will set the item to expire in some point in the future when cache headers are returned the browser will avoid a request with the if-modified-since header entirely. To return cache headers, you can use something like (taken from static asset management in gluon/main.py) response.headers['Cache-Control'] = 'max-age=31536' response.headers['Expires'] = 'Thu, 31 Dec 2037 23:59:59 GMT' This will ensure that the item would not been requested until 31 Dec 2037 (the effect is that a user will download the image one time only and will never request that image to the server again). On Friday, February 1, 2013 1:40:07 PM UTC+1, Paolo valleri wrote: Hi Niphlod, I don't know very well which header I have to set, can you give me an example? The 304 is sent by the server to the user accordingly to the user's request. Given that, If my upload file as a modified_on field I can actually understand if I have to return the whole file (http: 200) or a 304. Is it correct? If yes, I would propose to implement something like that for download(): if the field as the modified_on field we can decide between 200/304, is the field doesn't have the modified_on field we return always a 200. Paolo 2013/2/1 Niphlod nip...@gmail.com you have to alter the default download() function to return cache headers. The theoretical problem is that web2py (and then the wiki) doesn't know when the image stored in a table would be updated, so it doesn't issue any cache headers by default. On Thursday, January 31, 2013 9:49:21 PM UTC+1, Paolo valleri wrote: Hi all, today I discovered that wiki media, actually they are all images, they are always requested to the server and never cached by the client. In other words, even if I have already visited the page I do a get to download all the images instead of using those in the browser cache as commonly happens with for js or css. Is it a problem of my configuration or of wiki it self? paolo -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@**googlegroups.com. For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out . -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: Web2Py on OpenShift
Hi Andrew, Thanks for your reply. On Fri, Feb 1, 2013 at 9:01 PM, Andrew andrew.replo...@gmail.com wrote: So if you don't want to use the above two git statements, you also need to copy the following for starters: 1.) application from github project to your-project/wsgi/ 2.) .openshift from github project to your-project/ 3.) setup.pyfrom github project to your-project/ 4.) libs/gluon from github project to your-project/libs (also make sure gluon is symlinked from your-project/wsgi/web2py/gluon - your-project/libs/gluon Try that and redo your git add . from the project root, commit and push and let me know how it goes. Followed the steps, however same issue. The welcome page is coming. I'll once again explain what I have : 1) I have created an rhc app named web2py. 2) After that I have moved all the contents where I did localhost app development. So those are the files of web2py official source with my application residing next to the welcome or admin app inside application folder. 3) So the web2py folder I created using rhc has everything. 4) Now I'm pushing this to red hat open shift. I also did the changes said above. Structure of rhc app directory on my system : openshift(folder)/ /web2py(rhc created folder)/ /(web2py official source including my application) I'm terribly doing something bad. -- Thank You and Warm Regards, Chetan Arvind Patil, www.chetanpatil.info -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: wiki: how to cache media files?
what automation ? On Friday, February 1, 2013 4:51:54 PM UTC+1, Paolo valleri wrote: I get it,thank for explaing. I tryed a test,it seems that main.py overwrites the default headers setting them as no-cache,no-store and so on. I have to test it more. Moreover wiki media are handled by users,i don't know how they behave with them. Something 'automatic' would be really nice to have. Paolo Il giorno 01/feb/2013 15:47, Niphlod nip...@gmail.com javascript: ha scritto: let me explain better (PS: untested but should work that way) every file that is returned by the download() function does not carry any of the cache headers (to be fair, it includes one that basically says it expires now) 304 + no content or 200 + the entire content is a step lower when a request is made with the If-Modified-Since header will check the mtime of the file and response.stream() will handle that (the logic is defined in gluon/streamer.py), returning 304 if the file has not been modified or a 200 if the file is indeed more recent. However, cache headers are useful to avoid even the requests that will end in a probable 304. In a static wiki with images, if you're sure that the published images will never change, you can enforce cache headers that will set the item to expire in some point in the future when cache headers are returned the browser will avoid a request with the if-modified-since header entirely. To return cache headers, you can use something like (taken from static asset management in gluon/main.py) response.headers['Cache-Control'] = 'max-age=31536' response.headers['Expires'] = 'Thu, 31 Dec 2037 23:59:59 GMT' This will ensure that the item would not been requested until 31 Dec 2037 (the effect is that a user will download the image one time only and will never request that image to the server again). On Friday, February 1, 2013 1:40:07 PM UTC+1, Paolo valleri wrote: Hi Niphlod, I don't know very well which header I have to set, can you give me an example? The 304 is sent by the server to the user accordingly to the user's request. Given that, If my upload file as a modified_on field I can actually understand if I have to return the whole file (http: 200) or a 304. Is it correct? If yes, I would propose to implement something like that for download(): if the field as the modified_on field we can decide between 200/304, is the field doesn't have the modified_on field we return always a 200. Paolo 2013/2/1 Niphlod nip...@gmail.com you have to alter the default download() function to return cache headers. The theoretical problem is that web2py (and then the wiki) doesn't know when the image stored in a table would be updated, so it doesn't issue any cache headers by default. On Thursday, January 31, 2013 9:49:21 PM UTC+1, Paolo valleri wrote: Hi all, today I discovered that wiki media, actually they are all images, they are always requested to the server and never cached by the client. In other words, even if I have already visited the page I do a get to download all the images instead of using those in the browser cache as commonly happens with for js or css. Is it a problem of my configuration or of wiki it self? paolo -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@**googlegroups.com. For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out . -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: python 2.5 problem: ValueError: Invalid boundary in multipart form: ''
thanks I will test that, but then the mac problem still remains On Tuesday, January 29, 2013 5:02:21 PM UTC+1, Niphlod wrote: windows build should be against python 2.7.3 On Tuesday, January 29, 2013 3:52:27 PM UTC+1, select wrote: When uploading zip files in a form I get this error Traceback (most recent call last): File gluon/main.py, line 503, in wsgibase File gluon/main.py, line 321, in parse_get_post_vars File cgi.pyc, line 534, in __init__ File cgi.pyc, line 659, in read_multi File cgi.pyc, line 534, in __init__ File cgi.pyc, line 650, in read_multi ValueError: Invalid boundary in multipart form: '' It seems to be an error of python 2.5 (see the discussion here http://trac.edgewall.org/ticket/9880) Upgrading to a higher python version solves this problem (e.g. to 2.7) Now the problem is that we are building packages from the binary distributions for osx and windows - http://web2py.com/examples/default/download Is there a chance that you build the packages with a higher python version? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Coding of the future?
On Thursday, January 31, 2013 1:26:45 PM UTC+1, Johann Spies wrote: On 31 January 2013 13:03, Jason Brower enco...@gmail.com javascript:wrote: Interesting that we have coding tools built into our framework. http://www.webdesignerdepot.com/2013/01/web-ides-the-future-of-coding/ When webeditors become as good as emacs, vim, bluefish, I will consider it. For now I did not find any editor that can compete with them. http://ace.ajax.org/build/kitchen-sink.html (c9 editor) is already quite impressive IMHO, with the vim commands enabled it feels quite natural to work with, then again i have ST2 which makes me super happy Here are the plugins I use, in case you use ST2 for web2py too AdvancedNewFile AutoPep8 BracketHighliter (with some color customization) CssComb DocBlockr Emmet (Zen Coding) LiveReload SublimeCodeIndel SublimeLinter (https://github.com/cassiobotaro/my_sublime/blob/master/SublimeLinter.sublime-settings for web2py) SideBar Regards. Johann Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: What is the Salt used in web2py
The logic is very complex because it needs to deal with many options and not-break backward compatibility. Normally an encrypted password looks like algorithm$salt$hash algorithm$$hash (no salt) hash (legacy) the hash is computing using the algorithm, the salt, and optionally a user provided key. The key is unique. The salt is different for each password. Every time you call CRYPT()('password') you get a LazyCrypt object. This object can be serialized into a string. The string you get is always different because it contains a random salt. You cannot compare two of those strings because you always get false, even for the same password. Yet you can compare a LazyObject with a string and the lazy object will use the same algorithm and the same salt from the string to compute the hash and compare it with the hash in the string. Example: a = CRYPT()('password') b = CRYPT()('password') sa = str(a) sb = str(b) sa == sb False a == sb True c = CRYPT()('wrong') c == sb False This allows you to change the rules for hashing new password (change the algorithm and its parameters) but never break existing stored hashes. There is a long and old discussion thread about this on web2py-developers: https://groups.google.com/forum/?fromgroups=#!searchin/web2py-developers/salt/web2py-developers/dKYUuuMrtO8/djOEB9QRdeoJ hope this helps. On Thursday, 31 January 2013 01:53:46 UTC-6, Hassan Alnatour wrote: Dear ALL , How can i find the salt used in web2py to encrypt the passwords ? now as i understand if i want to encrypt the password manually i need to do it like this ? CRYPT(digest_alg='md5',key='mykey',salt=True) is this correct , am a bit lost !! i need to understand how can i do the same password encryption done to the passwords in the auth_user table manually ? Best Regards , -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: How do you check user-uploaded files for malware?
Look into the IS_IMAGE validator. You can do something like that and search for specific strings into the uploaded file. On Thursday, 31 January 2013 06:50:05 UTC-6, Lamps902 wrote: Has anybody had success using a malware/virus-scanning module/tool to scan user-uploaded files on their web2py page? Any suggestions as to how to go about doing this? Thanks! -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Pattern to run async proccess
Hi, This is a question that has been asked several times in the list, and I have also had to implement this kind of app in the past. Now I'm also facing to another application where I need to run a resource_and_time_consuming process managed from web2py. The exact problem is: - From a web page, a long process must be started - The web page must be updated as the process is being done - The web page must be able to cancel the process. In the past I have had to deal with the fact of sessions lockings: web2py server doesn't react while the process is being executed. I've solved this by using session.forget(response), but this solution avoids the use of session variables to update the process in the original web page. I've used background processes, queues, etc, These solutions work when time is not an issue, but not when the synchronization between the process and the webpage must be fast and accurate I wonder if someone has a definitive pattern to do this kind of action. Regards José L. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Question on websockets, modules and EMTE
1) yes, the maching server is separate. the idea you want one for each traded product and for scalability they can be distributed on different servers. 2) If you only have one of a few you can use the cron scheduler @reboot and it will start with web2py if you use web2py.py 3) In theory yes. Yet I tried to address two issues: scalability (so the order queue is in ram) and reliability (what if the program crashes and order queue in ram gets lost?). Because of scalability I decided to eliminate every database IO from the matching server. For reliability purposes all the server IO is logged and there is another background script (only half backed) that is supposed to load the logs and fill in the database (write only). Any piece may crash and the should be possible to reconstruct the previous events. On Thursday, 31 January 2013 15:53:23 UTC-6, jensk wrote: I am trying to get web2py set up as a WSGI server on pythonanywhere.com. That is really easy, but alongside a regular http server I also need websockets server support. Because I would like to use WAMP as protocol on top of websockets, I have chosen Autobahn, which uses Twisted. The server setup seem to be similar to the Tornado server of the EMTE example. Here is a script that starts up a Flash webapp and the Autobahn server: https://github.com/tavendo/AutobahnPython/blob/master/examples/websocket/echo_wsgi/server.pyThe script loading web2py on pythonanywhere basically just says from gluon.main import wsgibase as application, but it will probably stop working if the reactor.run() line from the Autobahn server does not return. I have studied the EMTE example, where the matching server is implemented in the modules dir, but I have a few questions: 1) Modules seem to be normally used for logic code in web2py, to be imported/used in controllers . that's how it is explained on the slices site as well. But the EMTE matching server seem to be a stand alone python program, is this correct? It also seems that Massimo starts up the server manually in the Vimeo video. 2) If so, is there any way to have web2py start the matching server (or a similar websockets server) when web2py is started up from the WSGI script? Is there a method I can hook into, that is called at startup - that way I could start a thread that runs the WS server rather than the __main__ from the module. I would prefer this over running the Autobahn server from the WSGI script. And while we are at it, what about closedown? 3) The EMTE matching server seem to only receive/send websocket messages and not do any database access. Can the server just import DAL and read/write the database that the regular web2py server also use? Are there any potential thread/process concurrency issues with this if the database is an SQLite file, or should a client/server SQL DB be used instead? Thanks, Jens Kristian Jensen -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: contribute: db diagram for web2py appadmin
Would you be opposed to turn this into an admin plugin and allow appadmin to access it? On Wednesday, 30 January 2013 15:04:06 UTC-6, Paolo Caruccio wrote: Massimo, thanks for the compliments and for the suggestions. Actually, in my mind the posted code is a sort of appadmin plugin. For this reason I separated db diagram static files from web2py ones. About the 'db' limitation, it's due to lack of time for testing. I'm attaching a w2p application (modified hotel management appliance) to show better how it works. Il giorno mercoledì 30 gennaio 2013 19:55:53 UTC+1, Massimo Di Pierro ha scritto: This is really nice. How about we move all the static files and the view into admin and he have the db_diagram.py code in appadmin just include form admin? we can do that easily. you can do dbs = [db in globals().values() if isinstance(db.DAL)] to get databases. There is a more efficient way: from gluon.dal import THREAD_LOCA mdbs = getattr(THREAD_LOCAL,'db_instances',{}).items() dbs = [] for db_uid, db_group in mdbs: dbs += [db for db in db_group] On Wednesday, January 30, 2013 10:23:21 AM UTC-6, Paolo Caruccio wrote: I was not able to succesfully install pygraphviz on my windows7 64bit enviroment but I liked Jose's idea https://groups.google.com/d/topic/web2py/cFqD1M6rkc8/discussion, so I wrote a simple addendum to appadmin in order to show a graph representation of a database. It's not alternative to or a replacement of Jose's graph layout because there are substantial differences. db diagram is interactive (nodes are draggable and clickable) but you cannot save it as an image (anyway it's possible to use a third party application for screenshoots). Moreover it is customizable via css (you will find here attached a css theme for reference) and it's based on jqueryUI framewok. The nodes contain only the table name, so we can draw the layout of a database with (moderately) numerous tables. In order to see table data you have to click on the node. I added some infos like indexed columns (currently available only for sqlite but I think it's not hard to implement for other database engines), the list of other affected tables when we delete a row in cascade mode. The layout (the position of nodes on the screen) is generated trough a force-directed spring algorythm. Therefore the layout is generated dinamically and it will be different each time you refresh the page. For this scope, I adapted and translated to jQuery the original prototype source code freely distributed under the terms of a MIT-style license from http://snipplr.com/view/1950/graph-javascript-framework-version-001/ For a jquery version of this original source code you could visit http://www.graphdracula.net/ The edges are drawn by jsPlumb library ( http://www.jsplumb.org/jquery/demo.html ). All 1.x.x versions of jsPlumb are dual-licensed under both MIT and GPL version 2. Current main limitation: the database must have 'db' key in application databases dictionary. In other words in our model we must have db = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all']) and not, for example, mydb = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all']) The screen dimensions are important too: the layout will be messed on small screens. The code has been tested on latest versions of Firefox, Chrome, Opera, IE(7,8,9) and on a very limited number of databases. So please check for errors and bugs. Installation: 1) append the code within in the attached db_diagram.py in your_application/controllers/appadmin.py file 2) put attached db_diagram.html in to your_application/views folder 3) create a new folder in your_application/static folder and name it db_diagram 4) in to latter put db_diagram.css, db_diagram_print.css, jquery.dbdiagram.js, pencildiagonals.png (an image create by me only for the css theme in bundle) (all these files are here attached) 5) download jsPlumb (jQuery release) from http://code.google.com/p/jsplumb/downloads/list and put jquery.jsPlumb-1.3.16-all-min.js file in your_application/static/db_diagram folder Usage: In your appadmin page you should see a new menu item diagram (see image 1), click on it and you should see the layout of your db. That's all Folks! -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: cache.shelve files cause lockups when moved between 32 64 bit machines
This is interesting and I have not seen it before. I am tempted to say this is a python issue. Could also be a locking issue. On Thursday, 31 January 2013 20:24:40 UTC-6, nite...@gmail.com wrote: I have two computers that I work on: a 32-bit netbook and a 64-bit desktop. Sometimes I will rsync my entire working copy of the web2py application I'm working on from one machine to the other, rather than getting a fresh copy. When I do this from the netbook to the desktop, the web2py server starts normally (no error messages), but when I try to access the application, the web browser hangs forever. One really strange side effect is that it also attempts to open a connection to the IP address 64.99.64.32. (I'm not sure what significance this IP has, but if you Google it you see a number of other pieces of software that also appear to use it when things go wrong.) Anyhow, the first thing I tried -- deleting all the .pyc files -- had no effect, so I did a full diff between the directory tree from the netbook, versus a fresh copy checked out directly to the 64-bit machine, and the only thing that differed was the ./web2py/applications/*/cache/cache.shelve files. I deleted them, and everything worked normally again. Is this a known issue? Is it Python's fault for not knowing that a .shelve file came from the wrong architecture? Or should I just be doing a make clean from web2py every time I'm on a different machine (I notice that removing all the cache directories is in there)? ~Felix. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: Unstructured table creation in DAL; akin to NoSQL?
I thought we already support for DAL + pyMongo in trunk. What specifically does not work and you want to improve? On Friday, 1 February 2013 00:20:44 UTC-6, Alec Taylor wrote: On Fri, Feb 1, 2013 at 4:23 AM, Alan Etkin spam...@gmail.comjavascript: wrote: I am porting a library to web2py's DAL from pymongo; and looking Sorry, may I ask what library? dal already has experimental support for mymongo trough the MongoDBAdapter. Have you considered using/extending it? I am porting it to DAL from Mongo; allowing for Mongo + other DBs to be used + the DAL syntax and its many advantages (form generation whatnot). Probably just 30 minutes of work left for it then another little bit for testing and it'll be ready. My fork is public and on github. Will post it on this list when it's fully tested + better documented. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Debugging in a server
The tickets are just pickles. On Friday, 1 February 2013 03:06:13 UTC-6, Wonton wrote: Hello Mariano, Regarding to the tickets I've seen that they are stored in my errors directory, so I can read them there (they are not well formatted, but at least I can see the error). For me is more important how to insert and read traces, and following your idea I will check if there is any logging facility in my server admin panel. I will try python logging module too. Thank you very much! El viernes, 1 de febrero de 2013 03:41:29 UTC+1, Mariano Reingart escribió: AFAIK you could store the tickets in the db or coping the files and open them locally (maybe in another web2py instance) Code traces will go to your web server logging facility (if any). If you cannot access that, you could create a temp file and write the logs there. For more advanced methods, please check also the python logging module. Best regards, Mariano Reingart http://www.sistemasagiles.com.ar http://reingart.blogspot.com On Wed, Jan 30, 2013 at 4:09 PM, Wonton rfer...@gmail.com wrote: Hello everyone, Finally I have my project working in my local server so I've uploaded it to the real server (via FTP to the applications directory). It's working almost perfctly, but some features are giving errors and other are simply not working (they return incorrect data). My problem, I have no admin access to the server (https is disabled by the server admin and nowadays it's not possible to enable it). The errors return their tickets but the errors directories, both in my project directory and in admin directory, are empty. In this environment how could I debug my project? Is there any way to check the tickets? And is there any way to insert code traces to check what is happening? I inserted this code when debugging locally and saw the traces in my terminal, but now, running web2py in the server, I can't launch it from a terminal, so where could I see my traces?. Any help will be very appreciated. Kind regards! -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] web2py IDEs; maintain a wiki with plugins?
Can we bring up a community wiki page for this? For editing web2py apps, I have personally used: Eclipse, Geany, Sublime Text 2, nano and the online editor. Currently my editor of choice is Sublime Text 2. In the quoted message below this repo was mentioned; https://github.com/cassiobotaro/my_sublime However when attempting to install I get this: D:\Projects\my_sublimepython setup.py Traceback (most recent call last): File setup.py, line 6, in module USER = os.getlogin() AttributeError: 'module' object has no attribute 'getlogin' How do I fix this? Also, what's a good 'lightweight' IDE for use with web2py; which supports: - Code completion - Syntax highlighting (preferably for web2py functions+libraries+objects also) - Goto definition (where this function was defined or object was initiated) - Open folder as project (preferably from command-line; currently do this with sublime_text folder_location - Linux and Windows Thanks for all suggestions, Alec Taylor On Sat, Feb 2, 2013 at 3:13 AM, select gr...@delarue-berlin.de wrote: On Thursday, January 31, 2013 1:26:45 PM UTC+1, Johann Spies wrote: On 31 January 2013 13:03, Jason Brower enco...@gmail.com wrote: Interesting that we have coding tools built into our framework. http://www.webdesignerdepot.com/2013/01/web-ides-the-future-of-coding/ When webeditors become as good as emacs, vim, bluefish, I will consider it. For now I did not find any editor that can compete with them. http://ace.ajax.org/build/kitchen-sink.html (c9 editor) is already quite impressive IMHO, with the vim commands enabled it feels quite natural to work with, then again i have ST2 which makes me super happy Here are the plugins I use, in case you use ST2 for web2py too AdvancedNewFile AutoPep8 BracketHighliter (with some color customization) CssComb DocBlockr Emmet (Zen Coding) LiveReload SublimeCodeIndel SublimeLinter (https://github.com/cassiobotaro/my_sublime/blob/master/SublimeLinter.sublime-settings for web2py) SideBar Regards. Johann -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Old app and 2.4.1-alpha.2+timestamp.2013.01.18.10.00.28 and form submission get 'Consecutive update'
My guess is that you are using crud. crud check that if you display an edit form, than submitted changes, the record has not been changed by a third party (other user or code) to make sure changes are not silently deleted causing information loss. This can be disable but I would not. Try instead figure out why the record changes. Perhaps you have something going on in onvalidation? On Friday, 1 February 2013 08:29:58 UTC-6, szimszon wrote: I wonder if somebody could help me. I have an old app with a simple form but if I try to submit in second time. I change some value than press Submit button (after that I got an extra # in the end of the url) than I change some value and press Submit button I end up with this flash message: A record change was detected. Consecutive update self-submissions are notallowed . Try re-submitting or refreshing the form page. Ubuntu Firefox 18.0.1 Thanks. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: python 2.5 problem: ValueError: Invalid boundary in multipart form: ''
I do not understand. What is the mac problem. The OSX version should also be built with 2.7. On Friday, 1 February 2013 10:01:32 UTC-6, select wrote: thanks I will test that, but then the mac problem still remains On Tuesday, January 29, 2013 5:02:21 PM UTC+1, Niphlod wrote: windows build should be against python 2.7.3 On Tuesday, January 29, 2013 3:52:27 PM UTC+1, select wrote: When uploading zip files in a form I get this error Traceback (most recent call last): File gluon/main.py, line 503, in wsgibase File gluon/main.py, line 321, in parse_get_post_vars File cgi.pyc, line 534, in __init__ File cgi.pyc, line 659, in read_multi File cgi.pyc, line 534, in __init__ File cgi.pyc, line 650, in read_multi ValueError: Invalid boundary in multipart form: '' It seems to be an error of python 2.5 (see the discussion here http://trac.edgewall.org/ticket/9880) Upgrading to a higher python version solves this problem (e.g. to 2.7) Now the problem is that we are building packages from the binary distributions for osx and windows - http://web2py.com/examples/default/download Is there a chance that you build the packages with a higher python version? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: wiki: how to cache media files?
Something that handles the headers automatically accordingly to the wiki media modified_on field. I will try somenthing next week (i am out this weekend) Il giorno 01/feb/2013 16:59, Niphlod niph...@gmail.com ha scritto: what automation ? On Friday, February 1, 2013 4:51:54 PM UTC+1, Paolo valleri wrote: I get it,thank for explaing. I tryed a test,it seems that main.py overwrites the default headers setting them as no-cache,no-store and so on. I have to test it more. Moreover wiki media are handled by users,i don't know how they behave with them. Something 'automatic' would be really nice to have. Paolo Il giorno 01/feb/2013 15:47, Niphlod nip...@gmail.com ha scritto: let me explain better (PS: untested but should work that way) every file that is returned by the download() function does not carry any of the cache headers (to be fair, it includes one that basically says it expires now) 304 + no content or 200 + the entire content is a step lower when a request is made with the If-Modified-Since header will check the mtime of the file and response.stream() will handle that (the logic is defined in gluon/streamer.py), returning 304 if the file has not been modified or a 200 if the file is indeed more recent. However, cache headers are useful to avoid even the requests that will end in a probable 304. In a static wiki with images, if you're sure that the published images will never change, you can enforce cache headers that will set the item to expire in some point in the future when cache headers are returned the browser will avoid a request with the if-modified-since header entirely. To return cache headers, you can use something like (taken from static asset management in gluon/main.py) response.headers['Cache-**Control'] = 'max-age=31536' response.headers['Expires'] = 'Thu, 31 Dec 2037 23:59:59 GMT' This will ensure that the item would not been requested until 31 Dec 2037 (the effect is that a user will download the image one time only and will never request that image to the server again). On Friday, February 1, 2013 1:40:07 PM UTC+1, Paolo valleri wrote: Hi Niphlod, I don't know very well which header I have to set, can you give me an example? The 304 is sent by the server to the user accordingly to the user's request. Given that, If my upload file as a modified_on field I can actually understand if I have to return the whole file (http: 200) or a 304. Is it correct? If yes, I would propose to implement something like that for download(): if the field as the modified_on field we can decide between 200/304, is the field doesn't have the modified_on field we return always a 200. Paolo 2013/2/1 Niphlod nip...@gmail.com you have to alter the default download() function to return cache headers. The theoretical problem is that web2py (and then the wiki) doesn't know when the image stored in a table would be updated, so it doesn't issue any cache headers by default. On Thursday, January 31, 2013 9:49:21 PM UTC+1, Paolo valleri wrote: Hi all, today I discovered that wiki media, actually they are all images, they are always requested to the server and never cached by the client. In other words, even if I have already visited the page I do a get to download all the images instead of using those in the browser cache as commonly happens with for js or css. Is it a problem of my configuration or of wiki it self? paolo -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@**googlegroups.com. For more options, visit https://groups.google.com/**grou**ps/opt_outhttps://groups.google.com/groups/opt_out . -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@**googlegroups.com. For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out . -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Pattern to run async proccess
All that you ask can be done using the scheduler except that your app does not start the process, but submits a request to the scheduler. The scheduler runs the app when a worker is available. This is to prevent spikes in resource utilization when multiple processes start. The task can communicate with the app vid database and/or filesystem (which is ok but not 100% satisfactory). Web2py can monitor and kill running scheduler tasks. This works well for most types of tasks but not for tasks that need a lot of IO with your application. I do not have a satisfactory solution in that case. You want the tasks to have some way to communicate asynchronously with the client and this present major issues, some related with security. On Friday, 1 February 2013 10:22:35 UTC-6, José Luis Redrejo Rodríguez wrote: Hi, This is a question that has been asked several times in the list, and I have also had to implement this kind of app in the past. Now I'm also facing to another application where I need to run a resource_and_time_consuming process managed from web2py. The exact problem is: - From a web page, a long process must be started - The web page must be updated as the process is being done - The web page must be able to cancel the process. In the past I have had to deal with the fact of sessions lockings: web2py server doesn't react while the process is being executed. I've solved this by using session.forget(response), but this solution avoids the use of session variables to update the process in the original web page. I've used background processes, queues, etc, These solutions work when time is not an issue, but not when the synchronization between the process and the webpage must be fast and accurate I wonder if someone has a definitive pattern to do this kind of action. Regards José L. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: Web2Py on OpenShift
Chetan, No worries, I'm confident we'll get you up and going. The fact that the default Openshift page is still coming up tells me one of two things: 1.) Your wsgi-handler (your-project/wsgi/application) isn't setup correctly 2.) It *is* setup correctly but for some reason it's not overriding the default one in the openshift hosted environment when you do a git push. Can you take the following action: 1.) Post the contents of that file here 2.) ssh into your instance and cd to $OPENSHIFT_REPO_DIR and check the contents of it there to make sure it matches Cheers, Andrew On Friday, February 1, 2013 9:55:11 AM UTC-6, Chetan Patil wrote: Hi Andrew, Thanks for your reply. On Fri, Feb 1, 2013 at 9:01 PM, Andrew andrew@gmail.com javascript: wrote: So if you don't want to use the above two git statements, you also need to copy the following for starters: 1.) application from github project to your-project/wsgi/ 2.) .openshift from github project to your-project/ 3.) setup.pyfrom github project to your-project/ 4.) libs/gluon from github project to your-project/libs (also make sure gluon is symlinked from your-project/wsgi/web2py/gluon - your-project/libs/gluon Try that and redo your git add . from the project root, commit and push and let me know how it goes. Followed the steps, however same issue. The welcome page is coming. I'll once again explain what I have : 1) I have created an rhc app named web2py. 2) After that I have moved all the contents where I did localhost app development. So those are the files of web2py official source with my application residing next to the welcome or admin app inside application folder. 3) So the web2py folder I created using rhc has everything. 4) Now I'm pushing this to red hat open shift. I also did the changes said above. Structure of rhc app directory on my system : openshift(folder)/ /web2py(rhc created folder)/ /(web2py official source including my application) I'm terribly doing something bad. -- Thank You and Warm Regards, Chetan Arvind Patil, www.chetanpatil.info -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: wiki: how to cache media files?
modified_on is basically the same info that is the mtime on the file. This tells you when the file has been modified, so you can return a 304, but doesn't help you with the cache. In theory all files served through download() (minus the one stored on a blob in a table) should work ok without needing any further patch (i.e. the automation is there) What is needed to set cache headers (and avoid the browser to request files) is some sort of will_be_modified_on, so you can set correctly the expiration without guessing. On Friday, February 1, 2013 5:42:59 PM UTC+1, Paolo valleri wrote: Something that handles the headers automatically accordingly to the wiki media modified_on field. I will try somenthing next week (i am out this weekend) Il giorno 01/feb/2013 16:59, Niphlod nip...@gmail.com javascript: ha scritto: what automation ? On Friday, February 1, 2013 4:51:54 PM UTC+1, Paolo valleri wrote: I get it,thank for explaing. I tryed a test,it seems that main.py overwrites the default headers setting them as no-cache,no-store and so on. I have to test it more. Moreover wiki media are handled by users,i don't know how they behave with them. Something 'automatic' would be really nice to have. Paolo Il giorno 01/feb/2013 15:47, Niphlod nip...@gmail.com ha scritto: let me explain better (PS: untested but should work that way) every file that is returned by the download() function does not carry any of the cache headers (to be fair, it includes one that basically says it expires now) 304 + no content or 200 + the entire content is a step lower when a request is made with the If-Modified-Since header will check the mtime of the file and response.stream() will handle that (the logic is defined in gluon/streamer.py), returning 304 if the file has not been modified or a 200 if the file is indeed more recent. However, cache headers are useful to avoid even the requests that will end in a probable 304. In a static wiki with images, if you're sure that the published images will never change, you can enforce cache headers that will set the item to expire in some point in the future when cache headers are returned the browser will avoid a request with the if-modified-since header entirely. To return cache headers, you can use something like (taken from static asset management in gluon/main.py) response.headers['Cache-**Control'] = 'max-age=31536' response.headers['Expires'] = 'Thu, 31 Dec 2037 23:59:59 GMT' This will ensure that the item would not been requested until 31 Dec 2037 (the effect is that a user will download the image one time only and will never request that image to the server again). On Friday, February 1, 2013 1:40:07 PM UTC+1, Paolo valleri wrote: Hi Niphlod, I don't know very well which header I have to set, can you give me an example? The 304 is sent by the server to the user accordingly to the user's request. Given that, If my upload file as a modified_on field I can actually understand if I have to return the whole file (http: 200) or a 304. Is it correct? If yes, I would propose to implement something like that for download(): if the field as the modified_on field we can decide between 200/304, is the field doesn't have the modified_on field we return always a 200. Paolo 2013/2/1 Niphlod nip...@gmail.com you have to alter the default download() function to return cache headers. The theoretical problem is that web2py (and then the wiki) doesn't know when the image stored in a table would be updated, so it doesn't issue any cache headers by default. On Thursday, January 31, 2013 9:49:21 PM UTC+1, Paolo valleri wrote: Hi all, today I discovered that wiki media, actually they are all images, they are always requested to the server and never cached by the client. In other words, even if I have already visited the page I do a get to download all the images instead of using those in the browser cache as commonly happens with for js or css. Is it a problem of my configuration or of wiki it self? paolo -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@**googlegroups.com. For more options, visit https://groups.google.com/**grou**ps/opt_outhttps://groups.google.com/groups/opt_out . -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@**googlegroups.com. For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out . -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving
Re: [web2py] Re: Pattern to run async proccess
Thanks for your advice Massimo, but does the scheduler start inmediately when no worker has been used before? 2013/2/1 Massimo Di Pierro massimo.dipie...@gmail.com: All that you ask can be done using the scheduler except that your app does not start the process, but submits a request to the scheduler. The scheduler runs the app when a worker is available. This is to prevent spikes in resource utilization when multiple processes start. The task can communicate with the app vid database and/or filesystem (which is ok but not 100% satisfactory). Web2py can monitor and kill running scheduler tasks. This works well for most types of tasks but not for tasks that need a lot of IO with your application. I do not have a satisfactory solution in that case. You want the tasks to have some way to communicate asynchronously with the client and this present major issues, some related with security. On Friday, 1 February 2013 10:22:35 UTC-6, José Luis Redrejo Rodríguez wrote: Hi, This is a question that has been asked several times in the list, and I have also had to implement this kind of app in the past. Now I'm also facing to another application where I need to run a resource_and_time_consuming process managed from web2py. The exact problem is: - From a web page, a long process must be started - The web page must be updated as the process is being done - The web page must be able to cancel the process. In the past I have had to deal with the fact of sessions lockings: web2py server doesn't react while the process is being executed. I've solved this by using session.forget(response), but this solution avoids the use of session variables to update the process in the original web page. I've used background processes, queues, etc, These solutions work when time is not an issue, but not when the synchronization between the process and the webpage must be fast and accurate I wonder if someone has a definitive pattern to do this kind of action. Regards José L. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: converting URL to lowercase before dispatching
I think you can do routes_in = [('/((?i)my_data/?$anything','/my_data/$anything')] (?i) is a directive that tells the regular expression parser to ignore the case On Thursday, 31 January 2013 09:27:48 UTC-6, olly@sirocos.com wrote: I have a web2py application say, at http://127.0.0.1:8000/my_data;. I would like to make the URL case insensitive so that any users calling My_data, MY_Data, etc it gets remapped to the lowercase version of the URL. Any thoughts on how to do this? Olly -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: How do you check user-uploaded files for malware?
Thanks, Massimo, I'll check it out. -Lamps On Friday, February 1, 2013 11:19:12 AM UTC-5, Massimo Di Pierro wrote: Look into the IS_IMAGE validator. You can do something like that and search for specific strings into the uploaded file. On Thursday, 31 January 2013 06:50:05 UTC-6, Lamps902 wrote: Has anybody had success using a malware/virus-scanning module/tool to scan user-uploaded files on their web2py page? Any suggestions as to how to go about doing this? Thanks! -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: converting URL to lowercase before dispatching
On 1 Feb 2013, at 9:13 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I think you can do routes_in = [('/((?i)my_data/?$anything','/my_data/$anything')] (?i) is a directive that tells the regular expression parser to ignore the case On Thursday, 31 January 2013 09:27:48 UTC-6, olly@sirocos.com wrote: I have a web2py application say, at http://127.0.0.1:8000/my_data;. I would like to make the URL case insensitive so that any users calling My_data, MY_Data, etc it gets remapped to the lowercase version of the URL. Any thoughts on how to do this? Olly You could also edit request.controller, request.function, and request.args (if appropriate) in your model, if you're not using controller-specific models at least. I could see adding a case-normalizing option to the parametric router. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] [ANNOUNCEMENT + RFC] Implemented the OAuth2 authentication server
*https://github.com/SamuelMarks/web2py-oauth2* Took quite a while, but I have finally 'finished' [well, mostly!] three major changes to João Alves' original implementation: 1. Reviewed *the entire codebase*; improving quality, fixing hacks and improving formatting along the way. 2. Rewrote all the relevant exceptions to use gluon.http.HTTP (with correct HTTP error codes + easier to understand *specific* exception messages) 3. Implemented subclasses of OAuthStorage for web2py's DAL. Now this project is no longer locked-into MongoDB ;] Now the next steps I have in mind for the project are as follows: - Rewrite the documentation into an easy to use getting started guide (step-by-step) - Test all the components - Upgrade + implement the necessary features to conform with the latest OAuth2 standard (this one is based off its 20th Draft) Would welcome testers and developers to get involved with improvements + bug findings =] *https://github.com/SamuelMarks/web2py-oauth2* Thanks and enjoy, Samuel Marks PS: Once it's fully tested, lets package it up with web2py; and throw the documentation into the book ;P -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Record versioning on delete CASCADE
The cascade feature should work for record versioning enabled tables? Thanks. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: Web2Py on OpenShift
Ok that's the first (and hopefully only!) problem. That's the default application file. Each application will need a slightly different wsgi-handler and I had to tweak it for OpenShift. You need to use the one from the Github project here: https://github.com/prelegalwonder/openshift_web2py/blob/master/wsgi/application Like I said, the fastest way is to follow the readme verbatim since those git commands replicate the template in the github project and then you just make your customizations from there and commit / push. Let me know how that works. On Friday, February 1, 2013 11:03:19 AM UTC-6, Chetan Patil wrote: Hi Andrew, On Fri, Feb 1, 2013 at 10:24 PM, Andrew andrew@gmail.comjavascript: wrote: 1.) Post the contents of that file here #!/usr/bin/python import os virtenv = os.environ['APPDIR'] + '/virtenv/' os.environ['PYTHON_EGG_CACHE'] = os.path.join(virtenv, 'lib/python2.6/site-packages') virtualenv = os.path.join(virtenv, 'bin/activate_this.py') try: execfile(virtualenv, dict(__file__=virtualenv)) except IOError: pass # # IMPORTANT: Put any additional includes below this line. If placed above this # line, it's possible required libraries won't be in your searchable path # def application(environ, start_response): ctype = 'text/plain' if environ['PATH_INFO'] == '/health': response_body = 1 elif environ['PATH_INFO'] == '/env': response_body = ['%s: %s' % (key, value) for key, value in sorted(environ.items())] response_body = '\n'.join(response_body) else: ctype = 'text/html' response_body = '''!doctype html html lang=en head meta charset=utf-8 meta http-equiv=X-UA-Compatible content=IE=edge,chrome=1 titleWelcome to OpenShift/title style html { background: black; } body { background: #333; background: -webkit-linear-gradient(top, black, #666); background: -o-linear-gradient(top, black, #666); background: -moz-linear-gradient(top, black, #666); background: linear-gradient(top, black, #666); color: white; font-family: Helvetica Neue,Helvetica,Liberation Sans,Arial,sans-serif; width: 40em; margin: 0 auto; padding: 3em; } a { color: white; } h1 { text-transform: capitalize; -moz-text-shadow: -1px -1px 0 black; -webkit-text-shadow: 2px 2px 2px black; text-shadow: -1px -1px 0 black; box-shadow: 1px 2px 2px rgba(0, 0, 0, 0.5); background: #CC; width: 22.5em; margin: 1em -2em; padding: .3em 0 .3em 1.5em; position: relative; } h1:before { content: ''; width: 0; height: 0; border: .5em solid #91010B; border-left-color: transparent; border-bottom-color: transparent; position: absolute; bottom: -1em; left: 0; z-index: -1000; } h1:after { content: ''; width: 0; height: 0; border: .5em solid #91010B; border-right-color: transparent; border-bottom-color: transparent; position: absolute; bottom: -1em; right: 0; z-index: -1000; } h2 { margin: 2em 0 .5em; border-bottom: 1px solid #999; } pre { background: black; padding: 1em 0 0; -webkit-border-radius: 1em; -moz-border-radius: 1em; border-radius: 1em; color: #9cf; } ul { margin: 0; padding: 0; } li { list-style-type: none; padding: .5em 0; } .brand { display: block; text-decoration: none; } .brand .brand-image { float: left; border:none; } .brand .brand-text { float: left; font-size: 24px; line-height: 24px; padding: 4px 0; color: white; text-transform: uppercase; } .brand:hover, .brand:active { text-decoration: underline; } .brand:before, .brand:after { content: ' '; display: table; } .brand:after { clear: both; } /style /head body a href=http://openshift.com; class=brand img class=brand-image alt=OpenShift logo
[web2py] Re: contribute: db diagram for web2py appadmin
Absolutly not, you are free to do what do you want. Only one note. The db_diagram.css file is not optimized because it is a reference for the users which would like customize the theme. Il giorno venerdì 1 febbraio 2013 17:31:50 UTC+1, Massimo Di Pierro ha scritto: Would you be opposed to turn this into an admin plugin and allow appadmin to access it? On Wednesday, 30 January 2013 15:04:06 UTC-6, Paolo Caruccio wrote: Massimo, thanks for the compliments and for the suggestions. Actually, in my mind the posted code is a sort of appadmin plugin. For this reason I separated db diagram static files from web2py ones. About the 'db' limitation, it's due to lack of time for testing. I'm attaching a w2p application (modified hotel management appliance) to show better how it works. Il giorno mercoledì 30 gennaio 2013 19:55:53 UTC+1, Massimo Di Pierro ha scritto: This is really nice. How about we move all the static files and the view into admin and he have the db_diagram.py code in appadmin just include form admin? we can do that easily. you can do dbs = [db in globals().values() if isinstance(db.DAL)] to get databases. There is a more efficient way: from gluon.dal import THREAD_LOCA mdbs = getattr(THREAD_LOCAL,'db_instances',{}).items() dbs = [] for db_uid, db_group in mdbs: dbs += [db for db in db_group] On Wednesday, January 30, 2013 10:23:21 AM UTC-6, Paolo Caruccio wrote: I was not able to succesfully install pygraphviz on my windows7 64bit enviroment but I liked Jose's idea https://groups.google.com/d/topic/web2py/cFqD1M6rkc8/discussion, so I wrote a simple addendum to appadmin in order to show a graph representation of a database. It's not alternative to or a replacement of Jose's graph layout because there are substantial differences. db diagram is interactive (nodes are draggable and clickable) but you cannot save it as an image (anyway it's possible to use a third party application for screenshoots). Moreover it is customizable via css (you will find here attached a css theme for reference) and it's based on jqueryUI framewok. The nodes contain only the table name, so we can draw the layout of a database with (moderately) numerous tables. In order to see table data you have to click on the node. I added some infos like indexed columns (currently available only for sqlite but I think it's not hard to implement for other database engines), the list of other affected tables when we delete a row in cascade mode. The layout (the position of nodes on the screen) is generated trough a force-directed spring algorythm. Therefore the layout is generated dinamically and it will be different each time you refresh the page. For this scope, I adapted and translated to jQuery the original prototype source code freely distributed under the terms of a MIT-style license from http://snipplr.com/view/1950/graph-javascript-framework-version-001/ For a jquery version of this original source code you could visit http://www.graphdracula.net/ The edges are drawn by jsPlumb library ( http://www.jsplumb.org/jquery/demo.html ). All 1.x.x versions of jsPlumb are dual-licensed under both MIT and GPL version 2. Current main limitation: the database must have 'db' key in application databases dictionary. In other words in our model we must have db = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all']) and not, for example, mydb = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all' ]) The screen dimensions are important too: the layout will be messed on small screens. The code has been tested on latest versions of Firefox, Chrome, Opera, IE(7,8,9) and on a very limited number of databases. So please check for errors and bugs. Installation: 1) append the code within in the attached db_diagram.py in your_application/controllers/appadmin.py file 2) put attached db_diagram.html in to your_application/views folder 3) create a new folder in your_application/static folder and name it db_diagram 4) in to latter put db_diagram.css, db_diagram_print.css, jquery.dbdiagram.js, pencildiagonals.png (an image create by me only for the css theme in bundle) (all these files are here attached) 5) download jsPlumb (jQuery release) from http://code.google.com/p/jsplumb/downloads/list and put jquery.jsPlumb-1.3.16-all-min.js file in your_application/static/db_diagram folder Usage: In your appadmin page you should see a new menu item diagram (see image 1), click on it and you should see the layout of your db. That's all Folks! -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: contribute: db diagram for web2py appadmin
Jose. thank you too for the amazing idea to draw a graph of the database. I take the opportunity to ask you where I can download a working pygraphviz build for windows. Il giorno giovedì 31 gennaio 2013 23:11:00 UTC+1, Jose ha scritto: Very nice. Excellent work Paolo. Jose -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: pack all functionality
Thank you !!! this will help me alot. On Tuesday, January 29, 2013 11:37:55 PM UTC-6, Anthony wrote: Keep in mind, admin is just a web2py app, so follow the app code. Start herehttp://code.google.com/p/web2py/source/browse/applications/admin/controllers/default.py#326. Then herehttp://code.google.com/p/web2py/source/browse/gluon/admin.py#46(most of the admin functions are in /gluon/admin.py, so you can use the functions outside of the admin app by importing that module). Anthony On Tuesday, January 29, 2013 11:50:02 PM UTC-5, Hector Magnanao wrote: Can someone point me to where the source code is for the pack all button ? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: [ANNOUNCEMENT + RFC] Implemented the OAuth2 authentication server
+1 On Friday, February 1, 2013 6:46:36 PM UTC+1, Samuel Marks wrote: *https://github.com/SamuelMarks/web2py-oauth2* Took quite a while, but I have finally 'finished' [well, mostly!] three major changes to João Alves' original implementation: 1. Reviewed *the entire codebase*; improving quality, fixing hacks and improving formatting along the way. 2. Rewrote all the relevant exceptions to use gluon.http.HTTP (with correct HTTP error codes + easier to understand *specific* exception messages) 3. Implemented subclasses of OAuthStorage for web2py's DAL. Now this project is no longer locked-into MongoDB ;] Now the next steps I have in mind for the project are as follows: - Rewrite the documentation into an easy to use getting started guide (step-by-step) - Test all the components - Upgrade + implement the necessary features to conform with the latest OAuth2 standard (this one is based off its 20th Draft) Would welcome testers and developers to get involved with improvements + bug findings =] *https://github.com/SamuelMarks/web2py-oauth2* Thanks and enjoy, Samuel Marks PS: Once it's fully tested, lets package it up with web2py; and throw the documentation into the book ;P -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] DAL connection string password in clear in web2py ticket
Hello, I don't know if it normal or not, but I found that DAL connection string password appear in clear in web2py tickets... Ex.: Variables global request Storage {'function': 'update', 'body': open fi...try_id': '1219', '_formname': 'table1/836'}} builtinTrue True request.args ['table1', '836'] global select function select global db DAL uri=postgres://**:*MYPASSWORDWASHERE* @127.0.0.1:5432/database ].approved undefined I got this behavior with web2py 2.3.2 Thanks Richard -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: Pattern to run async proccess
yes. If the worker is not busy it starts the task immediately. You can also have more than one worker. On Friday, 1 February 2013 11:10:11 UTC-6, José Luis Redrejo Rodríguez wrote: Thanks for your advice Massimo, but does the scheduler start inmediately when no worker has been used before? 2013/2/1 Massimo Di Pierro massimo@gmail.com javascript:: All that you ask can be done using the scheduler except that your app does not start the process, but submits a request to the scheduler. The scheduler runs the app when a worker is available. This is to prevent spikes in resource utilization when multiple processes start. The task can communicate with the app vid database and/or filesystem (which is ok but not 100% satisfactory). Web2py can monitor and kill running scheduler tasks. This works well for most types of tasks but not for tasks that need a lot of IO with your application. I do not have a satisfactory solution in that case. You want the tasks to have some way to communicate asynchronously with the client and this present major issues, some related with security. On Friday, 1 February 2013 10:22:35 UTC-6, José Luis Redrejo Rodríguez wrote: Hi, This is a question that has been asked several times in the list, and I have also had to implement this kind of app in the past. Now I'm also facing to another application where I need to run a resource_and_time_consuming process managed from web2py. The exact problem is: - From a web page, a long process must be started - The web page must be updated as the process is being done - The web page must be able to cancel the process. In the past I have had to deal with the fact of sessions lockings: web2py server doesn't react while the process is being executed. I've solved this by using session.forget(response), but this solution avoids the use of session variables to update the process in the original web page. I've used background processes, queues, etc, These solutions work when time is not an issue, but not when the synchronization between the process and the webpage must be fast and accurate I wonder if someone has a definitive pattern to do this kind of action. Regards José L. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: converting URL to lowercase before dispatching
You could also edit request.controller, request.function, and request.args (if appropriate) in your model, if you're not using controller-specific models at least. I could see adding a case-normalizing option to the parametric router. +1 -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Record versioning on delete CASCADE
When using versioning. Latest versions of records are never deleted, only filtered out. I think cascade should work as expected. On Friday, 1 February 2013 11:54:25 UTC-6, Felipe Meirelles wrote: The cascade feature should work for record versioning enabled tables? Thanks. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: contribute: db diagram for web2py appadmin
Can you post a link to the latest? On Thursday, 31 January 2013 08:31:53 UTC-6, Paolo Caruccio wrote: first post updated: replaced following files db_diagram.html corrected CDN links. Now the diagram works on https too db_diagram.py [please note that you must copy the code within this file and paste at the bottom of web2py_app/controllers/appadmin.py] deleted a print statement Il giorno mercoledì 30 gennaio 2013 17:23:21 UTC+1, Paolo Caruccio ha scritto: I was not able to succesfully install pygraphviz on my windows7 64bit enviroment but I liked Jose's idea https://groups.google.com/d/topic/web2py/cFqD1M6rkc8/discussion, so I wrote a simple addendum to appadmin in order to show a graph representation of a database. It's not alternative to or a replacement of Jose's graph layout because there are substantial differences. db diagram is interactive (nodes are draggable and clickable) but you cannot save it as an image (anyway it's possible to use a third party application for screenshoots). Moreover it is customizable via css (you will find here attached a css theme for reference) and it's based on jqueryUI framewok. The nodes contain only the table name, so we can draw the layout of a database with (moderately) numerous tables. In order to see table data you have to click on the node. I added some infos like indexed columns (currently available only for sqlite but I think it's not hard to implement for other database engines), the list of other affected tables when we delete a row in cascade mode. The layout (the position of nodes on the screen) is generated trough a force-directed spring algorythm. Therefore the layout is generated dinamically and it will be different each time you refresh the page. For this scope, I adapted and translated to jQuery the original prototype source code freely distributed under the terms of a MIT-style license from http://snipplr.com/view/1950/graph-javascript-framework-version-001/ For a jquery version of this original source code you could visit http://www.graphdracula.net/ The edges are drawn by jsPlumb library ( http://www.jsplumb.org/jquery/demo.html ). All 1.x.x versions of jsPlumb are dual-licensed under both MIT and GPL version 2. Current main limitation: the database must have 'db' key in application databases dictionary. In other words in our model we must have db = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all']) and not, for example, mydb = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all']) The screen dimensions are important too: the layout will be messed on small screens. The code has been tested on latest versions of Firefox, Chrome, Opera, IE(7,8,9) and on a very limited number of databases. So please check for errors and bugs. Installation: 1) append the code within in the attached db_diagram.py in your_application/controllers/appadmin.py file 2) put attached db_diagram.html in to your_application/views folder 3) create a new folder in your_application/static folder and name it db_diagram 4) in to latter put db_diagram.css, db_diagram_print.css, jquery.dbdiagram.js, pencildiagonals.png (an image create by me only for the css theme in bundle) (all these files are here attached) 5) download jsPlumb (jQuery release) from http://code.google.com/p/jsplumb/downloads/list and put jquery.jsPlumb-1.3.16-all-min.js file in your_application/static/db_diagram folder Usage: In your appadmin page you should see a new menu item diagram (see image 1), click on it and you should see the layout of your db. That's all Folks! -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] DAL connection string password in clear in web2py ticket
I think this has been fixed. Can you check trunk? On Friday, 1 February 2013 14:17:10 UTC-6, Richard wrote: Hello, I don't know if it normal or not, but I found that DAL connection string password appear in clear in web2py tickets... Ex.: Variables global request Storage {'function': 'update', 'body': open fi...try_id': '1219', '_formname': 'table1/836'}} builtinTrue True request.args ['table1', '836'] global select function select global db DAL uri=postgres://**:*MYPASSWORDWASHERE*@ 127.0.0.1:5432/database ].approved undefined I got this behavior with web2py 2.3.2 Thanks Richard -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] web2py IDEs; maintain a wiki with plugins?
WingIDE is the only one that I used and worked out of the box without the need of hacks or plugins. On Fri, Feb 1, 2013 at 2:37 PM, Alec Taylor alec.tayl...@gmail.com wrote: Can we bring up a community wiki page for this? For editing web2py apps, I have personally used: Eclipse, Geany, Sublime Text 2, nano and the online editor. Currently my editor of choice is Sublime Text 2. In the quoted message below this repo was mentioned; https://github.com/cassiobotaro/my_sublime However when attempting to install I get this: D:\Projects\my_sublimepython setup.py Traceback (most recent call last): File setup.py, line 6, in module USER = os.getlogin() AttributeError: 'module' object has no attribute 'getlogin' How do I fix this? Also, what's a good 'lightweight' IDE for use with web2py; which supports: - Code completion - Syntax highlighting (preferably for web2py functions+libraries+objects also) - Goto definition (where this function was defined or object was initiated) - Open folder as project (preferably from command-line; currently do this with sublime_text folder_location - Linux and Windows Thanks for all suggestions, Alec Taylor On Sat, Feb 2, 2013 at 3:13 AM, select gr...@delarue-berlin.de wrote: On Thursday, January 31, 2013 1:26:45 PM UTC+1, Johann Spies wrote: On 31 January 2013 13:03, Jason Brower enco...@gmail.com wrote: Interesting that we have coding tools built into our framework. http://www.webdesignerdepot.com/2013/01/web-ides-the-future-of-coding/ When webeditors become as good as emacs, vim, bluefish, I will consider it. For now I did not find any editor that can compete with them. http://ace.ajax.org/build/kitchen-sink.html (c9 editor) is already quite impressive IMHO, with the vim commands enabled it feels quite natural to work with, then again i have ST2 which makes me super happy Here are the plugins I use, in case you use ST2 for web2py too AdvancedNewFile AutoPep8 BracketHighliter (with some color customization) CssComb DocBlockr Emmet (Zen Coding) LiveReload SublimeCodeIndel SublimeLinter ( https://github.com/cassiobotaro/my_sublime/blob/master/SublimeLinter.sublime-settings for web2py) SideBar Regards. Johann -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] DAL connection string password in clear in web2py ticket
I will try... On Fri, Feb 1, 2013 at 3:22 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I think this has been fixed. Can you check trunk? On Friday, 1 February 2013 14:17:10 UTC-6, Richard wrote: Hello, I don't know if it normal or not, but I found that DAL connection string password appear in clear in web2py tickets... Ex.: Variables global request Storage {'function': 'update', 'body': open fi...try_id': '1219', '_formname': 'table1/836'}} builtinTrue True request.args ['table1', '836'] global select function select global db DAL uri=postgres://**:*MYPASSWORDWASHERE*@127.0.0.1:5432/ **database http://127.0.0.1:5432/database ].approved undefined I got this behavior with web2py 2.3.2 Thanks Richard -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: I seem to block the server if I forget about dbg.set_trace
Sorry, I cannot reproduce your issue. Putting dbg.set_trace() blocks your app until your open the debbuger interaction page: http://127.0.0.1:8000/admin/debug/interact As soon as I open it, I can continue and debug it properly. If I don't open it, the page being debugged is blocked, but other pages could be opened (including admin). What webserver are you using? How is it configured? You need to be runing a multithreaded webserver (with only one process) to use the embeed debugger. (I checked the mercurial trunk) Best regards, Mariano Reingart http://www.sistemasagiles.com.ar http://reingart.blogspot.com On Fri, Feb 1, 2013 at 7:49 AM, Tim Richardson t...@growthpath.com.au wrote: Maybe I'm doing something wrong, because I get the same problem on mac with the latest git. I change the welcome app like so from gluon.debug import dbg def index(): example action using the internationalization operator T and flash rendered by views/default/index.html or views/generic.html if you need a simple wiki simple replace the two lines below with: return auth.wiki() response.flash = T(Welcome to web2py!) dbg.set_trace() return dict(message=T('Hello World')) visit the page (with no debugger open) and the same thing happens. No more connections to the server possible. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] DAL connection string password in clear in web2py ticket
Ok, the layout of ticket has change bit... I can't find the exact same information (global db variable), so I am not sure if it really/totally gone. But when I press on locals button, I get a long list of vars and the db var that show the connection string, looks like that : DAL uri=postgres://richard:@127.0.0.1:5432/database I also, search the html file of the ticket and found not trace of the postgres database password... So I presume it ok. Thanks Richard On Fri, Feb 1, 2013 at 3:40 PM, Richard Vézina ml.richard.vez...@gmail.comwrote: I will try... On Fri, Feb 1, 2013 at 3:22 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I think this has been fixed. Can you check trunk? On Friday, 1 February 2013 14:17:10 UTC-6, Richard wrote: Hello, I don't know if it normal or not, but I found that DAL connection string password appear in clear in web2py tickets... Ex.: Variables global request Storage {'function': 'update', 'body': open fi...try_id': '1219', '_formname': 'table1/836'}} builtinTrue True request.args ['table1', '836'] global select function select global db DAL uri=postgres://**:*MYPASSWORDWASHERE*@ 127.0.0.1:5432/**database http://127.0.0.1:5432/database ].approved undefined I got this behavior with web2py 2.3.2 Thanks Richard -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Form for Polymodel
Hi all I'm building an web2py app on GAE which shall be able to manage different sensor types: - integer input - double input - boolean input For each sensor I would like to be able to define a range of good values. For example the water sensor is in a good state when the input is false. The temperature sensor would be in a good state if the input is between 18.0 and 20.5. I did create a Polymodel: sensor - sensor integer - sensor double - sensor boolean Does web2py provide an out of the box interface to Polymodels? Something like SQLFORM.grid. But the Add, Edit and View functionality should change the fields if I select an other class. For example I open the sensor form, press the Add-button, select the class, and enter the values which are required for this class. Or is there an other way to implement something like this? Best wishes -Luca. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: I seem to block the server if I forget about dbg.set_trace
This is with rocket (I just run python web2py.py) I just tried it again, with trunk, having changed the index controller on the welcome app [put a dbg.set_trace()] and then starting python web2py.py (this time on my mac, it's not platform dependent) Rocket stalls, we never make it to the welcome screen. No new sessions can be opened, so there is no possibility to start a debug listener. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Purpose of creating group for each user?
The documentationhttp://web2py.com/books/default/chapter/29/09#Authorizationstates: The creation of the group can be disabled with auth.settings.create_user_groups = None although we do not suggest doing so. Massimo also says herehttps://groups.google.com/d/msg/web2py/gN2LH6pX_IA/kcCBMWeDD8YJthat If you do not have those groups membership causes a nightmare. Yet I've never found any use for the individual user groups. Can someone explain their utility, and why the warnings against dropping them? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: I seem to block the server if I forget about dbg.set_trace
You're right, on my local installation (trunk) I *can* go the admin page and start a debug listener. I'll try that on the Windows server. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: I seem to block the server if I forget about dbg.set_trace
On Saturday, 2 February 2013 08:45:14 UTC+11, Tim Richardson wrote: You're right, on my local installation (trunk) I *can* go the admin page and start a debug listener. I'll try that on the Windows server. Thanks, this works on windows too. I can not start normal apps by visiting a link (they stall) but I can start the admin app and start a debug listener. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: 'Morsel' object has no attribute 'split' ?
Hey Ben- Can you share your version of facebook.py? On Wednesday, February 1, 2012 2:24:29 PM UTC+1, Ben Tammetta wrote: It seemed that version of facebook.py that I was using is just incompatible and/or outdated get_user_from_cookie() was trying to parse a cookie variable out that did not exist from facebook. I ended up passing the correct cookie variable directly in and changing a couple lines to prove that that was the problem. When I ran into other issues it seemed best just to write my own version of facebook.py as I needed certain functions. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Purpose of creating group for each user?
Disabling user groups is only a problem if you use crud which checks for auth.accessible() records based on permissions. If There are no user groups you do not know how to make an object accessible to the user who created. Honestly I envisioned a bigger role in web2py for auth permissions. Turns out most users (including me) do not use them and prefer to set simpler ad hoc permission rules. In case there is no problem in disabling user groups. On Friday, 1 February 2013 15:42:49 UTC-6, Yarin wrote: The documentationhttp://web2py.com/books/default/chapter/29/09#Authorizationstates: The creation of the group can be disabled with auth.settings.create_user_groups = None although we do not suggest doing so. Massimo also says herehttps://groups.google.com/d/msg/web2py/gN2LH6pX_IA/kcCBMWeDD8YJthat If you do not have those groups membership causes a nightmare. Yet I've never found any use for the individual user groups. Can someone explain their utility, and why the warnings against dropping them? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: I seem to block the server if I forget about dbg.set_trace
Thanks you for reporting it! BTW, it should not block other applications, just the thread that is serving the controller with the breakpoint code. In fact, admin is just another web2py app, if it works, any other app should work. I don't know if there is anything mac-specific going on here, but surely it is not the standar designed behavior of the debugger (and it not happening in other platforms). If you do more test, I'll be glad to help you with this, Best regards Mariano Reingart http://www.sistemasagiles.com.ar http://reingart.blogspot.com On Fri, Feb 1, 2013 at 6:51 PM, Tim Richardson t...@growthpath.com.au wrote: On Saturday, 2 February 2013 08:45:14 UTC+11, Tim Richardson wrote: You're right, on my local installation (trunk) I *can* go the admin page and start a debug listener. I'll try that on the Windows server. Thanks, this works on windows too. I can not start normal apps by visiting a link (they stall) but I can start the admin app and start a debug listener. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Purpose of creating group for each user?
Got it- thanks for the explanation On Friday, February 1, 2013 5:21:05 PM UTC-5, Massimo Di Pierro wrote: Disabling user groups is only a problem if you use crud which checks for auth.accessible() records based on permissions. If There are no user groups you do not know how to make an object accessible to the user who created. Honestly I envisioned a bigger role in web2py for auth permissions. Turns out most users (including me) do not use them and prefer to set simpler ad hoc permission rules. In case there is no problem in disabling user groups. On Friday, 1 February 2013 15:42:49 UTC-6, Yarin wrote: The documentationhttp://web2py.com/books/default/chapter/29/09#Authorizationstates: The creation of the group can be disabled with auth.settings.create_user_groups = None although we do not suggest doing so. Massimo also says herehttps://groups.google.com/d/msg/web2py/gN2LH6pX_IA/kcCBMWeDD8YJthat If you do not have those groups membership causes a nightmare. Yet I've never found any use for the individual user groups. Can someone explain their utility, and why the warnings against dropping them? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: how to support video in an app
where do I put the import statement? On Friday, 18 January 2013 16:02:27 UTC, Massimo Di Pierro wrote: from gluon.contrib.autolinks import expand_one {{=expand_one('http://www.youtube.com/watch?v=7yvt2Pt6LRA')}} On Friday, 18 January 2013 04:58:20 UTC-6, sasogeek wrote: at the moment, i can let users upload pictures and use the img tag to allow the image to be displayed on a page, when users upload videos, how do i allow the videos to display and play on the page... and if users submit a youtube link, how do i grab the embed code to display the video on the page? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Purpose of creating group for each user?
I think the current web2py access control mechanism is unnecessarily complicated. It is both role based and task based. But this difference here is just semantics (i.e. you can define a group that can do a certain task). The only actually difference is in terms of implementation, not conceptual. Task based access can be defined on objects (tables). But then again, this is just unnecessary, because role based access can also be made to operate on objects/tables. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: how to support video in an app
If you need it in a view {{from gluon.contrib.autolinks import expand_one}} Mind that expend_one may call a service (oembed service). This may may delay the generation of the page and even block it if the service is not available. The second argument of expand one is a dictionary and it uses to cache the expanded links. You can do {{=expand_one(' http://www.youtube.com/watch?v=7yvt2Pt6LRA',cache.ram('mycache',lambda:dict(),3600))http://www.youtube.com/watch?v=7yvt2Pt6LRA') }} and this will keep the expended links cached for 3600 seconds in the dict() The dict will be persistant in ram. On Friday, 1 February 2013 17:25:04 UTC-6, sasogeek wrote: where do I put the import statement? On Friday, 18 January 2013 16:02:27 UTC, Massimo Di Pierro wrote: from gluon.contrib.autolinks import expand_one {{=expand_one('http://www.youtube.com/watch?v=7yvt2Pt6LRA')}} On Friday, 18 January 2013 04:58:20 UTC-6, sasogeek wrote: at the moment, i can let users upload pictures and use the img tag to allow the image to be displayed on a page, when users upload videos, how do i allow the videos to display and play on the page... and if users submit a youtube link, how do i grab the embed code to display the video on the page? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: how to support video in an app
when the page loads and i click on view page source, here's what's there... iframe width=480 height=270 src=http://www.youtube.com/embed/7yvt2Pt6LRA?feature=oembed; frameborder=0 allowfullscreen/iframe and it appears as html on the actual page... On Saturday, 2 February 2013 00:47:26 UTC, Massimo Di Pierro wrote: If you need it in a view {{from gluon.contrib.autolinks import expand_one}} Mind that expend_one may call a service (oembed service). This may may delay the generation of the page and even block it if the service is not available. The second argument of expand one is a dictionary and it uses to cache the expanded links. You can do {{=expand_one(' http://www.youtube.com/watch?v=7yvt2Pt6LRA',cache.ram('mycache',lambda:dict(),3600))http://www.youtube.com/watch?v=7yvt2Pt6LRA') }} and this will keep the expended links cached for 3600 seconds in the dict() The dict will be persistant in ram. On Friday, 1 February 2013 17:25:04 UTC-6, sasogeek wrote: where do I put the import statement? On Friday, 18 January 2013 16:02:27 UTC, Massimo Di Pierro wrote: from gluon.contrib.autolinks import expand_one {{=expand_one('http://www.youtube.com/watch?v=7yvt2Pt6LRA')}} On Friday, 18 January 2013 04:58:20 UTC-6, sasogeek wrote: at the moment, i can let users upload pictures and use the img tag to allow the image to be displayed on a page, when users upload videos, how do i allow the videos to display and play on the page... and if users submit a youtube link, how do i grab the embed code to display the video on the page? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: how to support video in an app
Sorry my bad: {{=XML(expand_one(' http://www.youtube.com/watch?v=7yvt2Pt6LRA',cache.ram('mycache',lambda:dict(),3600))http://www.youtube.com/watch?v=7yvt2Pt6LRA') )}} expand one converts to HTML but then is must be wrapped into XML else it gets escaped. On Friday, 1 February 2013 19:10:12 UTC-6, sasogeek wrote: when the page loads and i click on view page source, here's what's there... lt;iframe width=quot;480quot; height=quot;270quot; src=quot; http://www.youtube.com/embed/7yvt2Pt6LRA?feature=oembedquot; frameborder=quot;0quot; allowfullscreengt;lt;/iframegt; and it appears as html on the actual page... On Saturday, 2 February 2013 00:47:26 UTC, Massimo Di Pierro wrote: If you need it in a view {{from gluon.contrib.autolinks import expand_one}} Mind that expend_one may call a service (oembed service). This may may delay the generation of the page and even block it if the service is not available. The second argument of expand one is a dictionary and it uses to cache the expanded links. You can do {{=expand_one(' http://www.youtube.com/watch?v=7yvt2Pt6LRA',cache.ram('mycache',lambda:dict(),3600))http://www.youtube.com/watch?v=7yvt2Pt6LRA') }} and this will keep the expended links cached for 3600 seconds in the dict() The dict will be persistant in ram. On Friday, 1 February 2013 17:25:04 UTC-6, sasogeek wrote: where do I put the import statement? On Friday, 18 January 2013 16:02:27 UTC, Massimo Di Pierro wrote: from gluon.contrib.autolinks import expand_one {{=expand_one('http://www.youtube.com/watch?v=7yvt2Pt6LRA')}} On Friday, 18 January 2013 04:58:20 UTC-6, sasogeek wrote: at the moment, i can let users upload pictures and use the img tag to allow the image to be displayed on a page, when users upload videos, how do i allow the videos to display and play on the page... and if users submit a youtube link, how do i grab the embed code to display the video on the page? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: Web2Py on OpenShift
Hello Andrew On Fri, Feb 1, 2013 at 11:43 PM, Andrew andrew.replo...@gmail.com wrote: Ok that's the first (and hopefully only!) problem. That's the default application file. Each application will need a slightly different wsgi-handler and I had to tweak it for OpenShift. You need to use the one from the Github project here: https://github.com/prelegalwonder/openshift_web2py/blob/master/wsgi/application Like I said, the fastest way is to follow the readme verbatim since those git commands replicate the template in the github project and then you just make your customizations from there and commit / push. Let me know how that works. Thanks for your reply. Appreciate it. I'm a beginner here and all I'm doing is the manual work. This is what I did : 1) First I updated the application file as your said and did commit push and I got : Internal Server Error. At least something is happening now. 2) Then to make things work, I ran those two git commands and it got merged with master. Then I did push and I got : *And it worked!* * * Now the issue is : I have followed the password hashed line as you said i.e. to copy parameters_8080.oy to wsgi/web2py. However the applications I see in the web2py on openshift link of mine doesn't contain my application. It contains default application, even those which I had deleted. How can this be possible ? -- Thank You and Warm Regards, Chetan Arvind Patil, www.chetanpatil.info -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: Web2Py on OpenShift
Hello Andrew, On Sat, Feb 2, 2013 at 8:53 AM, Chetan Patil chtpa...@gmail.com wrote: Now the issue is : I have followed the password hashed line as you said i.e. to copy parameters_8080.oy to wsgi/web2py. However the applications I see in the web2py on openshift link of mine doesn't contain my application. It contains default application, even those which I had deleted. How can this be possible ? Fine. I got whats happening now. The web2py on openshift is fetching files under wsgi/web2py After moving application under wsgi/web2py/application things got working. -- Thank You and Warm Regards, Chetan Arvind Patil, www.chetanpatil.info -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: Web2Py on OpenShift
Hello Andrew, Thanks for your help due to which I was able to get web2py app up and running. May you please point me to some weblinks where in I will be able to understand on how to host only the application and to avoid visitors to navigate into web2py IDE and other admins links. Like I just want this link to be active and nothings else : rhAppname/myapp/default/index -- Thank You and Warm Regards, Chetan Arvind Patil, www.chetanpatil.info -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] html5 code to load/save textarea or other input
https://gist.github.com/4696084 -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Adding a scheduled task using the scheduler results in db error.
Howdy! I have been following the video tutorial to create a schedule task. Inside the bottom of the task to be run I have: def main(): o = MarketReader() o.run() from gluon.scheduler import Scheduler Scheduler(db,dict(update_market=main)) When I browse back to the database management, I receive the following error: TICKET ID 127.0.0.1.2013-02-01.19-58-07.6e66c0a0-a0fa-49e0-b6b6-70ddb741fbeb type 'exceptions.SyntaxError' invalid table/column name output is a ALL reserved SQL keywordVERSIONweb2py™(2, 3, 2, datetime.datetime(2012, 12 , 17, 15, 3, 30), 'stable')PythonPython 2.7.3: /usr/bin/python Traceback (most recent call last): File /home/johnnyfive/Downloads/web2py/gluon/restricted.py, line 212, in restricted exec ccode in environment File /home/johnnyfive/Downloads/web2py/applications/EveMarket/models/tasks.py http://127.0.0.1:8000/admin/default/edit/EveMarket/models/tasks.py, line 101, in module Scheduler(db,dict(update_market=main)) File /home/johnnyfive/Downloads/web2py/gluon/scheduler.py, line 449, in __init__ self.define_tables(db, migrate=migrate) File /home/johnnyfive/Downloads/web2py/gluon/scheduler.py, line 513, in define_tables migrate=migrate) File /home/johnnyfive/Downloads/web2py/gluon/dal.py, line 7186, in define_table table = self.lazy_define_table(tablename,*fields,**args) File /home/johnnyfive/Downloads/web2py/gluon/dal.py, line 7203, in lazy_define_table table = table_class(self, tablename, *fields, **args) File /home/johnnyfive/Downloads/web2py/gluon/dal.py, line 7609, in __init__ db.check_reserved_keyword(field_name) File /home/johnnyfive/Downloads/web2py/gluon/dal.py, line 6930, in check_reserved_keyword 'invalid table/column name %s is a %s reserved SQL keyword' % (name, backend.upper())) SyntaxError: invalid table/column name output is a ALL reserved SQL keyword Variablesbackend'all'name'output'backend.upperbuilt-in method upper of str object Any ideas? I'm feeling like the task scheduler is trying to create a database column with the name of output? Thanks! -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Adding a scheduled task using the scheduler results in db error.
You have an older version of the scheduler (and web2py). Your scheduler tables have a field called output This field was renamed run_output. This is because some database engines consider output a reserved keyword. Massimo On Friday, 1 February 2013 22:10:48 UTC-6, Morgan Hein wrote: Howdy! I have been following the video tutorial to create a schedule task. Inside the bottom of the task to be run I have: def main(): o = MarketReader() o.run() from gluon.scheduler import Scheduler Scheduler(db,dict(update_market=main)) When I browse back to the database management, I receive the following error: TICKET ID 127.0.0.1.2013-02-01.19-58-07.6e66c0a0-a0fa-49e0-b6b6-70ddb741fbeb type 'exceptions.SyntaxError' invalid table/column name output is a ALL reserved SQL keywordVERSIONweb2py™(2, 3, 2, datetime.datetime(2012, 12, 17, 15, 3, 30), 'stable')PythonPython 2.7.3: /usr/bin/python Traceback (most recent call last): File /home/johnnyfive/Downloads/web2py/gluon/restricted.py, line 212, in restricted exec ccode in environment File /home/johnnyfive/Downloads/web2py/applications/EveMarket/models/tasks.py http://127.0.0.1:8000/admin/default/edit/EveMarket/models/tasks.py, line 101, in module Scheduler(db,dict(update_market=main)) File /home/johnnyfive/Downloads/web2py/gluon/scheduler.py, line 449, in __init__ self.define_tables(db, migrate=migrate) File /home/johnnyfive/Downloads/web2py/gluon/scheduler.py, line 513, in define_tables migrate=migrate) File /home/johnnyfive/Downloads/web2py/gluon/dal.py, line 7186, in define_table table = self.lazy_define_table(tablename,*fields,**args) File /home/johnnyfive/Downloads/web2py/gluon/dal.py, line 7203, in lazy_define_table table = table_class(self, tablename, *fields, **args) File /home/johnnyfive/Downloads/web2py/gluon/dal.py, line 7609, in __init__ db.check_reserved_keyword(field_name) File /home/johnnyfive/Downloads/web2py/gluon/dal.py, line 6930, in check_reserved_keyword 'invalid table/column name %s is a %s reserved SQL keyword' % (name, backend.upper())) SyntaxError: invalid table/column name output is a ALL reserved SQL keyword Variablesbackend'all'name'output'backend.upperbuilt-in method upper of str object Any ideas? I'm feeling like the task scheduler is trying to create a database column with the name of output? Thanks! -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] how to get an excerpt from a link
I want to do something similar to how facebook reatcs to links... let's say a user makes a post with a link in it (the post is not necessarily just the link) i want to be able to grab the link from the post, make it clickable, as well as a little excerpt from the contents in the page that link is anchored to. eg. blabla bla blablalbal bla blalba blalba crap! this is a link http://domain.com/somepage.html is a cool blog page. when a user posts the above example, i want to make http://domain.com/somepage.html into an actual link which is clickable, as well as show some sort of excerpt from the contents in that page... i used fb as an example so it's easy to understand what i want to accomplish :) help? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: I seem to block the server if I forget about dbg.set_trace
On Saturday, 2 February 2013 09:42:38 UTC+11, Mariano Reingart wrote: Thanks you for reporting it! BTW, it should not block other applications, just the thread that is serving the controller with the breakpoint code. In fact, admin is just another web2py app, if it works, any other app should work. I don't know if there is anything mac-specific going on here, but surely it is not the standar designed behavior of the debugger (and it not happening in other platforms). If you do more test, I'll be glad to help you with this, Hi Mariano, it seems to block other applications on both Windows and Mac. The behaviour in my issue report is what I see, except that I didn't try going directly to the admin app. So if you make that trivial change in the wecome app to do a dbg.set_trace() in the index controller, it will stall when going to welcome, and I also experience stalls in every other app. For example, I just tried again a) started web2py using rocket b) went straight to admin, and via the editor I changed the default controller of the welcome app c) in other browser tab, went to welcome and it stalled on that tab d) back in the admin app, I tried to access the examples app by clicking the link examples (which is http://127.0.0.1:8000/examples/default/index) but it stalls. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: I seem to block the server if I forget about dbg.set_trace
No, I'm wrong, the examples app does appear on the mac, there was a long delay. Sometimes rocket is very slow to respond on the mac. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] how to run web2py on Mint 9
I have Mint 9 on my desktop when I type *python2.5 web2py.py* I get: *no command 'python2.5' found* when I type *python web2py.py* I get:* importError: No module named gluon.widget* any suggestions? Should I install python2.5? thanks, Alex Glaros -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.