[web2py] Re: delete and logout user

2015-11-24 Thread Alex Glaros
thanks guys, good insight as always -- 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

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

[web2py] Re: SQLFORM.grid with joined tables - choose which table to view/edit by default

2015-11-24 Thread Jim S
You can use the field_id parameter on the SQLFORM.grid call to specify the primary key field from the table that you want to be primary. http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-grid-and-SQLFORM-smartgrid -Jim On Tuesday, November 24, 2015 at 12:30:35 PM

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

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())

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

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

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.

[web2py] Re: SQLFORM.grid with joined tables - choose which table to view/edit by default

2015-11-24 Thread Thomas Sitter
Thanks that's exactly what I was looking for! On Tuesday, 24 November 2015 14:44:18 UTC-5, Jim S wrote: > > You can use the field_id parameter on the SQLFORM.grid call to specify the > primary key field from the table that you want to be primary. > > >

[web2py] Re: delete and logout user

2015-11-24 Thread Anthony
Presumably the logout and delete are happening in the same request, so just put the id in a variable. Hard to say exactly how you should handle it without seeing your code. On Tuesday, November 24, 2015 at 2:05:35 PM UTC-5, Alex Glaros wrote: > > Anthony, > > am using custom deletion workflow.

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

[web2py] Re: Scheduler timing out even though the task completes

2015-11-24 Thread Niphlod
you're the third one reporting those strange issues but for the life of me I can't seem to find a reference for this specific "weirdness" and/or a fix for it. Anyway I'm happy to have pinpointed the root cause On Tuesday, November 24, 2015 at 7:42:05 PM UTC+1, Benson Myrtil wrote: > > We are

[web2py] Re: database is locked

2015-11-24 Thread Niphlod
uhm. it stays locked no matter what ? sqlite locks the entire db when writing, so make sure your app is the only one accessing the db... On Tuesday, November 24, 2015 at 5:54:32 PM UTC+1, Pierre wrote: > > Hi everyone, > I tried to unlock with db.executesql('PRAGMA journal_mode=WAL')

[web2py] Re: how to custom the view sqlform.grid

2015-11-24 Thread Alessio Varalta
Hi, you can change your db file. For example set the attribute readable false if you want that this attribute don't appear in form On Wednesday, 25 November 2015 03:01:19 UTC+1, Laurent Lc wrote: > > > How do i do if i want to see some fields (and not all) when i click on show > thanks > --

[web2py] how to custom the view sqlform.grid

2015-11-24 Thread Laurent Lc
How do i do if i want to see some fields (and not all) when i click on show 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

[web2py] custom view sqlform.grid

2015-11-24 Thread Laurent Lc
hi i return a grid how can i do if i want to see some fields (and not all) when i select show for a record 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

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 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 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

[web2py] Re: delete and logout user

2015-11-24 Thread Leonel Câmara
Anthony shouldn't Auth.profile do that by default? -- 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

[web2py] Re: delete and logout user

2015-11-24 Thread Anthony
On Tuesday, November 24, 2015 at 12:28:13 PM UTC-5, Leonel Câmara wrote: > > Anthony shouldn't Auth.profile do that by default? > Yes. I assume he was using some custom user account deletion workflow. Alex, if you set auth.settings.allow_delete_accounts=True, you can let users delete their

[web2py] SQLFORM.grid with joined tables - choose which table to view/edit by default

2015-11-24 Thread Thomas Sitter
Hello, I have two tables that I'd like to join in a SQLFORM.grid. When viewing or editing an entry in the grid I'd like to edit the cheque table, but by default the customer table is selected. How can I change this? I've recreated the relevant code below. #db.py db.define_table('customer',

[web2py] Re: Scheduler timing out even though the task completes

2015-11-24 Thread Benson Myrtil
We are looking good. THANKS!!! Had a lot of stuff printing to the console. Removed those print statements and the task appears to be completing successfully now with no timeout issues so far. Thanks a lot!!! On Monday, November 23, 2015 at 4:40:35 PM UTC-5, Niphlod wrote: > > If you're really

Re: [web2py] Re: web2py / pydal returning id 1 in postgres

2015-11-24 Thread Mark Graves
I'm using postgres, migrating from latin-1 mysql. Its a referenced table, and yes I definitely am calling db.commit() I will post the entire code tonight. Also, I have ~11k legacy documents to upload to S3 which I wanted to make available via a uniform method. I was previously attempting to

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

[web2py] Re: upload using restful

2015-11-24 Thread Jose
Hi Leonel How it is handled on the server (web2py app)? -- 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

[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

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

[web2py] Re: upload using restful

2015-11-24 Thread Leonel Câmara
Here's an example using requests http://docs.python-requests.org/en/latest/user/quickstart/#post-a-multipart-encoded-file Is this what you want? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

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:

[web2py] Re: delete and logout user

2015-11-24 Thread Anthony
Sure, grab the ID first, then logout, then delete. On Tuesday, November 24, 2015 at 11:44:24 AM UTC-5, Alex Glaros wrote: > > If a user deletes their account, my controller deletes their db.auth_user > record but their login session is still active. If I try to auth.logout() > then, I get

[web2py] delete and logout user

2015-11-24 Thread Alex Glaros
If a user deletes their account, my controller deletes their db.auth_user record but their login session is still active. If I try to auth.logout() then, I get integrity restraint error. If I log them out first, I don't automatically have their user_id to delete the records with. Is there a

[web2py] database is locked

2015-11-24 Thread Pierre
Hi everyone, I tried to unlock with db.executesql('PRAGMA journal_mode=WAL') import sqlite3 >print sqlite3.sqlite_version >3.8.2 Ticket ID

[web2py] Re: delete and logout user

2015-11-24 Thread Alex Glaros
Anthony, am using custom deletion workflow. Where is best place to store the user_id so logout doesn't erase it? session? temp table? thanks Alex -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: upload using restful

2015-11-24 Thread Dave S
On Tuesday, November 24, 2015 at 8:33:20 AM UTC-8, Jose wrote: > > Hi Leonel > > How it is handled on the server (web2py app)? > Does this help explain it? I've used the SOAP service model successfully -- the

[web2py] Re: How to add an hour to datetime field

2015-11-24 Thread Anthony
It would be: import datetime datetime.timedelta Not: datetime.datetime.timedelta 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

[web2py] Re: Scheduler error: Exception in thread Thread-1 and connection is closed

2015-11-24 Thread Niphlod
please remove any print statement and why are you importing modules inside the function ? On Tuesday, November 24, 2015 at 1:15:15 PM UTC+1, kenny c wrote: > > Just tested with psycopg and same error. > = > ERROR:web2py.scheduler.postit#20382:Error retrieving status > Exception in

Re: [web2py] RBAC and group of role management

2015-11-24 Thread Richard Vézina
Thanks for reply Simone, I see the complexity and the limitless recursion that can occur... I guess, I will go with flat group of access which will overlap... My main issue was that I would avoid having two way to assign the same set of permissions... Let say I have tool A, so I create group A, so

Re: [web2py] Using web2py with werkzeug?

2015-11-24 Thread Richard Vézina
I guess not... I am not sure why werkzeug's would help... To me to you only need to configure your web server correctly (regular expression) in order that url starting by the name of your web2py app ( www.domain.org/web2pyapp/...) directed to web2py instead than Django... I don't know what is the

Re: [web2py] RBAC and group of role management

2015-11-24 Thread Niphlod
On Tuesday, November 24, 2015 at 3:59:28 PM UTC+1, Richard wrote: > > Thanks for reply Simone, I see the complexity and the limitless recursion > that can occur... I guess, I will go with flat group of access which will > overlap... My main issue was that I would avoid having two way to assign

[web2py] Re: Scheduler error: Exception in thread Thread-1 and connection is closed

2015-11-24 Thread kenny c
Just tested with psycopg and same error. = ERROR:web2py.scheduler.carat-diamond#20382:Error retrieving status Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner self.run() File

[web2py] upload using restful

2015-11-24 Thread Jose
Hi How I can upload a file using RESTful api? Jose -- 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

[web2py] Re: How to add an hour to datetime field

2015-11-24 Thread Annet
Hi Simone, Thank you for taking the time to add more detail to your first reply. I now understand why my code works but should not be used. Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: Embed pdf and file download

2015-11-24 Thread Leonel Câmara
I'm guessing the problem is that response.download sets Content-Disposition as an attachment. Make another controller function in default.py def stream(): import re from pydal.exceptions import NotAuthorizedException, NotFoundException if not request.args: raise HTTP(404)

[web2py] Re: upload using restful

2015-11-24 Thread Leonel Câmara
Sure it is. What's your question? -- 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