[web2py] Unable to send email on server in web2py.....
Hie folks.. I know this question is already been asked but I didn't get any help from those answers. please hava look at this I am unable to send email in server(to be specific webfaction.com) ... but it's running fine on local host all these three lines in db.py are set to true. auth.settings.registration_requires_verification = True auth.settings.registration_requires_approval = True auth.settings.reset_password_requires_verification = True When I complete the registration form a flash appears on the top-right corner of the page with a flash message Unable to send mail These are the settings of the mail server in db.py mail = auth.settings.mailer mail.settings.server = 'smtp.gmail.com:587' mail.settings.sender = 'fakeid425s...@gmail.com' mail.settings.tls = False mail.settings.login ='fakeid425s...@gmail.com:secret' -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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: Important New Year News: Edison Award
good luck you and web2py deserve it. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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: sessions and logout
Hello Massimo, Thank you very much for your answer. I've made a copypaste of your code, my code is now: def logout(): if auth.user: auth.logout(logout_onlogout=lambda user: session.auth=None) but I get a invalid syntax error in line 154 char 61 trying to save the file: line 154 is auth.logout(logout_onlogout=lambda user: session.auth=None) and char 61 is '='. what am i doing wrong? On Saturday, January 4, 2014 3:38:06 AM UTC+1, Massimo Di Pierro wrote: No because auth.logout(next=...) redirects to he value of next. Next defaults to auth.settings.logout_next which is set to URL('index') What you want is: def logout(): auth.logout(logout_onlogout=lambda user: session.auth=None) On Friday, 3 January 2014 19:44:43 UTC-6, Wonton wrote: Hello everyone, Recently I suffered the problem with the number of session files growing very fast in my server. This worried me a lot because the server is a development environment with only 4 or 5 testers, so when the number of users is higher I guess I will have a big problem with this issue. I've tried to investigate about this but I'm not expert working with web2py or with servers, so I have some questions: - A session file is created associated to a user each time that user logs in. Is this ok? - My users make a login through auth.login_bare(user, password), does this create a session file then? - What should be the code to remove the session file of a user when he/she makes a logout? - I've set my auth.settings.expiration to 9, does this affect to sessions too? As far as I know it only affects to when an inactive user is automatically logged out, is this correct? - Testing this I've seen that with no logged users in my server, if I manually remove the sessions files, some of them are created again!! Why and how? As I said I have no users logged in the server. Regarding to the logout problem I've seen that my logout method is as simple as this: def logout(): if auth.user: auth.log_event(auth.messages.logout_log, auth.user) session.auth = None I don't really make a logout of the user so I change my method to this: def logout(): if auth.user: print 'check 1' auth.logout() print 'check 2' session.auth = None But when this method is called, the output is this: check1 check 2 is never printed so, has the user actually make a logout? I know they are a lot of questions, but any kind of help will be very appreciated. Kind regards! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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] converted url %3F and %3D
Hi, for some reason some external links converted the ?id=10 in one of my urls to %3Fid%3D10 my question is how can I convert that request back to the existing url. Preferably for all sites if it should happen again. Do I have to do some nginx magic to do that or can it be done within web2py? thanks -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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 declare a pre-defined sqlite database
Thanks, that seems the kind of thing I want, however it seems to be on about legacy_db - what does that mean/do? Also, the output is rather shorter than I expected. Each table entry only contains: # legacy_db.define_table('wfs100getfeature', migrate=False) Is this all I need? (I'm not in a position to test it myself - I'm new to web2py and don't have any sort of application yet). Also, there's a trivial bug: print 'USAGE:\n\nextract_mysql_models.py data_basename\n\n' Shouldn't say mysql there. :-) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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: auth signature and enable record versioning
2) Tables are only archived if they have a Field('modified_on','datetime') such as created by the signature. Without it you do not know when changes are made and versioning is useless. 1) Does this work? # on_define_bank def on_define_bank(table): pass # create table : bank db.define_table('bank', Field('bank',notnull=True), auth.signature, on_define = on_define_bank, format = '%(bank)s') Whats is on_define_bank supposed to do? On Friday, 3 January 2014 23:54:41 UTC-6, 黄祥 wrote: hi, i wonder what is the correlation between auth signature and enable record versioning. e.g. # on_define_bank def on_define_bank(table): # notnull table.bank.notnull = True # create table : bank db.define_table('bank', Field('bank'), auth.signature, on_define = on_define_bank, format = '%(bank)s') # enable_record_versioning db.bank._enable_record_versioning() # 1st question this one work fine but if i make it lazy for enable_record_versioning, the archieve table is created but can't be accessed (it return an error), so i must comment or disable auth.signature to make it work. i wonder it why? e.g. # on_define_bank def on_define_bank(table): # enable_record_versioning table._enable_record_versioning() # notnull table.bank.notnull = True # create table : bank db.define_table('bank', Field('bank'), on_define = on_define_bank, format = '%(bank)s') # 2nd question let say i didn't use enable_record_versioning for each table and use auth.enable_record_versioning(db) at the end of define table. if i define auth.signature for each table, it will create the table archieve (enable_record_versioning is work), but when i comment or disable auth.signature on each tables, only auth tables is get the table archieve (enable_record_versioning work only in auth tables). i wonder it why? any explaination about this? thanks and best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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: sessions and logout
Try: auth.logout(onlogout=lambda user: session.update({'auth':None})) On Saturday, 4 January 2014 05:56:23 UTC-6, Wonton wrote: Hello Massimo, Thank you very much for your answer. I've made a copypaste of your code, my code is now: def logout(): if auth.user: auth.logout(logout_onlogout=lambda user: session.auth=None) but I get a invalid syntax error in line 154 char 61 trying to save the file: line 154 is auth.logout(logout_onlogout=lambda user: session.auth=None)and char 61 is '='. what am i doing wrong? On Saturday, January 4, 2014 3:38:06 AM UTC+1, Massimo Di Pierro wrote: No because auth.logout(next=...) redirects to he value of next. Next defaults to auth.settings.logout_next which is set to URL('index') What you want is: def logout(): auth.logout(logout_onlogout=lambda user: session.auth=None) On Friday, 3 January 2014 19:44:43 UTC-6, Wonton wrote: Hello everyone, Recently I suffered the problem with the number of session files growing very fast in my server. This worried me a lot because the server is a development environment with only 4 or 5 testers, so when the number of users is higher I guess I will have a big problem with this issue. I've tried to investigate about this but I'm not expert working with web2py or with servers, so I have some questions: - A session file is created associated to a user each time that user logs in. Is this ok? - My users make a login through auth.login_bare(user, password), does this create a session file then? - What should be the code to remove the session file of a user when he/she makes a logout? - I've set my auth.settings.expiration to 9, does this affect to sessions too? As far as I know it only affects to when an inactive user is automatically logged out, is this correct? - Testing this I've seen that with no logged users in my server, if I manually remove the sessions files, some of them are created again!! Why and how? As I said I have no users logged in the server. Regarding to the logout problem I've seen that my logout method is as simple as this: def logout(): if auth.user: auth.log_event(auth.messages.logout_log, auth.user) session.auth = None I don't really make a logout of the user so I change my method to this: def logout(): if auth.user: print 'check 1' auth.logout() print 'check 2' session.auth = None But when this method is called, the output is this: check1 check 2 is never printed so, has the user actually make a logout? I know they are a lot of questions, but any kind of help will be very appreciated. Kind regards! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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: converted url %3F and %3D
How are you generating those links? Can you show the code? On Saturday, 4 January 2014 05:57:10 UTC-6, BlueShadow wrote: Hi, for some reason some external links converted the ?id=10 in one of my urls to %3Fid%3D10 my question is how can I convert that request back to the existing url. Preferably for all sites if it should happen again. Do I have to do some nginx magic to do that or can it be done within web2py? thanks -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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: Unable to send email on server in web2py.....
Hie folks.. I know this question is already been asked but I didn't get any help from those answers. please hava look at this I am unable to send email in server(to be specific webfaction.com) ... but it's running fine on local host Have you checked this thread? https://groups.google.com/d/msg/web2py/riP3IpRWYMA/rWFQnO7-9pgJ Here is how you configure the mail object (web2py book): http://www.web2py.com/books/default/chapter/29/08/emails-and-sms#Setting-up-email -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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: sessions and logout
Is logout_onlogout= or onlogout=, both ways have no errors and I guess the logout has been made correctly. If I put again the prints: def logout(): if auth.user: print 'check 1' auth.logout(logout_onlogout=lambda user: session.update({'auth':None})) print 'check 2' check 2 doesn't appear, but I guess is because of what you said in your previous post, logout redirects automatically to index, so ok. I think my logout problem is solved, thak you very much again. If you don't mind I will write again my questions about sessions (I still have problems trying to understand how they work), just in case anyone has any clue about this: - A session file is created associated to a user each time that user logs in. Is this ok? - My users make a login through auth.login_bare(user, password), does this create a session file then? - What should be the code to remove the session file of a user when he/she makes a logout? - I've set my auth.settings.expiration to 9, does this affect to sessions too? As far as I know it only affects to when an inactive user is automatically logged out, is this correct? - Testing this I've seen that with no logged users in my server, if I manually remove the sessions files, some of them are created again!! Why and how? As I said I have no users logged in the server. On Saturday, January 4, 2014 1:20:29 PM UTC+1, Massimo Di Pierro wrote: Try: auth.logout(onlogout=lambda user: session.update({'auth':None})) On Saturday, 4 January 2014 05:56:23 UTC-6, Wonton wrote: Hello Massimo, Thank you very much for your answer. I've made a copypaste of your code, my code is now: def logout(): if auth.user: auth.logout(logout_onlogout=lambda user: session.auth=None) but I get a invalid syntax error in line 154 char 61 trying to save the file: line 154 is auth.logout(logout_onlogout=lambda user: session.auth=None)and char 61 is '='. what am i doing wrong? On Saturday, January 4, 2014 3:38:06 AM UTC+1, Massimo Di Pierro wrote: No because auth.logout(next=...) redirects to he value of next. Next defaults to auth.settings.logout_next which is set to URL('index') What you want is: def logout(): auth.logout(logout_onlogout=lambda user: session.auth=None) On Friday, 3 January 2014 19:44:43 UTC-6, Wonton wrote: Hello everyone, Recently I suffered the problem with the number of session files growing very fast in my server. This worried me a lot because the server is a development environment with only 4 or 5 testers, so when the number of users is higher I guess I will have a big problem with this issue. I've tried to investigate about this but I'm not expert working with web2py or with servers, so I have some questions: - A session file is created associated to a user each time that user logs in. Is this ok? - My users make a login through auth.login_bare(user, password), does this create a session file then? - What should be the code to remove the session file of a user when he/she makes a logout? - I've set my auth.settings.expiration to 9, does this affect to sessions too? As far as I know it only affects to when an inactive user is automatically logged out, is this correct? - Testing this I've seen that with no logged users in my server, if I manually remove the sessions files, some of them are created again!! Why and how? As I said I have no users logged in the server. Regarding to the logout problem I've seen that my logout method is as simple as this: def logout(): if auth.user: auth.log_event(auth.messages.logout_log, auth.user) session.auth = None I don't really make a logout of the user so I change my method to this: def logout(): if auth.user: print 'check 1' auth.logout() print 'check 2' session.auth = None But when this method is called, the output is this: check1 check 2 is never printed so, has the user actually make a logout? I know they are a lot of questions, but any kind of help will be very appreciated. Kind regards! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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: auth signature and enable record versioning
On Saturday, January 4, 2014 7:15:58 PM UTC+7, Massimo Di Pierro wrote: 2) Tables are only archived if they have a Field('modified_on','datetime') such as created by the signature. Without it you do not know when changes are made and versioning is useless. it's make sense and make me clear about signature and record versioning, thank you so much for your detail explaination, massimo 1) Does this work? # on_define_bank def on_define_bank(table): pass # create table : bank db.define_table('bank', Field('bank',notnull=True), auth.signature, on_define = on_define_bank, format = '%(bank)s') Whats is on_define_bank supposed to do? i usually put the lazy table in on_define, i've seen in this forum that the lazy can be achieved using on_define. is it recommended or not for using on_define to put the lazy table? of course your code to put the lazy in the field constructor is also work, but sometime, if application getting big or complex, it's make my head spinning so i manage the lazy on the on_define. e.g. 1. lazy in on_define # on_define_bank def on_define_bank(table): # label table.bank.label = T('Bank') table.ebanking.label = T('eBanking') # notnull table.bank.notnull = True # represent table.ebanking.represent = lambda ebanking, field: \ A(ebanking, _title=T(eBanking), _target=_blank, _href=%s % ebanking) # required table.bank.required = True # requires table.bank.requires = IS_NOT_IN_DB(db, table.bank) # unique table.bank.unique = True # create table : bank db.define_table('bank', Field('bank'), Field('ebanking'), auth.signature, on_define = on_define_bank, format = '%(bank)s') e.g. 2. lazy in the field constructor that make my head spinning # create table : bank db.define_table('bank', Field('bank', label = T('Bank'), notnull = True, required = True, requires = IS_NOT_IN_DB(db, 'bank.bank'), unique = True), Field('ebanking', label = T('eBanking'), represent = lambda ebanking, field: A(ebanking, _title=T(eBanking), _target=_blank, _href=%s % ebanking) ), auth.signature, format = '%(bank)s') another way around, of course i can put it the field constructor outside of the define table and not using the on_define function, but sometime when the application getting bigger and more complex i need the same field type and name so that i can copas (copy paste) without replacing the table name. e.g. 3. lazy table outside the define table without on define. # create table : bank db.define_table('bank', Field('bank'), Field('ebanking'), auth.signature, format = '%(bank)s') # label db.bank.bank.label = T('Bank') db.bank.ebanking.label = T('eBanking') # notnull db.bank.bank.notnull = True # represent db.bank.ebanking.represent = lambda ebanking, field: \ A(ebanking, _title=T(eBanking), _target=_blank, _href=%s % ebanking) # required db.bank.bank.required = True # requires db.bank.bank.requires = IS_NOT_IN_DB(db, 'bank.bank') # unique db.bank.bank.unique = True don't know which is the recommended way (between the 3 examples above) in term of make the lazy table in web2py. any suggestion or explaination about this? thanks so much and best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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 declare a pre-defined sqlite database
pardon me, which script that you execute? because in the scripts folder there is 4 scripts for extract the table into models (mysql, oracle, pgsql and sqlite). and which web2py version did you use and what is your os environment? please use the script that match with your database backend. and for legacy db please take a look at the book in dal chapter ref: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Legacy-databases-and-keyed-tables best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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: sessions and logout
it is either auth.settings.logout_onlogout = ... or auth.logout(onlogout= ...) As I answered in my previous response. logout always redirects so check2 will never be printed. On Saturday, 4 January 2014 06:32:39 UTC-6, Wonton wrote: Is logout_onlogout= or onlogout=, both ways have no errors and I guess the logout has been made correctly. If I put again the prints: def logout(): if auth.user: print 'check 1' auth.logout(logout_onlogout=lambda user: session.update({'auth':None})) print 'check 2' check 2 doesn't appear, but I guess is because of what you said in your previous post, logout redirects automatically to index, so ok. I think my logout problem is solved, thak you very much again. If you don't mind I will write again my questions about sessions (I still have problems trying to understand how they work), just in case anyone has any clue about this: - A session file is created associated to a user each time that user logs in. Is this ok? - My users make a login through auth.login_bare(user, password), does this create a session file then? - What should be the code to remove the session file of a user when he/she makes a logout? - I've set my auth.settings.expiration to 9, does this affect to sessions too? As far as I know it only affects to when an inactive user is automatically logged out, is this correct? - Testing this I've seen that with no logged users in my server, if I manually remove the sessions files, some of them are created again!! Why and how? As I said I have no users logged in the server. On Saturday, January 4, 2014 1:20:29 PM UTC+1, Massimo Di Pierro wrote: Try: auth.logout(onlogout=lambda user: session.update({'auth':None})) On Saturday, 4 January 2014 05:56:23 UTC-6, Wonton wrote: Hello Massimo, Thank you very much for your answer. I've made a copypaste of your code, my code is now: def logout(): if auth.user: auth.logout(logout_onlogout=lambda user: session.auth=None) but I get a invalid syntax error in line 154 char 61 trying to save the file: line 154 is auth.logout(logout_onlogout=lambda user: session.auth=None)and char 61 is '='. what am i doing wrong? On Saturday, January 4, 2014 3:38:06 AM UTC+1, Massimo Di Pierro wrote: No because auth.logout(next=...) redirects to he value of next. Next defaults to auth.settings.logout_next which is set to URL('index') What you want is: def logout(): auth.logout(logout_onlogout=lambda user: session.auth=None) On Friday, 3 January 2014 19:44:43 UTC-6, Wonton wrote: Hello everyone, Recently I suffered the problem with the number of session files growing very fast in my server. This worried me a lot because the server is a development environment with only 4 or 5 testers, so when the number of users is higher I guess I will have a big problem with this issue. I've tried to investigate about this but I'm not expert working with web2py or with servers, so I have some questions: - A session file is created associated to a user each time that user logs in. Is this ok? - My users make a login through auth.login_bare(user, password), does this create a session file then? - What should be the code to remove the session file of a user when he/she makes a logout? - I've set my auth.settings.expiration to 9, does this affect to sessions too? As far as I know it only affects to when an inactive user is automatically logged out, is this correct? - Testing this I've seen that with no logged users in my server, if I manually remove the sessions files, some of them are created again!! Why and how? As I said I have no users logged in the server. Regarding to the logout problem I've seen that my logout method is as simple as this: def logout(): if auth.user: auth.log_event(auth.messages.logout_log, auth.user) session.auth = None I don't really make a logout of the user so I change my method to this: def logout(): if auth.user: print 'check 1' auth.logout() print 'check 2' session.auth = None But when this method is called, the output is this: check1 check 2 is never printed so, has the user actually make a logout? I know they are a lot of questions, but any kind of help will be very appreciated. Kind regards! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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: auth signature and enable record versioning
just make a correction the example 3 is unlazy table. best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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 declare a pre-defined sqlite database
Hi Stifan, pardon me, which script that you execute? because in the scripts folder there is 4 scripts for extract the table into models (mysql, oracle, pgsql and sqlite). and which web2py version did you use and what is your os environment? please use the script that match with your database backend. I used extract_sqlite_models.py - which is why I reported the bug about the text saying MySQL. On Windows using Python 2.7 and the database is sqlite. and for legacy db please take a look at the book in dal chapter ref: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Legacy-databases-and-keyed-tables Thanks, I've just had a read through the legacy section (it's short), but it's not helped much. As best I can tell from reading that, basically web2py will only be able to use the id column; so I won't be able to query by other columns (which is what I need)? Also, I don't have an auto-incrementing id column in my tables or any primary key in most of them (nor do I particularly want one). I'm still no closer to understanding this I'm afraid. Does this mean there's no good way to use non-web2py tables in web2py? Thanks, Jonathan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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: converted url %3F and %3D
External links to my side from a diffrent website i got no control over. Thats the problem Am 04.01.2014 13:21 schrieb Massimo Di Pierro massimo.dipie...@gmail.com : How are you generating those links? Can you show the code? On Saturday, 4 January 2014 05:57:10 UTC-6, BlueShadow wrote: Hi, for some reason some external links converted the ?id=10 in one of my urls to %3Fid%3D10 my question is how can I convert that request back to the existing url. Preferably for all sites if it should happen again. Do I have to do some nginx magic to do that or can it be done within web2py? thanks -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/dqxeN7fQS-Y/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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] IS_IN_SET in SQLFORM.dictform
Hello :) I have following code in controller: session.config = dict(NAME = 'a') form = SQLFORM.dictform(session.config) form.custom.widget.NAME['requires'] = IS_IN_SET(('a','b','c','d','e'), error_message=Choose between a and e) if form.process().accepted: session.config.update(form.vars) validator is working OK, but I would like to change the type of NAME field in form to select dropdown, instead simple input. How to do this ? How to change the type of field after it is created in any SQLFORM.* type ? Regards brushek -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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: executesql as_dict=True replacing ids during join
Haven't tested it, but looks good. I left a comment on github suggesting a more helpful error message. Anthony On Friday, January 3, 2014 11:01:19 PM UTC-5, Massimo Di Pierro wrote: OK. Done. Please check it. On Friday, 3 January 2014 20:54:02 UTC-6, Anthony wrote: I agree. Because executesql() can execute any arbitrary SQL, it can't know how to properly name the columns, so the best approach when there are duplicate column names is probably just to require explicit specification via the colnames argument. Anthony On Friday, January 3, 2014 9:18:53 PM UTC-5, Massimo Di Pierro wrote: I think if there is a duplicated entry, and as_dict=True we should raise an exception and explain the reasons. Unless there is a way to make this this not ambiguous. On Thursday, 2 January 2014 19:13:26 UTC-6, Anthony wrote: This may be tricky. In case of as_dict=True, executesql() uses the adapter.cursor.description to get the column names, but there is no indication which column name comes from which table, so if both tables have the same column name, the dict will only get one of the columns. executesql() does take a colnames argument, so you can instead supply the column names directly, which is probably the best we can do in case of a join. Anthony On Thursday, January 2, 2014 7:49:20 PM UTC-5, Massimo Di Pierro wrote: I think it is a bug. Please open a ticket linking this thread. On Thursday, 2 January 2014 13:20:04 UTC-6, ssuresh wrote: I found a peculiar problem when executing a join query on two tables. I have two tables table1 and table2. Both have ids as their pks. table1 has a FK on table2 using table2_id field. Now when i do an executesql of the following query, rows=executesql('select * from table1,table2 where table1.table2_id= table2.id',as_dict=True) I always get only one id field in the return dict and I dont know whether the id is of table1 or table2. Am I doing something wrong, or is it a possible bug? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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: Important New Year News: Edison Award
May the Lord bless you and your wonderful Framework and Community magnificently, Massimo. Love and peace, Joe On Friday, January 3, 2014 8:08:38 PM UTC-8, Massimo Di Pierro wrote: Web2py/me have been nominated for the Edison Award. Please wish web2py (and me) good luck. :-) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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: Happy New Year everybody!
The Community is growing. Congratulations, Massimo. Love and peace, Joe On Wednesday, January 1, 2014 2:06:30 PM UTC-8, Massimo Di Pierro wrote: Happy new year everybody, some good news: 1) python is growing popularity https://sites.google.com/site/pydatalog/pypl/python-blog/pythonisthelanguageoftheyear 2) there will be a web2py tutorial at PyCon. I will tell you more asap! 3) the web2py community is still growing and in 2013 I saw more and more high quality programs built with web2py. Massimo -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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: sessions and logout
- A session file is created associated to a user each time that user logs in. Is this ok? Yes, it is OK. - My users make a login through auth.login_bare(user, password), does this create a session file then? Yes. - What should be the code to remove the session file of a user when he/she makes a logout? The session filename is stored in response.session_filename, so you could do it in an onlogout callback. Perhaps we should make this the default whenever session.renew() is called (which happens by default when someone logs in or out), since the old file gets abandoned at that point. Maybe open an issue on Google Code and refer to this post. Also, there is a script you can use to periodically clean up the sessions: https://github.com/web2py/web2py/blob/master/scripts/sessions2trash.py - I've set my auth.settings.expiration to 9, does this affect to sessions too? As far as I know it only affects to when an inactive user is automatically logged out, is this correct? That won't affect the session. However, if you use the remember me option at login, then auth.settings.long_expiration will determine how long the session cookie remains valid (still won't have any effect on keeping/removing the session file itself, though). - Testing this I've seen that with no logged users in my server, if I manually remove the sessions files, some of them are created again!! Why and how? As I said I have no users logged in the server. A session file is created whenever a new visitor visits the site and anything is saved to the session (whether or not the user is logged in). Sessions are not used only for logged in users, but can be used for any visitor. If you navigate to a page with a form (e.g., the login or register pages), for example, the session will be used (to store the CSRF token) -- even if you don't actually submit the form. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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] login_onaccept redirect and _next in URL
hey everyone, under db.py i have: auth.settings.login_onaccept = check_login auth.settings.register_onaccept = check_login def check_login(form): redirect(URL(c=default, f=onlogin)) return and then under default, the onlogin function, checks the status of the subscription and displays the terms of use before allowing the user to go any deeper. there is one function that i want users to be logged in to use, so i decorate it with @auth.requires_login() and of course it brings the user to the login screen if then aren't. however, this one function does not require the status and terms of use stuff. after login, the function can just run. so, how can i know under the check_login function that either the _next was in the URL or something in the session or something to let me know that the link to this decorated function was pressed by the user so i can redirect properly? thanx in advance, lucas -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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: Inserting to db from module. Why do I need to keep restarting Web2py?
Richard, is this feature unreliable at this point or am i using it incorrectly? On Friday, January 3, 2014 12:54:12 PM UTC-8, Brando wrote: Version 2.8.2-stable+timestamp.2013.11.28.13.54.07 (Running on Rocket 1.2.6, Python 2.7.3) Also, I doubt it's relevant, but I'm using Sublime Text as my IDE. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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] Important New Year News: Edison Award
Congrats. :-D On Sat, Jan 4, 2014 at 2:08 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Web2py/me have been nominated for the Edison Award. Please wish web2py (and me) good luck. :-) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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: converted url %3F and %3D
The function you seek for is urllib.unquote but without a concrete example of how the wrong link is generated I am not sure about how to apply that function. On Saturday, 4 January 2014 10:35:14 UTC-6, BlueShadow wrote: External links to my side from a diffrent website i got no control over. Thats the problem Am 04.01.2014 13:21 schrieb Massimo Di Pierro massimo@gmail.comjavascript: : How are you generating those links? Can you show the code? On Saturday, 4 January 2014 05:57:10 UTC-6, BlueShadow wrote: Hi, for some reason some external links converted the ?id=10 in one of my urls to %3Fid%3D10 my question is how can I convert that request back to the existing url. Preferably for all sites if it should happen again. Do I have to do some nginx magic to do that or can it be done within web2py? thanks -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/dqxeN7fQS-Y/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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: login_onaccept redirect and _next in URL
ok, i answered my own question. under the check_login function, i was able to access the request.env.query_string to see the next, after login, URL and i was able to redirect appropriately. sweet. lucas -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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] Important New Year News: Edison Award
Well deserved.. good luck and have fun.. On Sat, Jan 4, 2014 at 3:19 PM, Vinicius Assef vinicius...@gmail.comwrote: Congrats. :-D On Sat, Jan 4, 2014 at 2:08 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Web2py/me have been nominated for the Edison Award. Please wish web2py (and me) good luck. :-) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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. -- Joe Simpson Sent From My DROID!! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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] Happy New Year everybody!
Happy New year Massimo and all the contributors who have made web2py so awesome! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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] Important New Year News: Edison Award
Good luck Massimo!!! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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: Important New Year News: Edison Award
Best of luck. Hope you (and web2py) bring back an award. On Friday, January 3, 2014 11:08:38 PM UTC-5, Massimo Di Pierro wrote: Web2py/me have been nominated for the Edison Award. Please wish web2py (and me) good luck. :-) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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: Important New Year News: Edison Award
Way to go !! Congrats ! 2014/1/5 Cliff Kachinske cjk...@gmail.com Best of luck. Hope you (and web2py) bring back an award. On Friday, January 3, 2014 11:08:38 PM UTC-5, Massimo Di Pierro wrote: Web2py/me have been nominated for the Edison Award. Please wish web2py (and me) good luck. :-) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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] Happy New Year everybody!
Happy new year! 2014/1/5 Calvin calvin@gmail.com Happy New year Massimo and all the contributors who have made web2py so awesome! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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.