[web2py] web2py + uwsgi + nginx on centos problem with python

2023-02-13 Thread Yebach
Hello everyone, The problem is the following on centos 7 the default version of python is 2.7.5 therefore I had to install 2.7.15 (application is old and works with that version of python so we take that as the default).. I set up an virtual env with python 2.7.15. and the app runs when run

[web2py] Lightbox and picture download in sqlform.grid edit view

2020-11-27 Thread Yebach
Hello All, In my edit view of SQLform.grid there is a picture (or max 3). I want to prevent picture download and also when user clicks on image the image goes into full screen mode. Now (default behaviour) the image downloads when user clicks on it. Any suggestions on how to make it work.

[web2py] lock table record

2020-11-25 Thread Yebach
Hello, how can I lock a record in a table (SQLform.grid) when somebody is editing one record so that other users cannot see it or it is grayed out or smth. Is there already an web2py ways or do I have to create a new filed set it as temp lock etc... thank you best regards. -- Resources:

[web2py] SQLform.grid request not sending bool valuis

2020-11-24 Thread Yebach
Hello I have a SQLform.grid and when validating fields i have some issues so to come around i have if request.args and request.args[0] in ['edit', 'new']: if form.update_form: if form.update_form.accepts(request.vars): print request.vars

[web2py] No module named _compat

2020-11-13 Thread Yebach
Hello I had some problems creatign new app so i used the wizard i am getting an error Traceback (most recent call last): File "C:\workspaces\Python\iRazpored\gluon\restricted.py", line 217, in restricted exec ccode in environment File

[web2py] IS_IN_SET or write in

2019-08-06 Thread Yebach
Hello Is it possible to create a validator for form field that is a combination of IS_IN_SET and a user write in? The field is of type string. db.nalogi.n_company.requires = IS_IN_SET(['Canon', 'HP', 'Xerox', 'Lexmark', 'Brother', 'Konica/Minolta', 'Kyocera', 'Other'], zero=('Select')) Thank

[web2py] web2py belongs if none

2019-05-30 Thread Yebach
Hello I have a query where the possibility for belongs can be a set of values or it can be empty. In case the set is empty I want the query to act as 1=1 and not 1=0, so all values would be selected. Any suggestions?? Thank you This is my query selected =

[web2py] Re: RuntimeError: cannot load dispatch table from pyexpat

2018-11-29 Thread Yebach
Same thing when using the 64bit version etc. Any ideas? this is really a real pain in the . thank you On Wednesday, November 28, 2018 at 2:26:07 PM UTC+1, Yebach wrote: > > I am getting the following error after I reinstalled my machine. I am using > Python 27 (32-bit) > &

[web2py] RuntimeError: cannot load dispatch table from pyexpat

2018-11-28 Thread Yebach
I am getting the following error after I reinstalled my machine. I am using Python 27 (32-bit) Traceback (most recent call last): File "C:\workspaces\Python\iRazpored\gluon\restricted.py", line 217, in restricted exec ccode in environment File

[web2py] Re: database field is added and deleted immediately afterwards

2018-09-03 Thread Yebach
ifference column? > > On Monday, September 3, 2018 at 7:13:26 AM UTC-4, Yebach wrote: >> >> Hello >> >> When I add a field to my db.py I get an error saying field does not exist. >> If I check the sql log file there is >> >> timestamp: 2018-09-03T12:08

[web2py] database field is added and deleted immediately afterwards

2018-09-03 Thread Yebach
Hello When I add a field to my db.py I get an error saying field does not exist. If I check the sql log file there is timestamp: 2018-09-03T12:08:38.256000 ALTER TABLE counters ADD c_total_difference INTEGER; success! timestamp: 2018-09-03T12:08:38.381000 ALTER TABLE counters DROP COLUMN

[web2py] IS_IN_SET handle dictionary

2018-09-03 Thread Yebach
Hello Is it possible to use validator IS_IN_SET to handle dictionary. I want to send a list of dicts for user to select [{"id": 1, "m:code": C-111}, {"id": 2, "m:code": BC-222},.], so when I use on_validate I can handle with id. Thank you -- Resources: - http://web2py.com -

[web2py] Re: scheduler DAL object has no attribute

2018-08-23 Thread Yebach
is being redefined > after it has run? > > On Wednesday, August 22, 2018 at 8:34:08 AM UTC-4, Yebach wrote: >> >> Attaching code >> >> >> #scheduler koda za pošiljanje mailov za stanje števcev >> def send_mail_stevci(first_reminder = False): >>

[web2py] Re: scheduler DAL object has no attribute

2018-08-22 Thread Yebach
sage] #Writte error to log file mailErrorLogger(errmsg) # instantiate Scheduler class from gluon.scheduler import Scheduler scheduler = Scheduler(db) On Wednesday, August 22, 2018 at 1:56:08 PM UTC+2, Anthony wrote: > > Hard to say without seeing code. Obviously the mail_logger table is

[web2py] scheduler DAL object has no attribute

2018-08-22 Thread Yebach
Hello I have a scheduler running some emailing tasks. After email is sent it should write into table mail_logger. When insert should happen I get an error DAL object has no attribute mail_logger. On my test environment everything is working fine. any suggestions? Thank you -- Resources:

[web2py] update or insert based on month

2018-07-23 Thread Yebach
Hello I am trying to update_or_insert records in my db based on two fields. One is integer for the other I would like to choose month from field. Is this possible with web2py's DAL or do I have to create a custom SQL statement. Database is PostgreSQL thank you -- Resources: -

Re: [web2py] Re: 403 Forbidden?

2018-06-27 Thread Yebach
I have a similar problem I am running web2py on windows 10 machine on azure. When I insert URL someurladdress.si I get an error 403, but If I insert someurladdress.si:8000/bilbanstevci it all works fine. Any suggestions? My web2py start line is python web2py.py -i 0.0.0.0. -a pass If I

[web2py] web2py on azure

2018-06-22 Thread Yebach
Hello I am running a web2py app on azure, windows 10 64-bit The app works fine if I access it from the server's browser but when accessing it outside I am getting an error 403 - Forbidden. If I add app name to the end of the URL I get an error 404. Anybody had a problem like that? Any

[web2py] password reset does not redirect to correct page

2018-06-04 Thread Yebach
Hello After the password reset link is received in my mail and I follow the link to MyApp i/default/user/reset_password/1528115334-1104060c-6c13-4715-a153-d19a9f532085 I

[web2py] user request_reset_password doesn't send mail

2018-05-31 Thread Yebach
Hello I am using a normal web2py installation and all user features are working (also retrieve username) but the request reset password is not. Any suggestions on what could be the problem My auth.settings are auth.settings.registration_requires_verification = False

[web2py] SQLFORM dropdown and input field

2018-05-24 Thread Yebach
Hello I would like to create a field so the user can write in new text or selects from drop down menu. What would be the best way to achieve that? thank you -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] SQLFROM.factory csv file upload and manipulation

2018-05-07 Thread Yebach
Hello I am trying different approaches to upload and manipulate csv file before insert it into DB I do not need to save the file but If I can open it with csv DictReader that would be awesome. Any suggestions on how to achieve it. I am trying with SQLFORM.factory

[web2py] create users manually

2018-04-23 Thread Yebach
Hello I would like to create or import users into auth_users table and then send them e-mails with temp passwords that they could change to login into my app. I know it is not the most secure way but so far this is the only solution. How could I achieve that? Or what would be the best way to

[web2py] xml namespaces

2018-02-02 Thread Yebach
Hello Although not so much web2py question and more Python. I am struggling with creating some xmls - more specific namespaces. I would really appreciate it if smbd could help me with this I am trying to get all the namespaces together., but somehow they are not named or declared properly,

[web2py] database update not executed in Exception

2018-01-30 Thread Yebach
Hello In my try-Except block I have a db update to update database back to initial value if code fail. Looks like update is not executed. except Exception as e: "Če je napaka pri ustavljanju woshi engina" #db.rollback() db(db.scripts.id == scriptId).update(sc_status = 10)

[web2py] SOAP WSDL request strugle

2017-12-22 Thread Yebach
Hello I have to create a SOAP client (later also a service will be needed). It is my first time so please bare with me on this one as I do not have a proper understanding of this. If I understand the whole process it is smth like this. I send a WSDL request where URL contains "?wsdl". This

[web2py] SQLFORM.grid custom form on validation, oncreate not triggered

2017-11-15 Thread Yebach
Hello I have a custom form from SQLFORM.grid. After clicking the submit button onvalidation or oncreate funciton are not triggered - although some fields are validated, but that is even before the my_processing_form function there is no redirect after submit and the record is not

Re: [web2py] Is it possible to translate data in SQLFORM.grid?

2017-11-14 Thread Yebach
hello I have a similar problem except it goes for only one table - no parent - child relationship db.define_table('config', Field('co_code', type = 'string', length = 256 ,label = T('Code')), Field('co_organization','reference organizations' ,label =

[web2py] custom form submit not working - form.accepts not triggered

2017-11-07 Thread Yebach
Hello I am trying to implement a custom form for SQLFORM.grid When submit is clicked the data is not inserted. I think the problem is when I validate form and the form.accepts is not triggered. this is my controler def workers(): #some code before but not relevant grid_workers =

Re: [web2py] Re: migrating database and updating it

2017-10-25 Thread Yebach
So this is the whole procedure I did at the end and it seems to do the trick 1. create a folder for your new app (WoShiTest) 2. copy production version there 3. delete content of sessions, error and DATABASE folders 4. in 0.py set db connection string 5. set migrate = True and

[web2py] migrating database and updating it

2017-10-11 Thread Yebach
Hello So based on all the material I have read about migration etc some of the updates are not working. I will explain what I am doing and please correct me where my steps are wrong I going from develop to production version and the key is to keep the database with its current data. 1.

[web2py] Attribute not found. 'Table' object has no attribute 'type'

2017-09-08 Thread Yebach
Hello when I try to create a left join between two tables I get an error Attribute not found. 'Table' object has no attribute 'type' I have lots of left joins in my code and this is the first time I am experiencing this kind of error. Any ideas my query: workers_infos =

[web2py] scheduler speed up task run

2017-08-14 Thread Yebach
Hello I am experiencing some issues with scheduler.py module While running on my local machine (Windows 10, postgres database,..) the scheduler under the following command start relatively quick scheduler = Scheduler(db, tasks = dict(runWoshiEngine = runWoshiEngine,saveIdOut=saveIdOut )

Re: [web2py] Re: flash message gets lost

2017-05-24 Thread Yebach
est.application, 'default', 'index')) return dict(form = form) On Thursday, May 11, 2017 at 8:57:24 PM UTC+2, Yebach wrote: > > OK so changing if form.process().accepted to if form.accepted works for > user registers, if I remove it from if request.args(0)=='profile': > block, it

[web2py] Re: flash message gets lost

2017-05-08 Thread Yebach
o be there any longer, as the framework copies session.flash to > response.flash after a redirect. Is there anything in response.flash at > that point? > > Anthony > > On Sunday, May 7, 2017 at 5:25:17 AM UTC-4, Yebach wrote: >> >> Hello >> >> After redirecting us

[web2py] encoding form fields when registering user - bug or feature?

2017-05-07 Thread Yebach
Hello I just discovered the following behavior when user fills the user registration form in my form i have confirm password. and in storage the following values are stored , 'email': 'test_m...@gmail.com'}> as you can see the password_two is not encrypted. In case i forgot to set the

[web2py] flash message gets lost

2017-05-07 Thread Yebach
Hello After redirecting user after registriation the flash message is not shown. if I print session the message gets lost --> flash is none I inserted print session in my user function in default.py controller and in index function This is the print result session index session index

Re: [web2py] Delete EXPORT button from SQLFORM.grid

2017-05-05 Thread Yebach
How can you also remove the text "Export" ?? If I set all classes to False the text stays, if I remove export classes from signature it displays all On Wednesday, August 15, 2012 at 12:41:28 PM UTC+2, Jan Rozhon wrote: > > Silly me didnt notice this option. Thx > > Dne středa, 15. srpna 2012

[web2py] SQLFfor,.grid export query

2017-04-24 Thread Yebach
Hello I would like to use a different query to export data from table when using SQLform.grid, compared to the one i use to represent data in the grid. Also I would like to export more columns than I show in the grid. I tried with this instructions but I am getting different types of errors.

[web2py] Re: detect selected language

2017-03-14 Thread Yebach
Based on the selected language i send a different file to user when he/she registers i user this if any("adminLanguage=sl" in s for s in request.env.HTTP_COOKIE.split(";")): formFile = os.path.join(request.folder, 'private', 'formular_WoShi_podatki.doc') else: formFile =

[web2py] detect selected language

2017-03-14 Thread Yebach
Hello What would be the easiest way to detect which language has the user chosen in view? Thank you -- 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) ---

[web2py] IS_NOT_ID_DB for mutliple fields

2017-01-21 Thread Yebach
Hello I have to make a validator on my SQLFORM that checks 4 fields my table is db.define_table('workers_skills', Field('ws_organisation', type ='integer'), Field('ws_worker', 'reference workers', label = T('Worker')), Field('ws_skill',

[web2py] scheduling multiple tasks

2016-11-10 Thread Yebach
Hello In my web2py app i am using scheduler. So far I have one task scheduled which runs a subprocess when called from controler (an external exe file/application) Now i want to add another task which will do some background work My code in *scheduler.py* till now was def

[web2py] Re: datetime midnight is None - BUG?

2016-10-14 Thread Yebach
> Anthony > > On Friday, October 14, 2016 at 5:07:16 AM UTC-4, Yebach wrote: >> >> Hello >> >> I have a datetime field in db. If I set time to 0:00 - datetime.time(0, >> 0) the if statement behaves as variable is None >> >> Any ideas why? >

[web2py] datetime midnight is None - BUG?

2016-10-14 Thread Yebach
Hello I have a datetime field in db. If I set time to 0:00 - datetime.time(0, 0) the if statement behaves as variable is None Any ideas why? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: gluon.globals.Request parsing behavior for array with length 1

2016-07-27 Thread Yebach
Did you menage to solve this. I am facing the same issue here and it is killing me. On Thursday, July 9, 2015 at 2:46:52 PM UTC+2, kk wrote: > > In gluon.globals, I found a behavior that I don't understand, and that > gives me an headache. > > class Request(Storage): > ... > def

[web2py] Re: calling function from the view

2016-05-11 Thread Yebach
In which model file do you put it or you create a new one (if so what is the name of the file)? On Saturday, August 22, 2009 at 5:19:38 AM UTC+2, Ray (a.k.a. Iceberg) wrote: > > In case you don't know, you can also put functions inside model, so > that they are globally available. I think this

[web2py] sqlform time field value representation

2016-04-14 Thread Yebach
Hello I have the following problem. I have SQLFORM.grid When I go to edit view i have 4 fields which should be represented as time (clock picker etc) Once the form is submited only one field is actually send as datetime.time other are as strings. I have no idea why Also if I edit time fields

[web2py] Login form does not present error msg

2016-03-25 Thread Yebach
Hello I am having a problem with my login form I have a login form on my index page. If a user enters wrong pass there is no error msg only page is reloaded Any suggestion? Thank you My controller: def index(): # If user is not logged in if not auth.is_logged_in():

[web2py] Re: Optimising caching and enabling gzip for web2py on heroku?

2016-03-11 Thread Yebach
I would like to speed up my page a little bit. one of the suggestions by https://gtmetrix.com is to gzip my files I am looking at your zip_statis_file.py where do I insert this function? On Sunday, March 3, 2013 at 2:55:02 PM UTC+1, Niphlod wrote: > > response.static_version is the answer for

[web2py] Re: on button click show progress bar

2016-03-11 Thread Yebach
rch 3, 2016 at 6:18:00 AM UTC-8, Yebach wrote: >> >> Hello >> >> I have call to controller function on button click that serves back a >> download file. >> >> Since this can take a while (up to 10 seconds), i would like to create >> so

[web2py] on button click show progress bar

2016-03-03 Thread Yebach
Hello I have call to controller function on button click that serves back a download file. Since this can take a while (up to 10 seconds), i would like to create some sort of progress bar or smth for user so he/she knows smth is going on in the background and does not click 10 times. Any

[web2py] SQLFORM.gris sorting by multiple fields

2016-02-23 Thread Yebach
Hello Is it possible to have a sort order by second key in SQLFORM.grid. Table: First_nameLast_name Skill John Doe Medic MarrySmith Medic Tim Doe Surgeon MarryObama Surgeon If e.g. I would like

[web2py] Re: zip file length problem

2016-02-16 Thread Yebach
a memory problem, the traceback would > probably return something else... also... what's the line that raises the > error ? > > On Tuesday, February 16, 2016 at 8:00:14 PM UTC+1, Yebach wrote: >> >> Hello >> >> I have a following problem >> >>

[web2py] zip file length problem

2016-02-16 Thread Yebach
Hello I have a following problem When I try to serve a zip file to user i get the following error Uncompressed size\nTypeError: object of type \'NoneType\' has no len() There is data to be compressed, but there is lots of it so this I believe is causing the problem my code is the following:

[web2py] user registration flash message not returned

2016-02-03 Thread Yebach
Hello I cannot retrieve the session.flash message after user successfully registers my controler (default.py ) is the following def user(): if request.args(0)=='profile': #uporabnikov Id uid = auth.user_id #preberem podatke za tega userja iz obeh tabel

[web2py] Re: export data to OOO and Excel

2016-01-24 Thread Yebach
Is it possible to stram the file without creating a temp file and how can I zip it (without temp file) On Wednesday, July 1, 2015 at 4:45:36 PM UTC+2, Massimo Di Pierro wrote: > > i like handsontable. It displays data like excel and allows cut > to/from excel. It has a select all button > > On

[web2py] download csv and excel file in zip

2016-01-23 Thread Yebach
Hello I have the following problem I need to download a csv and an excel file together in a zip file I would like to skip the part to create file(s) on server and then serve it and remove it. I am getting an error while using import csv, cStringIO import zipfile

Re: [web2py] Re: server function not triggered in some cases

2016-01-20 Thread Yebach
UTC+1, Niphlod wrote: > > "neverending" for this sake is "running for more than the usual timeout > imposed by webservers" which is 60 seconds. > > a task can be queued and also stopped via the scheduler APIs (queue_task > and stop_task) > > On Monday, J

Re: [web2py] Encoding while reading postgres data

2016-01-20 Thread Yebach
thing use byte (str('byte string')) > and not unicode (u'your properly encoded string')... So if you pass data > from web2py what I showed you is the way of doing it... > > Richard > > On Mon, Jan 4, 2016 at 11:59 AM, Yebach <vid@gmail.com > > wrote: > >>

Re: [web2py] Encoding while reading postgres data

2016-01-20 Thread Yebach
string or generate js > code from python you need it... > > In the view : > > {{=XML(python_var_containing_text_or_js_code}} > > Richard > > On Wed, Jan 20, 2016 at 4:52 AM, Yebach <vid@gmail.com > > wrote: > >> In this case I get the list of string

Re: [web2py] Re: server function not triggered in some cases

2016-01-18 Thread Yebach
ocess inside a web request. That's why > long-running processes NEED to be managed OUTSIDE web2py (and why web2py > provides a nifty out-of-band processor called scheduler) > > PS: it was the first thing I said. > > On Monday, January 11, 2016 at 4:08:59 PM UTC+1, Yebach wrot

[web2py] web2py httpserver log file location

2016-01-11 Thread Yebach
Hello I have a strange behavior of my log file, or better to say the location of my log file. If I understand correctly httpserver.log file is usually located in application folder. When I have to run the engine the following code is executed path =

[web2py] Re: server function not triggered in some cases

2016-01-07 Thread Yebach
: > > what are you to run the actual calculation ? because if you're using the > webserver, you may need to pay attention to the fact that there is ALWAYS a > timeout imposed on the request coming in to avoid runaway calculations. > > On Thursday, January 7, 2016 at 6:47:47 PM U

[web2py] server function not triggered in some cases

2016-01-07 Thread Yebach
Hello Using web2py (Version 2.8.2-stable+timestamp.2013.11.28.13.54.07), on 64-bit Windows, I have the following problem User triggers an engine that does some work and this engine creates an txt file with results. While engine is still calculating (engine is creating better and better

[web2py] Encoding while reading postgres data

2016-01-04 Thread Yebach
Hello I have the following scenario. Database is PostgreSQL, encoding set to UTF-8 When I read data from database with web2py I get a string reading in type of *Bolni\xc4\x8dar* where it was suppose to be *Bolničar*. Now, when i use web2py to present data in my view is all fine (so I can

Re: [web2py] Encoding while reading postgres data

2016-01-04 Thread Yebach
javascritp_string_var = s.decode('utf8') > > Or > > javascritp_string_var = unicode(s, 'utf8') > > Richard > > > On Mon, Jan 4, 2016 at 11:34 AM, Yebach <vid@gmail.com > > wrote: > >> Hello >> >> I have the following scenario. >> &

[web2py] sqlform.grid csv export set delimiter

2015-11-10 Thread Yebach
Hello Is it possible to set the delimiter (tab delimited) for csv export from SQLform.grid? also if I want to export some rows but do not want to show them in grid, what is the syntax to use (I want to hide a column db.workers.id, but i want to export it)? thank you -- Resources: -

[web2py] SQLFORM grid special edit form for specific record

2015-11-01 Thread Yebach
Hello SO I have a SQLFORM.grid. I would like to create an edit view for specific records in db (based on one field name) that instead of text field shows checkbox and writes True/false into database I hope question is understandable any suggestions? thank you -- Resources: -

[web2py] sqlfor grid uneditable lets edit once in form view

2015-10-30 Thread Yebach
Hello I have a view that shows two grids. One is editable one not. Everything ok. The uneditable has an option view, so user can see all the parameters. Once in form view there is an edit button and he can edit the values. I want to prevent that from happening. How can I do that. This is my

[web2py] Re: Problem with combination of SQLForm.grid + LEFT JOIN + Computed Fields

2015-10-30 Thread Yebach
I have quite similar problem, except when I use row.table_name.field_name, then my edit view stops working Any suggestions?? here is my code @auth.requires_login() def workers_skills(): user = auth.user_id org = db(db.auth_user.id ==

[web2py] Re: Extend SQLFORM.grid Action Button functionality

2015-10-29 Thread Yebach
When I use row.id in links i get an error, row has no attribute id? My links is in controler before i create SQLFORM.grid. What am I doing wrong On Friday, March 1, 2013 at 11:31:54 PM UTC+8, Niphlod wrote: > > disclaimer: not tested: in a controller, prepare a function > > def check_to_true():

Re: [web2py] Re: SQLFORM grid process not working

2015-10-06 Thread Yebach
gt; if grid.create_form.errors: >> >> elif grid.update_form: >> if grid.update_form.errors: >>... >> >> NEVER call process() for these forms. The grid process them automatically >> and you should never process() twi

Re: [web2py] Re: SQLFORM grid process not working

2015-10-06 Thread Yebach
no form.process(), there is no >>> form.accepted, there is no form.errors etc. This if not a form. >>> >>> A grid MAY contain a form so you should do: >>> >>> grid = SQLFORM.grid() >>> if grid.create_form: >>> if grid.create_form.errors: >>>

[web2py] SQLform grid custom function for delete

2015-09-14 Thread Yebach
Hello Is there a way to use SQLform.grid and add a function and new buttons for delete record and other purposos I do not allow user to actually delete records just to change status in database, so the record still stays there. Any suggestions? -- Resources: - http://web2py.com -

Re: [web2py] Re: one to many relationship

2015-08-11 Thread Yebach
To create one to many form i tried to follow the post from this guy http://blog.jotbe-fx.de/articles/2522/web2py-Normalized-many-to-many-model-with-multiselect-drop-down Also to create the dropdown etc. The thing worked kind of but the problem was that my grid was not getting populated once

[web2py] one to many relationship

2015-08-06 Thread Yebach
Hello How to solve the problem of one to many relationship: Lets say I have a worker that has multiple skills. How to set up SQLFORM to add as many skills to the worker as possible. So skills in one table workers in another.I guess a third table will be needed Thank you best regards --

[web2py] csv upload limit

2015-07-26 Thread Yebach
/forum/#!searchin/web2py/yebach%7Csort:date/web2py/FhgWebuuk4o/sf9dVT05EnYJ) any suggestions? Thank you -- 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

Re: [web2py] Re: import csv file into table

2015-07-25 Thread Yebach
to refresh after file is successfully imported On Sunday, July 26, 2015 at 10:48:06 AM UTC+8, Yebach wrote: This worked nice my code at the end was formImport = SQLFORM.factory(Field('csvfile','upload',uploadfield=False)) formImport.process() if formImport.accepted: try

Re: [web2py] Re: import csv file into table

2015-07-25 Thread Yebach
.' One more question How can I set maximum nb of records user can import? thank you On Wednesday, July 22, 2015 at 10:43:01 AM UTC+8, Yebach wrote: I forgot to saay that I have an sqlformgrid in whoch i am importing On Jul 22, 2015 1:43 AM, Derek sp1d...@gmail.com wrote: I would first suggest

[web2py] import csv file into table

2015-07-21 Thread Yebach
Hello I would like to import csv file into a database table - user imports how do you recommend to do it. I guess telling users to set the column names matching the headers in CSV but how do i match them after for import. I also have to add two fields with user id and another one that is based

[web2py] concatenating strings in group by select

2015-06-04 Thread Yebach
Hello I have the following SQL for PostgreSQL select rw_worker , rw_date , array_to_string(array_agg(distinct results_woshi.rw_shift),'') AS shifts from results_woshi where rw_date '2015-01-01' and rw_script = 42 group by rw_worker, rw_date order by rw_date The result is

[web2py] return server error to uese

2015-03-26 Thread Yebach
Hello What would be the best way to return server error in try, except to user I have multiple functions and i have try, except in each and I would like to show user in alert what the error was (only for selected functions) my except is except Exception as e:

[web2py] try exception update does not work

2015-03-26 Thread Yebach
Hello In my controller function I have a couple of try excepts. In case of except I want to update db record status to different value based on where the error occurred. somehow update record is not executed any suggestions why? here is my controller function def runWoshi(scriptId, script,

[web2py] return javascript alert from contorler without redirection

2015-02-19 Thread Yebach
Hello I have a button for user to export some data from db. If he does not have the right privileges (that is checked on server) I would like to return an alert (possible modal or smth) without redirection after he clicks ok So far I have an alert but user is redirected to an empty page

[web2py] auth_user table referenced table

2015-02-12 Thread Yebach
Hello I have a question regarding adding extra fields to auth_user table now I saw a couple of posts but none answers my question I have a table organization. On user registration user adds organization name in form. this value should be inserted into table organization and id of the record

[web2py] Re: auth_user table referenced table

2015-02-12 Thread Yebach
organization id. Try removing the wizard from extra fields to guess more. Just in case, you can try this other syntax: auth.settings.register_onvalidation.append(lambda form: add_organization( form)) Regards. El jueves, 12 de febrero de 2015, 10:18:46 (UTC+1), Yebach escribió: Hello

[web2py] submenus in layout

2015-02-10 Thread Yebach
I would like to create a drop down menu in my layout. The data for menu is read from menu.py this is my list for menu response.menu_logged = [ (T('Schedules'),URL('default','index')==URL(),URL('default','index')), (T('New schedule'),URL('script','edit')==URL(),URL('script','edit',

[web2py] web2py shutil move or delete

2015-02-10 Thread Yebach
Hello I encounter an interesting problem or bug I have a app that runs some *.exe program that returns a file (*.out) to be processed every couple of second. If I want to stop this exe from working I delete *.lls file. So if a user hits play button I create lls file put it in a directory, sets

[web2py] Re: web2py shutil move or delete

2015-02-10 Thread Yebach
What do you suggest then? This part work? the problem is inside if script.sc_status == 11: On Tuesday, February 10, 2015 at 2:21:13 PM UTC+1, Niphlod wrote: oh please DON'T chdir ! it's not thread safe On Tuesday, February 10, 2015 at 11:19:18 AM UTC+1, Yebach wrote: Hello I encounter

[web2py] Re: serving a zip file

2015-01-30 Thread Yebach
Using parts of your code I have a problem with zip file. It appends text to new file in my zip So first worker has in his ics file his data but second one has his and from previous This is my code cal = Calendar() import zipfile, cStringIO exported_chunks_zip = cStringIO.StringIO()

[web2py] logging exceptions

2015-01-28 Thread Yebach
Hello In my app I have a lot of functions with try: exception: What would be the best way to catch and log exceptions in a file ? thank you -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] SQLFORM.grid check if record in db

2015-01-27 Thread Yebach
Hello I have a SQLFORM.grid page Values for one filed (code) in add or edit view is filed with js code from values of two other fields. User can deactivate this record - it can not be deleted only status is set to e.g. 100 If user creates a new record that creates the same values for code

[web2py] Re: export table to csv

2015-01-22 Thread Yebach
I managed to solve the issue with the following code def csvExport(): scriptId = request.args[0] #rows = db(query,ignore_common_filters=True).select() rows = db(db.result.r_id_script == scriptId).select(db.result.r_item1_name, db.result.r_date,

[web2py] export table to csv

2015-01-21 Thread Yebach
Hello I am trying to create a one button click export to csv, so if a user click he gets a download popup without redirect to new page my controller (script.py) @auth.requires_login() def excelExport(): import csv import cStringIO scriptId = request.args[0] rows = db(db.result.r_id_script ==

[web2py] on user registration insert user id into referenced table

2015-01-12 Thread Yebach
Hello I would like to insert a new registered user Id into another table. What would be the easiest way without controller code? thank you -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

Re: [web2py] Re: navbar in sqlform.grid

2015-01-08 Thread Yebach
Do you mean in auth tables or other tables In auth tables I do not have, only thing is I added one field I have in other tables On Friday, January 2, 2015 8:16:42 PM UTC+1, Alex Glaros wrote: just guessing do you have the requires clause in your db.py file? E.g.:

[web2py] database select from set encoding

2014-12-29 Thread Yebach
hello I have a postgres dabatabase with utf8 encoding after executing workersDb = db(db.worker.w_organisation == org).select(db.worker.id, db.worker.w_nick_name).as_list() I get a list of dict where my strings are endoed as 'Moj\xc4\x8dca' where it should write Mojčca How do i set the

[web2py] navbar in sqlform.grid

2014-12-29 Thread Yebach
Hello My navbar user button does not show dropdown options when I am in a view where SQLFORM.grid is? Any suggestions why? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list

[web2py] adding html to SQLform.grid

2014-12-24 Thread Yebach
Hello Is it possible to add html (span) to SQLFORM.grid. I have a color picker widget and it works ok but it colors the whole field. I would like to add a new html tag inside a table where color picker would be presentet. It is possible to do this inside web2py or do I have to write JS code.

  1   2   >