Re: [web2py] Multiple Uploads using jQuery-File-Upload: Javascript/CSS Conflict?
My code( based on your mentioned solution) looks like this- if form.accepts(request.vars): if hasattr(request.vars, 'txn_doc'): #if len(request.vars.txn_doc) 0: files = request.vars['txn_doc'] if not isinstance(files, list): files = [files] for f in files: print f.filename txn_doc = db.uploaded_docs.txn_doc.store(f, f.filename) db.uploaded_docs.insert( portfolio_company=request.vars.portfolio_company, txn_area=request.vars.txn_area, document_name=request.vars.doc_name, txn_doc=f.filename, document_date=request.vars.document_date) db.commit() print DEBUG: [%s] successfully uploaded % f.filename redirect(URL('upload', 'upload')) This is inserting +1 record to db. Not getting why it is so? Means if I upload 2 files it should insert 2 records in db; BUT it inserts 3 (and the extra without file) Please help me On Thursday, January 9, 2014 at 1:05:44 AM UTC+5:30, Brando wrote: This works, added the requires statement for form validation: def submit(): import datetime form = FORM(LABEL(File(s):), INPUT(_name='up_files', _type='file', _multiple='', requires=IS_NOT_EMPTY()), BR(),INPUT(_type='submit')) if form.accepts(request.vars, formname=form): files = request.vars['up_files'] if not isinstance(files, list): files = [files] for f in files: print f.filename up_file = db.uploads.up_file.store(f, f.filename) i = db.uploads.insert(notes=request.vars.notes, up_file=up_file, filename=f.filename, up_date= datetime.datetime.now()) db.commit() return form submitted #redirect(URL('data', 'index')) return dict(form=form) -- 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/d/optout.
Re: [web2py] Multiple Uploads using jQuery-File-Upload: Javascript/CSS Conflict?
IN other words I want to do form.process(...).accepted in the for loop for no. of files uploaded. On Thursday, July 2, 2015 at 12:26:09 PM UTC+5:30, Sujata Aghor wrote: My code( based on your mentioned solution) looks like this- if form.accepts(request.vars): if hasattr(request.vars, 'txn_doc'): #if len(request.vars.txn_doc) 0: files = request.vars['txn_doc'] if not isinstance(files, list): files = [files] for f in files: print f.filename txn_doc = db.uploaded_docs.txn_doc.store(f, f.filename) db.uploaded_docs.insert( portfolio_company=request.vars.portfolio_company, txn_area=request.vars.txn_area, document_name=request.vars.doc_name, txn_doc=f.filename, document_date=request.vars.document_date) db.commit() print DEBUG: [%s] successfully uploaded % f.filename redirect(URL('upload', 'upload')) This is inserting +1 record to db. Not getting why it is so? Means if I upload 2 files it should insert 2 records in db; BUT it inserts 3 (and the extra without file) Please help me On Thursday, January 9, 2014 at 1:05:44 AM UTC+5:30, Brando wrote: This works, added the requires statement for form validation: def submit(): import datetime form = FORM(LABEL(File(s):), INPUT(_name='up_files', _type='file', _multiple='', requires=IS_NOT_EMPTY()), BR(),INPUT(_type='submit')) if form.accepts(request.vars, formname=form): files = request.vars['up_files'] if not isinstance(files, list): files = [files] for f in files: print f.filename up_file = db.uploads.up_file.store(f, f.filename) i = db.uploads.insert(notes=request.vars.notes, up_file=up_file, filename=f.filename, up_date= datetime.datetime.now()) db.commit() return form submitted #redirect(URL('data', 'index')) return dict(form=form) -- 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/d/optout.
[web2py] Re: general concepts for creating user defined tables?
the wizard does that. you can copy the code of the wizard. On Wednesday, 1 July 2015 17:45:31 UTC-5, Alex Glaros wrote: What is best concept for creating user-defined tables? Intent is for user to create small, simple, permanent tables. E.g., User wants inventory table. User says I need 3 columns: ItemName, Location, and SerialNumber. User should be able to add, delete, and edit records (maybe search and even used in grid but not necessary). Thanks, Alex Glaros -- 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/d/optout.
Re: [web2py] Re: Semantic 2.0
I am big fan of Semantic and I prefer it to Bootstrap. On Wednesday, 1 July 2015 19:13:04 UTC-5, mcm wrote: ops forgot to paste the link! thanks leonel! 2015-07-02 2:05 GMT+02:00 Leonel Câmara leonelcam...@gmail.com: I'm guessing he's referring to this: http://www.semantic-ui.com/introduction/new.html -- 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/d/optout. -- 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/d/optout.
Re: [web2py] Re: Semantic 2.0
have a plan to use semantic for web2py scaffolding app? perhaps, something like private/appconfig.ini [layout] css = bootstrap3 ;css = bootstrap ;css = semantic 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/d/optout.
[web2py] invalid reset password
Hi, Four days ago, the reset password was working fine. Now, it gives 'invalid reset password' after clicking the link of reset password mail. I am on pythonanywhere, mysql , 2-11-2. The only change ( I did during the last two days) related to auth was the setting on the language of the recaptch2. the error is still there even after resetting the recaptch2 options. Pls, help. Ashraf -- 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/d/optout.
[web2py] Removing email uniqueness from registration form and using other custom field for unique id of users
Hello all ! I need to create a registration form where users can have same email ids, but different user id... say for example : There are four users A, B, C, and D. There is a common email account they share, say a...@gmail.com . Before I explain further, let me state that users wouldn't be able to register themselves via the application, but the admin of application would create unique user_id's for each users from database administration side. So let the users have unique user_id's as a123, b123, c123 and d123. Thus they can log in into the application by feeding in their unique user_id's and password, and when an email might be needed to send them, I would select their name or user_id and send a mail. Thus the mail arrive into an account ( a...@gmail.com ) commonly accessed by all of them. I guess the changes are to be made in registration form and log in form. If there's a way to achieve it, please share it with me. Thanks for your interest ! -- 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/d/optout.
[web2py] Re: Removing email uniqueness from registration form and using other custom field for unique id of users
On Thursday, July 2, 2015 at 7:50:50 AM UTC-4, 黄祥 wrote: perhaps you can use, username (username = True) and override the email settings (custom_auth_table.email.unique = False) Unique email addresses are enforced via a NOT_IS_IN_DB validator, not via the unique attribute. So, either define a custom auth_user table, or after defining the standard table, change the requires attribute of db.auth_user.email. 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/d/optout.
[web2py] Re: Removing email uniqueness from registration form and using other custom field for unique id of users
Do the users all trust each other? What happens when one wants to request a password reset? On Thursday, July 2, 2015 at 6:02:51 AM UTC-4, Ramashish Gaurav wrote: Hello all ! I need to create a registration form where users can have same email ids, but different user id... say for example : There are four users A, B, C, and D. There is a common email account they share, say a...@gmail.com . Before I explain further, let me state that users wouldn't be able to register themselves via the application, but the admin of application would create unique user_id's for each users from database administration side. So let the users have unique user_id's as a123, b123, c123 and d123. Thus they can log in into the application by feeding in their unique user_id's and password, and when an email might be needed to send them, I would select their name or user_id and send a mail. Thus the mail arrive into an account ( a...@gmail.com ) commonly accessed by all of them. I guess the changes are to be made in registration form and log in form. If there's a way to achieve it, please share it with me. Thanks for your interest ! -- 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/d/optout.
[web2py] Re: Using datatables and web2py
I have not such error in your jsfiddle. What about to give console.log(column) after if (column) { Dne čtvrtek 2. července 2015 3:46:23 UTC+2 Chris Guest napsal(a): I have a very wide html table. I want to selectively hide groups of columns at a time using a list of a. Someone suggested using Datatables.net. So I have developed a proof of concept and all looks well. http://jsfiddle.net/ChrisGuest/orgj7oL9/ Now when I drop this code into a web2py as below, I end up with wrong behaviour and seeing this error in the JS Console: a.toggle-vis click event 0: : false 1: : false a.toggle-vis click event 0: : false 1: : false a.toggle-vis click event 0: : false 1: : false a.toggle-vis click event *Uncaught TypeError: Cannot read property 'style' of undefined* I suspected that this could be caused by a conflict between DataTables.js and another JavaScript module so I went through commented them all out except for jquery.js . Unfortunately the problems still persists. I have documented how I use DataTables.js with web2py. I am wondering if I've missed something important here. I'd be curious if anyone else could get this to go. Thanks, Chris I have modified layout.html to include: link rel=stylesheet href= https://cdn.datatables.net/1.10.7/css/jquery.dataTables.css; / script src='https://cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js' /script view/batch/demo.html ( see http://jsfiddle.net/ChrisGuest/orgj7oL9/ for complete table code). {{extend 'layout.html'}} h1Results/h1 ul.../ul table id=batch_table ... /table script $(document).ready(function() { var table = $('#batch_table').DataTable( { scrollY: 200px, paging: false } ); $('a.toggle-vis').on('click', function (e) { e.preventDefault(); console.log('a.toggle-vis click event'); // Get the column API object var data_columns = $(this).attr('data-column'); if (data_columns.length) { var data_columns = data_columns.split(','); for (var i=0; idata_columns.length; i++) { var column = table.column(data_columns[i]); if (column) { if (column.style===undefined) column.style = ''; column.visible( ! column.visible() ); console.log( i + ': ' + column.style + ': ' + column.visible() ); } } } }); }); /script -- 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/d/optout.
[web2py] Re: Removing email uniqueness from registration form and using other custom field for unique id of users
Thanks for your interest Anthony ! Actually I am building a tool for an intra-net application to be used by utmost 50 users. So I can expect that the users are all known to each other and trust each other. For password reset option, no doubt a mail would be sent for it. However the admin of this application might want to remove this feature via app and in that case the user will have to contact the admin for it. I'll implement your suggestions and let you know my progress... Thanks again!. On Thursday, July 2, 2015 at 5:31:01 PM UTC+5:30, Anthony wrote: Do the users all trust each other? What happens when one wants to request a password reset? On Thursday, July 2, 2015 at 6:02:51 AM UTC-4, Ramashish Gaurav wrote: Hello all ! I need to create a registration form where users can have same email ids, but different user id... say for example : There are four users A, B, C, and D. There is a common email account they share, say ab...@gmail.com javascript: . Before I explain further, let me state that users wouldn't be able to register themselves via the application, but the admin of application would create unique user_id's for each users from database administration side. So let the users have unique user_id's as a123, b123, c123 and d123. Thus they can log in into the application by feeding in their unique user_id's and password, and when an email might be needed to send them, I would select their name or user_id and send a mail. Thus the mail arrive into an account ( ab...@gmail.com javascript: ) commonly accessed by all of them. I guess the changes are to be made in registration form and log in form. If there's a way to achieve it, please share it with me. Thanks for your interest ! -- 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/d/optout.
[web2py] Re: Removing email uniqueness from registration form and using other custom field for unique id of users
perhaps you can use, username (username = True) and override the email settings (custom_auth_table.email.unique = False) ref: http://web2py.com/books/default/chapter/29/09/access-control#Customizing-Auth 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/d/optout.
[web2py] Re: Removing email uniqueness from registration form and using other custom field for unique id of users
By the way... what changes need to be made in log in for, so that user can feed his unique user_id and password? On Thursday, July 2, 2015 at 7:28:34 PM UTC+5:30, Ramashish Gaurav wrote: Thanks for your interest Anthony ! Actually I am building a tool for an intra-net application to be used by utmost 50 users. So I can expect that the users are all known to each other and trust each other. For password reset option, no doubt a mail would be sent for it. However the admin of this application might want to remove this feature via app and in that case the user will have to contact the admin for it. I'll implement your suggestions and let you know my progress... Thanks again!. On Thursday, July 2, 2015 at 5:31:01 PM UTC+5:30, Anthony wrote: Do the users all trust each other? What happens when one wants to request a password reset? On Thursday, July 2, 2015 at 6:02:51 AM UTC-4, Ramashish Gaurav wrote: Hello all ! I need to create a registration form where users can have same email ids, but different user id... say for example : There are four users A, B, C, and D. There is a common email account they share, say ab...@gmail.com . Before I explain further, let me state that users wouldn't be able to register themselves via the application, but the admin of application would create unique user_id's for each users from database administration side. So let the users have unique user_id's as a123, b123, c123 and d123. Thus they can log in into the application by feeding in their unique user_id's and password, and when an email might be needed to send them, I would select their name or user_id and send a mail. Thus the mail arrive into an account ( ab...@gmail.com ) commonly accessed by all of them. I guess the changes are to be made in registration form and log in form. If there's a way to achieve it, please share it with me. Thanks for your interest ! -- 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/d/optout.
[web2py] Dynamic drop down menu
Hello all. I've to set a dynamic drop down menu with 5 different fields. I would like to check which is today the best web2py way to do it. This plugin seems interesting: http://dev.s-cubism.com/plugin_lazy_options_widget Is there also an Ajax solution? Thanks, 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/d/optout.
[web2py] Re: Removing email uniqueness from registration form and using other custom field for unique id of users
Hi Ramashish Your best option (by far!) is to consider this... Gmail treats all these email addresses as equivalent for delivering emails: - a...@gmail.com - abc+us...@gmail.com - abc+us...@gmail.com - abc+anythingyouw...@gmail.com The suffix must follow the '+' sign. Use this facility for allowing each user to have his/her own log in. Regards, D On Thursday, 2 July 2015 11:02:51 UTC+1, Ramashish Gaurav wrote: Hello all ! I need to create a registration form where users can have same email ids, but different user id... say for example : There are four users A, B, C, and D. There is a common email account they share, say ab...@gmail.com javascript: . Before I explain further, let me state that users wouldn't be able to register themselves via the application, but the admin of application would create unique user_id's for each users from database administration side. So let the users have unique user_id's as a123, b123, c123 and d123. Thus they can log in into the application by feeding in their unique user_id's and password, and when an email might be needed to send them, I would select their name or user_id and send a mail. Thus the mail arrive into an account ( ab...@gmail.com javascript: ) commonly accessed by all of them. I guess the changes are to be made in registration form and log in form. If there's a way to achieve it, please share it with me. Thanks for your interest ! -- 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/d/optout.
[web2py] Re: expire user password
I would recommend against this. Passwords expiring is seriously annoying and the security benefits are questionable http://cs.unc.edu/~fabian/papers/PasswordExpire.pdf to say the least. Just demand better passwords and lock users after a few tries if you need more security. -- 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/d/optout.
[web2py] Re: Google Application Engine return Hello world
Thank you i will try on routes.py On Wednesday, July 1, 2015 at 8:51:42 PM UTC+9, Ramkrishan Bhatt wrote: Correction , I was using old Google Cloud sdk 1.9.21 thats was having bug refer this http://stackoverflow.com/questions/28879485/unable-to-start-appengine-application-after-updating-it-via-google-cloud-sdk Now its working fine with me i deployed http://peaceful-app-98605.appspot.com/ you can go through it. Please check gaehandler.py in root folder and routs.py with app.yaml file. On Wednesday, 1 July 2015 17:00:13 UTC+5:30, Ramkrishan Bhatt wrote: Yes even i experienced same with latest google cloud sdk and web2py one day before some docker problem was there, but it got resolve now , i guess there some change in configuration. Please correct me for same. Also need to update the web2py document as GAE modified the UI and services. On Wednesday, 1 July 2015 12:07:20 UTC+5:30, kawate wrote: Yes I did and test is done on local host On Wednesday, July 1, 2015 at 2:29:50 AM UTC+9, Sébastien wrote: Did you copy gaehandler.py in the root folder? I would first debug the app in the local Google SDK before deploying it. On Tuesday, 30 June 2015 14:29:56 UTC+2, kawate wrote: To reproduce this problem, download the source version of web2py on Mac, update application id on the app.example.yaml (change the file name to app.yaml)and deploy thru web2py admin or google application launcher. Request applicaion id.appspot.com will return Hello world!. On Monday, June 29, 2015 at 4:08:19 PM UTC+9, kawate wrote: Deploying test application ends well but only returns 'Hello world!' from server(local host and google). I expect well known welcome page. I tried deployment both thru web2py.py and gae launcher, results are same. I did not change any but on app.yaml application ID as attached. Thank you in advance. -- 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/d/optout.
Re: [web2py] Bunch/Batch/Bulk insert Re-use db.define_table field definition in SQLFORM.factory() ?
I am also searching for - How to insert multiple rows on single form submit in web2pyAnyone please please help me. Any clue will help!!! Thanks in advance!!! On Saturday, March 16, 2013 at 10:25:17 AM UTC+5:30, Richard wrote: I didn't find noting, but didn't search that much... Ask a couple of time. There is many problems to resolve, and I there is no single way to solve them. I develop something that may works for me, but may be not exactly what you are searching for. Anyway... As soon as I get something correct I show it here... Richard On Fri, Mar 15, 2013 at 11:24 PM, 黄祥 steve.van...@gmail.com javascript: wrote: that's good, thanks for sharing. that's what i'm looking for, because if i'm not wrong, there is no web2py appliances that show how to add multiple data simultaneously within 1 form. On Saturday, March 16, 2013 8:58:36 AM UTC+7, Richard wrote: Yop! I am almost finish, I will publish the code I come up with when it good enough... :) Richard On Fri, Mar 15, 2013 at 8:24 PM, 黄祥 steve.van...@gmail.com wrote: nice solution, with this can solve the problem to add the multiple data simultanously within one form. On Friday, March 15, 2013 2:07:11 AM UTC+7, Anthony wrote: How about: for i in range(0,10): inputs.append(db.table1.field1.clone(name='%s_%s' % (db.table1. field1.name, i))) The .clone() method copies the field, but you can pass in arguments to replace some of the existing attributes (such as the name). I don't think this is documented, though. Anthony On Thursday, March 14, 2013 8:42:21 AM UTC-4, Richard wrote: Hello Anthony, I know that, I just forget to take it in consideration in my example I guess... What I want to do is to create a batch insert form for a table a kind of inline edition but for insert data into database... So I would have many rows in a html table that will contains the fields a given table and only one submit button. I can build my form like this : inputs = [] for i in range(0,10): inputs.append(Field('field1'+'_%s' %str(i), 'type...', ...)) inputs.append(Field('field2'+'_%s' %str(i), 'type...', ...)) form = SQLFORM.factory(*inputs) That way I get unique distinct inputs fields. Then with custom form I can esealy build html table in view... But what I would like to avoid is to have 2 instances for field definition : one in model and one in the batch insert function because it seems to me that I can't get the field definition propertieds from model... I would like to know if I could get field properties from model something like that : inputs = [] for i in range(0,10): inputs.append(Field(db.table1.field1.name+'_%s' %str(i), db.table1.field1.type, ...) ... Thanks Richard On Wed, Mar 13, 2013 at 6:28 PM, Anthony abas...@gmail.com wrote: SQLFORM.factory creates a dummy DAL Table object with the fields submitted, so you cannot use duplicate field names, as they are illegal in DAL tables. Note, technically your form can have input elements with the same name, but once the values are submitted to the server, the values will be joined together in a single list. For example, if you have three fields with the name field1, request.vars.post_vars will be a list like [value1, value2, value3]. What are you really trying to do? Anthony On Wednesday, March 13, 2013 3:31:19 PM UTC-4, Richard wrote: Hello, I would like to build a bunch insert form and I wouldn't have to duplicate fields definition for SQLFORM.factory I try naively inputs = [] for i in range(0,10): inputs.append(db.table1.field1) inputs.append(db.table1.field2) form = SQLFORM.factory(*inputs) But even if I get 10 inputs of each in inputs they all refer to the same instance so when I render the form with SQLFORM.factory, I only get my 2 fields, but I would have 10 of each... Is there a way to avoid doing this : inputs = [] for i in range(0,10): inputs.append(Field('field1', 'type...', ...)) inputs.append(Field('field2', 'type...', ...)) form = SQLFORM.factory(*inputs) Because doing the last example would make my code much more less DRY. 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+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+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
[web2py] Re: invalid reset password
Hi Annet, you are right. what i did 4 days ago, was changing the password, not 'reset password'. Regards, Ashraf On Thursday, July 2, 2015 at 7:31:37 PM UTC+3, Annet wrote: Hi Ashraf, This issue has also been reported on June 10th and on Mai 24th as well, as far as I know it has not yet been solved. Kind regards, Annet -- 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/d/optout.
[web2py] Re: Help with MSSQL Connection
Wow, that's great. I tried that a while ago and I had issues. I created issues for the developer but I wasn't aware he had fixed them. https://github.com/denisenkom/pytds/issues/33 I had to use some hacks to get mine to work with TDS, but once I did that, I can use it in pypy, with full speedups. On Wednesday, July 1, 2015 at 2:49:46 AM UTC-7, Massimiliano wrote: Maybe could be useful to someone.. . I found that for my needs, I can got with python-tds, that is pure python. Thank you On Tuesday, June 30, 2015 at 2:49:40 PM UTC+2, Massimiliano wrote: Hello, I've a problem with odbc. I'm developing on OSX 10.10.3 and I found some problems connecting to sql server express 2005 I'm tried few things 1. I installed pyodbc and web2py said: Version 2.10.4-stable+timestamp.2015.04.26.15.11.54 Database drivers available: psycopg2, pymysql, imaplib, sqlite3, pg8000, pyodbc but from ipython: import pyodbc gave me an error. tracing web2py, it failed importing pyodbc... It's normal that web2py includes pyodbc in drivers available if it fail to import pyodbc? 2. I installed from brew unixodbc but now, when I try to connect to mssql with the following connection strings: db = DAL(mssql://sa:...@192.168.0.19 javascript:\SQLEXPRESS/TESTDB) or db = DAL(mssql3://sa:...@192.168.0.19 javascript:\SQLEXPRESS/TESTDB) I got this error: RuntimeError: Failure to connect, tried 5 times: Traceback (most recent call last): File pydal/base.py, line 435, in __init__ self._adapter = ADAPTERS[self._dbname](**kwargs) File pydal/adapters/base.py, line 53, in __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File pydal/adapters/mssql.py, line 155, in __init__ if do_connect: self.reconnect() File pydal/connection.py, line 105, in reconnect self.connection = f() File pydal/adapters/mssql.py, line 153, in connector return self.driver.connect(cnxn, **driver_args) Error: ('01000', [01000] [unixODBC][Driver Manager]Can't open lib 'SQL Server' : file not found (0) (SQLDriverConnect)) Could someone help me? The application with be deployed on debian 7, do you think there are problems also there? Thank you -- Massimiliano -- 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/d/optout.
[web2py] Starter App (Scaffolding) selction on create app.
There has been some discussion about different types of frameworks. I too have options I want to have and perhaps even the ability to take a web2py.app and have it as an available template. Is there any plan on having an option when we create an app with web2py? BR, Jason -- 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/d/optout.
[web2py] Re: invalid reset password
Hi Ashraf, This issue has also been reported on June 10th and on Mai 24th as well, as far as I know it has not yet been solved. Kind regards, Annet -- 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/d/optout.
[web2py] Re: Starter App (Scaffolding) selction on create app.
before having the option of having the option to choose for it'd be - at least required - to have something to choose from :-P On Thursday, July 2, 2015 at 6:04:40 PM UTC+2, Encompass solutions wrote: There has been some discussion about different types of frameworks. I too have options I want to have and perhaps even the ability to take a web2py.app and have it as an available template. Is there any plan on having an option when we create an app with web2py? BR, Jason -- 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/d/optout.
[web2py] Re: run time error - auth_user.table appears corrupted
stop web2py, drop the databases/*_auth_user.table file, set fake_migrate_all=True on the DAL connection, start web2py, hit the appadmin page (which should trigger recreation of all *.table files), remove fake_migrate_all statement from the DAL connection. On Wednesday, July 1, 2015 at 4:01:20 PM UTC+2, reddyreddy wrote: Can anyone help me? Iam getting runtime error auth_user.table appears corrupted. Iam not sure why it is appearing. Here are my not tables. db = DAL(sqlite://storage.sqlite) from gluon.tools import Auth auth = Auth(db) auth.define_tables(username=True) db.define_table('problem', Field('title', unique=True), Field('body', 'text'), Field('file','upload'), Field('ori_file',readable=False, writable=False), Field('outputfile','upload'), Field('created_on', 'date', default=request.now, readable=False, writable=False), Field('Due date','date'), Field('status', readable=False, writable=False)) db.define_table('submission', Field('name', requires=[IS_NOT_EMPTY(), IS_ALPHANUMERIC()]), Field('email', requires=[IS_NOT_EMPTY(), IS_EMAIL()]), Field('file','upload', requires=IS_NOT_EMPTY()), Field('status', readable=False,writable=False), Field('posted_on', 'date', default=request.now, readable=False, writable=False), Field('problem_id','reference problem',readable=False, writable=False)) -- 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/d/optout.
[web2py] Re: as_dict() on a row fails when connected to MySQL on Amazon RDS
I'm pretty sure that newly_inserted_id = db.table.insert(...) should return an integer, not a row. On Wednesday, July 1, 2015 at 4:01:19 PM UTC+2, Sean Ballow wrote: We are connecting successfully to MySQL on RDS And when attempting to insert a new record it appears to properly insert into the database and we receive an ID back, for instance result = db.foo.insert(myfield='blah') print result 1 The problem occurs when performing the following after successfully inserting a record and committing it result.as_dict() TypeError: 'NoneType' object is not callable result is a ROW instance and the following continues to work print result.id 1 however as_dict() fails only when connected to MySQL on RDS and not when using the MySQL local instance Oddly enough when I use the same application connected to a locally running instance of MySQL we do not receive the exception and everything works as desired. Any ideas what may be causing the disparity between a connection to a local MySQL instance and a MySQL RDS instance? I have compared system variables between both databases and was unable to identify a problem Thanks for your help -- 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/d/optout.
[web2py] Re: invalid reset password
As a temporary solution, The admin (manager) sets the password to specific one, then the user (who forgot the password) uses it to log in and change 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/d/optout.