[web2py] Re: Setting filename to a streamed file

2018-09-17 Thread Simona Chovancová
ursday, 6 September 2018 13:16:32 UTC+1, Simona Chovancová wrote: >> >> Hello. >> I have a backend function that is supposed to stream a pdf file, but not >> instantly download it. It's being called like this >> .../function_to_create_pdf/323, where the number is som

[web2py] Setting filename to a streamed file

2018-09-06 Thread Simona Chovancová
Hello. I have a backend function that is supposed to stream a pdf file, but not instantly download it. It's being called like this .../function_to_create_pdf/323, where the number is some ID. I create a FPDF stream and make function return this response.headers['Content-Type'] = None return

[web2py] Scheduler not creating its tables

2018-07-03 Thread Simona Chovancová
Hello, I am trying to use scheduler for the first time in my app and I cannot get it to work. Tables for scheduler are never really created. This is my model scheduler.py: from gluon.scheduler import Scheduler from gluon import current scheduler = Scheduler( storage.mailer_db,

[web2py] Select returns non existent fields

2018-03-14 Thread Simona Chovancová
Hello, I have a problem with select.. I have these tables defined: db.define_table( 'email', Field('recipient', 'string', notnull=True), Field('subject', 'string', length=256, notnull=False), Field('body', 'text', notnull=False),

[web2py] Re: Web2py scheduler

2018-02-06 Thread Simona Chovancová
solved, ran worker in different application than the task was sent from On Tuesday, February 6, 2018 at 2:34:24 PM UTC+1, Simona Chovancová wrote: > > Hello, > > I'm having trouble using the scheduler. I have managed to set it up to > queue tasks and successfully complete

[web2py] Web2py scheduler

2018-02-06 Thread Simona Chovancová
Hello, I'm having trouble using the scheduler. I have managed to set it up to queue tasks and successfully complete them. Although, that only works if I do not use database. If I include db in function that is tasked, I get this: Traceback (most recent call last): File

[web2py] Re: Dynamically changing requirement of field in form

2017-11-22 Thread Simona Chovancová
figured out no longer needed On Wednesday, November 22, 2017 at 12:49:23 PM UTC+1, Simona Chovancová wrote: > > Hello. > > I have a form in web2py that controls editing and adding new user. But > some fields need different requirements based on when user is being added >

[web2py] Dynamically changing requirement of field in form

2017-11-22 Thread Simona Chovancová
Hello. I have a form in web2py that controls editing and adding new user. But some fields need different requirements based on when user is being added or edited. Can I somehow change field requirements in view? I can only detect this in view. So far I came up with something like this, but it

[web2py] Select defined with variable

2017-09-19 Thread Simona Chovancová
I need to make a select like this: *db(db.table.id == 1).select(db.table.name, db.table.date).first()* but what attributes need to be selected always change so I'd need something like this: *selects = (db.table.name, db.table.date, ..)* *db(db.table.id == 1).select(selects).first()* But this

[web2py] Re: Optimization of js and css error

2017-09-11 Thread Simona Chovancová
Update: My mistake, I had bad routes, solved On Monday, September 11, 2017 at 9:18:56 AM UTC+2, Simona Chovancová wrote: > > I am trying to use *response.optimize_js = 'concat,minify,inline' *and > *response.optimize_css > = 'concat,minify,inline' *in 10_db.py in order to opti

[web2py] Optimization of js and css error

2017-09-11 Thread Simona Chovancová
I am trying to use *response.optimize_js = 'concat,minify,inline' *and *response.optimize_css = 'concat,minify,inline' *in 10_db.py in order to optimize my code, but it gives me this error: Traceback (most recent call last): File "/srv/www/web2py/gluon/restricted.py", line 227, in restricted

[web2py] Re: Changing password error message

2017-09-08 Thread Simona Chovancová
nvalid_password). > > Anthony > > On Wednesday, September 6, 2017 at 6:08:00 AM UTC-4, Simona Chovancová > wrote: >> >> I have a table defined like this: >> >> form_change_password = auth.change_password() >> form_change_password.element

[web2py] Changing password error message

2017-09-06 Thread Simona Chovancová
I have a table defined like this: form_change_password = auth.change_password() form_change_password.element( 'input', _name='old_password')['_id'] = 'form-4' form_change_password.element( 'input', _name='new_password')['_id'] = 'form-5' form_change_password.element(

[web2py] Re: Login 'remember me' not working

2017-08-25 Thread Simona Chovancová
in -- you must log in again > to be re-authenticated. > > Anthony > > On Friday, August 25, 2017 at 2:00:55 AM UTC-4, Simona Chovancová wrote: >> >> Apparently some other code I had in controller was breaking functionality >> of this, now I reached the point when it a

[web2py] Re: Login 'remember me' not working

2017-08-25 Thread Simona Chovancová
Apparently some other code I had in controller was breaking functionality of this, now I reached the point when it actually displays the remember button, although upon successful login and log out it doesn't actually remember my info and nothing gets filled into the login form. On Thursday,

[web2py] Login 'remember me' not working

2017-08-24 Thread Simona Chovancová
Hello, I'm trying to add remember_me option to my auth login form and so far it looks like this: controller.py def index(): auth.settings.remember_me_form=True auth.settings.long_expiration = 3600*24*30 form = auth() return dict(form=form) view.html {{=form.custom.begin}}

[web2py] Change value of select

2017-08-11 Thread Simona Chovancová
I need to change selected option in the view, I know that to change input value I do it like this: {{form.element('input', _name='field')['_value'] = "new_value"}}, but how do I do this with select? Also, this needs to be done in view, not controller so I cannot use default='some_option'. Any

[web2py] Re: Require field length 9 or 13

2017-08-09 Thread Simona Chovancová
Thank you! On Wednesday, August 9, 2017 at 1:08:12 PM UTC+2, Leonel Câmara wrote: > > requires=ANY_OF([IS_LENGTH(minsize=9, maxsize=9), IS_LENGTH(minsize=13, > maxsize=13, error_message='Must be 9 or 13 characters')]) > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation)

[web2py] Require field length 9 or 13

2017-08-09 Thread Simona Chovancová
I need to set my tel_num field requirement to be of length 9 or 13, yet I only found a way how to do this from 9 to 13 or specifically just one of these.. How can I set it to 9 or 13? Thanks! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: Calling a controller function from the view

2017-08-03 Thread Simona Chovancová
entire page into the f2 div and inserted no dict... Where did I go wrong? On Thursday, August 3, 2017 at 11:01:00 AM UTC+2, Simona Chovancová wrote: > > Hello! > > I need to call controller function from a jquery script in view and store > the returned dict into some variable. Looks

[web2py] Calling a controller function from the view

2017-08-03 Thread Simona Chovancová
Hello! I need to call controller function from a jquery script in view and store the returned dict into some variable. Looks something like this: controller.py def my_function(): return dict() my_view.html jQuery(document).ready(function(){ var my_dict = ... }); Any help

[web2py] Re: Streaming a file

2017-07-27 Thread Simona Chovancová
Thank you so much! On Thursday, July 27, 2017 at 3:03:17 PM UTC+2, Leonel Câmara wrote: > > You need to set content-type to pdf. > > response.headers['Content-Type'] = 'application/pdf' > > before returning response.stream > > -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Streaming a file

2017-07-27 Thread Simona Chovancová
I need to place a button which opens an online PDF and so far I have this in reg.py controller def streamable(): data = urllib2.urlopen("http://www.pdf995.com/samples/pdf.pdf;) return response.stream(data, 4096) And this in the view {{=A('open file', _class="btn btn-sm",

[web2py] Error message customization

2017-06-23 Thread Simona Chovancová
So I have a form with field which looks like this. I want the error message to display in red though, how do I do it? Thanks. edit_user_form= SQLFORM.factory ( Field('name', 'string', requires=IS_NOT_EMPTY(error_message='Enter your name')) ) -- Resources: - http://web2py.com -