Re: [web2py] How do I upload the .w2py file?

2018-04-03 Thread Marco Mansilla
Is it an app or a plugin?, What's the original file name?. Marco. El mié., 4 de abr. de 2018 01:28, Alejandra Montiel Saavedra < alemontiels...@gmail.com> escribió: > > Yes, I'm wrong with the name of the format, but how can I install it in > web2py, what happens is that they passed me a

Re: [web2py] How do I upload the .w2py file?

2018-04-03 Thread 黄祥
like marco said, it's just tar.gz file, think you can extract it in web2py/applications folder with the command (not tested) tar -xzvf web2py_file.w2p best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

Re: [web2py] How do I upload the .w2py file?

2018-04-03 Thread Alejandra Montiel Saavedra
Yes, I'm wrong with the name of the format, but how can I install it in web2py, what happens is that they passed me a file.w2p and I reinstalled it in web2py because it generated an error "unabled to install application" . 2018-04-03 22:38 GMT-05:00 Marco Mansilla : > The

Re: [web2py] How do I upload the .w2py file?

2018-04-03 Thread Marco Mansilla
The file name should be myFile.w2p not w2py. It is just a tar.gz file. Marco El mar., 3 de abr. de 2018 22:45, Alejandra Montiel Saavedra < alemontiels...@gmail.com> escribió: > > I have a file of .w2py format, I uploaded it in web2py and generated an > error "Unable to install application".

[web2py] Re: seperate the request.args() with the extension

2018-04-03 Thread 黄祥
pardon, my bad, i misunderstood the place of extension, the extension should be after the function name, not the args one, so the above is work well, when put it like: curl -X GET -i http://127.0.0.1:8000/test/api/rows_as_list .xml

[web2py] How do I upload the .w2py file?

2018-04-03 Thread Alejandra Montiel Saavedra
I have a file of .w2py format, I uploaded it in web2py and generated an error "Unable to install application". Could you help me upload it or can I open or view the folders inside the .w2py, please. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: seperate the request.args() with the extension

2018-04-03 Thread Dave S
On Tuesday, April 3, 2018 at 5:18:53 PM UTC-7, 黄祥 wrote: > > *controllers/api.py* > def rows_as_list(): > tablename = request.args(0) > #id = request.args(1) > id, ext = request.args(1).split('.') > if int(id) > 0 : > query = (db[tablename]['id'] == id) > else: > query = (db[tablename]['id'] >

[web2py] Re: seperate the request.args() with the extension

2018-04-03 Thread 黄祥
*controllers/api.py* def rows_as_list(): tablename = request.args(0) #id = request.args(1) id, ext = request.args(1).split('.') if int(id) > 0 : query = (db[tablename]['id'] == id) else: query = (db[tablename]['id'] > 0) #query = (db.table0.id > 0) rows = db(query).select().as_list() return

[web2py] Re: seperate the request.args() with the extension

2018-04-03 Thread Dave S
On Tuesday, April 3, 2018 at 4:35:11 PM UTC-7, 黄祥 wrote: > > is it possible to seperate the request.args() with the extension? > *e.g.* > *controllers/api.py* > def rows_as_list(): > tablename = request.args(0) > id = request.args(1) > if int(id) > 0 : > query = (db[tablename]['id'] == id) >

[web2py] Re: login, redirects, and multiple apps

2018-04-03 Thread Dave S
On Wednesday, March 28, 2018 at 9:35:22 AM UTC-7, Massimo Di Pierro wrote: > > This is all very strange since web2py uses different cookie names, session > id, and session folders for different apps. Therefore I do not see how > things can get mixed up. > The only thing I can think of is if

[web2py] seperate the request.args() with the extension

2018-04-03 Thread 黄祥
is it possible to seperate the request.args() with the extension? *e.g.* *controllers/api.py* def rows_as_list(): tablename = request.args(0) id = request.args(1) if int(id) > 0 : query = (db[tablename]['id'] == id) else: query = (db[tablename]['id'] > 0) #query = (db.table0.id > 0) rows =

[web2py] Re: direct upload in directory

2018-04-03 Thread Dave S
On Tuesday, April 3, 2018 at 4:45:43 AM UTC-7, Anthony wrote: > > On Tuesday, April 3, 2018 at 6:09:36 AM UTC-4, Dave S wrote: >> >> On Monday, April 2, 2018 at 12:50:38 PM UTC-7, Diego Tostes wrote: >>> >>> Hi, >>> >>> I already use this: >>> >>> stream = open("/teste_en.pdf", 'rb') >>>

[web2py] Re: Caching DAL Selects - only cache.ram works?

2018-04-03 Thread Brian M
Further investigation shows that cache.redis plays nicely with pyodbc *as long as you have all uniquely named fields in your select*. The selects that I was working with involved multiple tables that each had a "Name" field that was being selected. If I add .with_alias() to provide unique

Re: [web2py] Re: UnicodeDecodeError "'utf-8' codec can't decode..." when inserting a blob in database (python 3.6.3)

2018-04-03 Thread alexandre . henry
Thank you Mathieu, I found the place to create issue... Actually, I wanted to better qualify the issue before open it, restarting from a clean project, and I cannot reproduce the very first issue! I encounter some other issues related to binary encoding but now I prefer triple check before

Re: [web2py] Re: prevent multiple session at the same time

2018-04-03 Thread Anthony
On Tuesday, April 3, 2018 at 10:20:41 AM UTC-4, AlighaThor wrote: > > I would do not perform the database check in every request (and I think > Massimo did'nt mean that :)), only during the the second (or more) attempt > to log in with the same user. > > Let's say you have the X user logged in.

[web2py] Re: Error on migrate=True

2018-04-03 Thread Anthony
Probably you don't have *.table files indicating the current status of the database schema. First, without the new column in the code, run a request with fake_migrate_all=True, which will create an updated set of *.table files. Then add the new column, and the migration should work. Anthony

[web2py] Re: Caching DAL Selects - only cache.ram works?

2018-04-03 Thread Anthony
You can also see what happens if you do not set cacheable=True. On Tuesday, April 3, 2018 at 3:15:55 PM UTC-4, Anthony wrote: > > It should work. Could be a bug specific to using pyodbc. Have you tried it > with other databases/drivers? Feel free to file a PyDAL issue. > > Anthony > > On

[web2py] Re: Caching DAL Selects - only cache.ram works?

2018-04-03 Thread Anthony
It should work. Could be a bug specific to using pyodbc. Have you tried it with other databases/drivers? Feel free to file a PyDAL issue. Anthony On Tuesday, April 3, 2018 at 12:40:50 PM UTC-4, Brian M wrote: > > I've been playing with caching and looking through the mailing list and > have a

[web2py] Confused about web2py sessions handling in the filesystem, versus the db handling.

2018-04-03 Thread AlighaThor
Hi. I'm experimenting for the first time (but I'm quite a bit old using this amazing framework :)) storing sessions in the DB instead the filesystem, as I always did. I'm monitoring those two behaviours and somehow it feels (at least for me) that the DB session handling is far away more

[web2py] Caching DAL Selects - only cache.ram works?

2018-04-03 Thread Brian M
I've been playing with caching and looking through the mailing list and have a bit of confusion about whether or not you can actually cache DAL Selects with anything other than cache.ram due to issues with what can/cannot be pickled. When I use db(...).select(...,cache=(cache.disk, 300),

[web2py] Error on migrate=True

2018-04-03 Thread Stephan
I am getting an "tables already exist" error after adding column to an existing table in db.py and setting migrate from false to true. It's connected to a mysql. Application is running in version 2.8.2. Is there some cahce to be cleared? thx -- Resources: - http://web2py.com -

[web2py] Re: customizing SQLFORM to insert many rows from one form

2018-04-03 Thread Tribo Eila
you can try this http://www.mdelrosso.com/sheepit/index.php?lng=en_GB On Monday, April 2, 2018 at 5:37:09 PM UTC+3, Mashareq M wrote: > > Hi, > > I am creating a web app for attending employees. > > This is the model: > > db.define_table( > 'employee', > Field('name'), > format =

[web2py] Re: FYI: A tutorial on how to customize export in SQLFORM.grid

2018-04-03 Thread Alex Beskopilny
Hi! exporter example 0 pip install xlwt 1 at end of gluon/sqlhtml.py class ExporterXLS(ExportClass): label = 'XLS' file_ext = "xls" content_type = ".xls" # https://gist.github.com/brendano/22764 # https://groups.google.com/forum/#!topic/web2py/MR_8JzzP9o4 def

Re: [web2py] Re: prevent multiple session at the same time

2018-04-03 Thread AlighaThor
I would do not perform the database check in every request (and I think Massimo did'nt mean that :)), only during the the second (or more) attempt to log in with the same user. Let's say you have the X user logged in. You stored the uuid in the auth_user.uuid field as mentioned. Then in

Re: [web2py] Re: Sending emails from different email ids

2018-04-03 Thread yogeshwar khalkar
Thanks it solved my problem. On Apr 3, 2018 5:17 PM, "Anthony" wrote: > You can just dynamically set the values of the mail settings within each > request (the mail settings do not have to be retrieved from the appconfig > file). > > Anthony > > On Tuesday, April 3, 2018 at

[web2py] Re: Request with login privileges hangs for a specific user account, how to debug it?

2018-04-03 Thread Lisandro
I store the sessions in the database, so there is no problem with a locked file. I've just found something interesting that could help to figure out: when the problem presents, I checked the pg_stat_activity in postgres to see if there was a long running query, and there is indeed. But the

[web2py] Re: Sending emails from different email ids

2018-04-03 Thread Anthony
You can just dynamically set the values of the mail settings within each request (the mail settings do not have to be retrieved from the appconfig file). Anthony On Tuesday, April 3, 2018 at 4:01:26 AM UTC-4, yogeshwar khalkar wrote: > > Hi, > > I want to send email from different email IDs

[web2py] Re: direct upload in directory

2018-04-03 Thread Anthony
On Tuesday, April 3, 2018 at 6:09:36 AM UTC-4, Dave S wrote: > > On Monday, April 2, 2018 at 12:50:38 PM UTC-7, Diego Tostes wrote: >> >> Hi, >> >> I already use this: >> >> stream = open("/teste_en.pdf", 'rb') >> db.ensaios.insert(codigo_registro="novo ensaio", >>

[web2py] Re: Request with login privileges hangs for a specific user account, how to debug it?

2018-04-03 Thread Leonel Câmara
I would use redis for sessions instead of the default file based ones, it makes the site a lot quicker and it would probably solve your problem as I would bet this is happening due to a locked session file. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

Re: [web2py] Re: direct upload in directory

2018-04-03 Thread Diego Tostes
thanks. db(db.ensaios.codigo_registro == "novo ensaio").update(en_pdf=stream) works for me!! thanks again! 2018-04-03 7:09 GMT-03:00 Dave S : > On Monday, April 2, 2018 at 12:50:38 PM UTC-7, Diego Tostes wrote: >> >> Hi, >> >> I already use this: >> >> stream =

[web2py] Re: direct upload in directory

2018-04-03 Thread Dave S
On Monday, April 2, 2018 at 12:50:38 PM UTC-7, Diego Tostes wrote: > > Hi, > > I already use this: > > stream = open("/teste_en.pdf", 'rb') > db.ensaios.insert(codigo_registro="novo ensaio", > en_pdf=stream > ) > > You're using this to read the file

[web2py] Re: service function with header key

2018-04-03 Thread 黄祥
after several test and relearn from the book *controllers/api.py* def http_api_key(): api_key = request.env.http_api_key # change api_key with the parameter you want in curl request header if api_key == 'your_api_key': query = (db.table0.id > 0) rows = db(query).select() else: rows =

[web2py] Re: direct upload in directory

2018-04-03 Thread Dave S
On Monday, April 2, 2018 at 9:22:51 AM UTC-7, Diego Tostes wrote: > > Hi, > > > i have a table in my model called ensaios: > > Ensaios = db.define_table('ensaios', > Field('codigo_registro', 'string'), > Field('url', 'string'), > Field('titulo_pt', 'string'), > Field('titulo_en',

[web2py] Sending emails from different email ids

2018-04-03 Thread yogeshwar khalkar
Hi, I want to send email from different email IDs each time. I have configured 1 smtp email for sender in appconfig file & it's working fine, But i want to configure different email on user login. Please help me to solve the problem. -- Resources: - http://web2py.com -