Re: [web2py] Linking webform to specific users in database

2015-11-25 Thread aetagothno
Of course I would do something like that. It works now! Thank you so much for your help and explaining everything. On Tuesday, November 24, 2015 at 6:05:52 PM UTC-5, Anthony wrote: > > In the model, you changed the field name from "location" to "located" > (probably because "location" is a reser

Re: [web2py] Linking webform to specific users in database

2015-11-24 Thread Anthony
In the model, you changed the field name from "location" to "located" (probably because "location" is a reserved word) but forgot to change it in the compute function: sheet_ranges['C10'] = row.location should be: sheet_ranges['C10'] = row.located When a compute function throws an exc

Re: [web2py] Linking webform to specific users in database

2015-11-24 Thread Anthony
If you don't mind, please pack and attach your application (feel free to send privately if your prefer). Anthony On Tuesday, November 24, 2015 at 3:37:38 PM UTC-5, Aeta Gothno wrote: > > Using the default download function doesn't work either, it just gives me > a 404 Not Found. I don't underst

Re: [web2py] Linking webform to specific users in database

2015-11-24 Thread Aeta Gothno
Using the default download function doesn't work either, it just gives me a 404 Not Found. I don't understand why. It actually allows you to download and view the spreadsheets? On Tue, Nov 24, 2015 at 3:29 PM, Anthony wrote: > Get rid of your download function and just use the download function

Re: [web2py] Linking webform to specific users in database

2015-11-24 Thread Anthony
Get rid of your download function and just use the download function that comes in the welcome app -- it uses response.download which is designed to handle downloading from upload fields automatically. The URL arg, however, should be the file name stored in the upload field, not the record ID. (

Re: [web2py] Linking webform to specific users in database

2015-11-24 Thread Aeta Gothno
Here is the table output attached as screenshot On Tue, Nov 24, 2015 at 3:19 PM, Anthony wrote: > Works perfectly for me (the only difference is I don't have your template > so am creating a workbook from scratch). How are you "viewing the database" > and downloading the files? > > Anthony > > >

Re: [web2py] Linking webform to specific users in database

2015-11-24 Thread Aeta Gothno
I have added the following into my controller: def download(): file_id = request.args(0) import cStringIO import contenttype as c s=cStringIO.StringIO() (filename,file) = db.excelform.excel_file.retrieve(db.excelform[file_id].file) s.write(file.read()) response.headers

Re: [web2py] Linking webform to specific users in database

2015-11-24 Thread Anthony
Works perfectly for me (the only difference is I don't have your template so am creating a workbook from scratch). How are you "viewing the database" and downloading the files? Anthony On Tuesday, November 24, 2015 at 1:47:38 PM UTC-5, Aeta Gothno wrote: > > Thank you very much for explaining e

Re: [web2py] Linking webform to specific users in database

2015-11-24 Thread Aeta Gothno
Thank you very much for explaining everything to me. It makes a lot more sense doing it that way, however I will have to read up on StringIO since I have not used that before. I commented out my functions and replaced it with what you have suggested and there are no errors, however nothing shows u

Re: [web2py] Linking webform to specific users in database

2015-11-24 Thread Anthony
There is no need to store the data in the session and then redirect to another action to create the file. Instead, just do it all at once. Also, if you want to store the file (safely) and make it easily retrievable, then add an upload field to the database table and store it that way. Finally,

Re: [web2py] Linking webform to specific users in database

2015-11-24 Thread Anthony
No, nothing will be persisted if you use only the session (the session lasts only during a particular browser session and disappears when the browser session has ended -- such as when the user closes the browser). On Tuesday, November 24, 2015 at 12:20:34 PM UTC-5, aetagot...@gmail.com wrote: >

Re: [web2py] Linking webform to specific users in database

2015-11-24 Thread aetagothno
Also.. To add to my other post below..I was reading on the SQLFORM.factory and it seems like that may be a viable options as well for what I am trying to do. Here is the section I am referring to: *"SQLFORM.factory* *There are cases when you want to generate forms as if you had a database tabl

Re: [web2py] Linking webform to specific users in database

2015-11-24 Thread aetagothno
Model: db = DAL('sqlite://webform.sqlite') db.define_table('excelform', Field('last_name', 'string'), Field('first_name', 'string'), Field('age', 'string'), Field('location', 'string') ) That is one of my models, I have another that contains: auth.settings.extra_fields['auth_us

Re: [web2py] Linking webform to specific users in database

2015-11-24 Thread Richard Vézina
Sure all this can be done. What have you done so far? Can you show us some piece of code? Richard On Tue, Nov 24, 2015 at 11:15 AM, wrote: > Hello, > I am very new to web2py. I was hoping for some insight as to whether what > I am trying to do is possible, and maybe if I can be redirected as to

[web2py] Linking webform to specific users in database

2015-11-24 Thread aetagothno
Hello, I am very new to web2py. I was hoping for some insight as to whether what I am trying to do is possible, and maybe if I can be redirected as to what I should read up on to help me figure this out. Any advice or insight will help. I have web forms, which are linked to an excel file templ