Re: [web2py] Re: Scheduler exception when setting immediate=True: 'Deadlock found when trying to get lock...'

2015-04-24 Thread Osman Masood
2:19:48 AM UTC-8, mcm wrote: > > Try too see if in production there is a transaction that stays open for a > long time. > It could be a console left open somewhere? > > > 2015-02-27 8:42 GMT+01:00 Osman Masood >: > >> Right. The purpose of using the console was to

Re: [web2py] Re: Scheduler exception when setting immediate=True: 'Deadlock found when trying to get lock...'

2015-02-26 Thread Osman Masood
e observing > deadlocks! > > > On Friday, February 27, 2015 at 3:38:19 AM UTC+1, Osman Masood wrote: >> >> I was actually able to easily reproduce this. Just open up 2 web2py >> consoles (which connect to the same DB), and do: >> >> scheduler.queue_task('

[web2py] Re: Scheduler exception when setting immediate=True: 'Deadlock found when trying to get lock...'

2015-02-26 Thread Osman Masood
ker == True).select() +for scheduler_worker_ticker in scheduler_worker_tickers: +scheduler_worker_ticker.update_record(status=PICK) On Thursday, February 26, 2015 at 3:54:47 PM UTC-8, Osman Masood wrote: > > Thanks for the quick response! > > I

[web2py] Re: Scheduler exception when setting immediate=True: 'Deadlock found when trying to get lock...'

2015-02-26 Thread Osman Masood
r database is too much "underpowered" to do what you're asking. > How many workers are running and with what heartbeat ? > > On Friday, February 27, 2015 at 12:28:28 AM UTC+1, Osman Masood wrote: >> >> Hello all, >> >> I keep getting this error whe

[web2py] Scheduler exception when setting immediate=True: 'Deadlock found when trying to get lock...'

2015-02-26 Thread Osman Masood
Hello all, I keep getting this error when calling scheduler.queue_task() with immediate=True: (1213, u'Deadlock found when trying to get lock; try restarting transaction') The stack trace shows this is the culprit: self.db(self.db.scheduler_worker.is_ticker == True).update(status=PICK) (T

Re: [web2py] Connecting to MySQL via SSL

2013-02-16 Thread Osman Masood
7;mysql://user:pwd@127.0.0.1:3307/database', ...) > > Not tested... > > Richard > > > On Thu, Feb 14, 2013 at 6:08 PM, Osman Masood wrote: > >> Hi, >> I'm trying to connect get web2py to connect to MySQL via SSL (or SSH). >> Based on the code

[web2py] Connecting to MySQL via SSL

2013-02-14 Thread Osman Masood
Hi, I'm trying to connect get web2py to connect to MySQL via SSL (or SSH). Based on the code, seems like I need to do something like: db = DAL('..', driver_args=dict(ssl=dict(ca='/path/to/mysql-ssl-ca-cert.pem'))) (I only need the CA cert file, the key and certificate files are not needed for

Re: [web2py] Receiving array passed in from jQuery $.ajax() into Storage object

2012-09-17 Thread Osman Masood
Thanks, Bruno! I actually don't care about the order of rows so request.vars.values() worked for me. Excellent. On Monday, September 17, 2012 6:32:27 PM UTC-7, rochacbruno wrote: > > > You can do something like this: > > In [17]: request_vars = {'table[0][]': ['1', '2'], 'table[1][]': ['3', >

[web2py] Receiving array passed in from jQuery $.ajax() into Storage object

2012-09-17 Thread Osman Masood
Hey guys, I'm passing in an array via $.ajax: $.ajax({ data: { table: [[1, 2], [3, 4]] } type: "post" ... }) And request.vars (a Storage object) gets converted by jQuery into something like this: And I can't use getlist() because the parameter name isn't table but rather table[0][]

[web2py] Re: Dealing with UTC and converting to local time

2012-09-09 Thread Osman Masood
Here's a blog post that explains how to get a user's local timezone in web2py . It uses some JS on the front-end, and requires the jQuery cookie plugin. Thanks On Thursday, October 6, 2011 12:46:45 PM UTC-7, TheSweetlin

[web2py] Re: login and captcha

2012-09-02 Thread Osman Masood
Sorry for the late response. Try this: if session.logincount != 1: auth.settings.login_captcha = Recaptcha(...) form=auth.login() On Thursday, March 1, 2012 6:18:02 AM UTC-8, mweissen wrote: > > Hi, > > I want to do the following. > - login using auth.login > - if login fails captcha should b

[web2py] Re: Ajax and Auth API

2012-09-02 Thread Osman Masood
I know this is kind of old, but this post explains how to do AJAX login/register/forgot password in web2py without LOAD: AJAX auth functions: login, register, and retrieve_password (reset_password) in web2py It's pretty easy to see how to extend the functionalit

[web2py] Re: web2py not reading Amazon SNS Subscription Confirmation requests?

2012-08-09 Thread Osman Masood
rt content (which is how forms > are submitted). > > Anyway, you can still email yourself: > >request.env # the headers > > and > >request.body.read() # the content of the body > > and you will get what you want. > > > > > On Wednesday, 8 August

Re: [web2py] Re: How do larger teams develop with Web2py?

2012-08-09 Thread Osman Masood
Rocha, your post inspires me... On Thursday, August 9, 2012 9:44:38 AM UTC+8, Massimo Di Pierro wrote: > > LOL > > On Wednesday, 8 August 2012 20:17:33 UTC-5, rochacbruno wrote: >> >> >> That is how I am used to work: http://programming-motherfucker.com/ > > --

[web2py] Re: How do larger teams develop with Web2py?

2012-08-08 Thread Osman Masood
I'm a back-end developer and work in parallel with a front-end developer and designer. Because of the MVC architecture (separate models, views, and controllers), we are able to work in parallel just fine. And you're absolutely right that people at all levels can benefit from the rapid adjustment

[web2py] web2py not reading Amazon SNS Subscription Confirmation requests?

2012-08-08 Thread Osman Masood
Hi all, I'm trying to confirm an Amazon SNS subscription with a web2py controller action. The Amazon SNS subscription format is described here (through probably not necessary to understand this pr

[web2py] Re: "boolean" type in MySQL: CHAR(1) vs TINYINT(1)

2012-08-07 Thread Osman Masood
However, web2py maintains the promise of backwards compatibility. One way is to have a 'tinyint_boolean' datatype for those who want to use tinyints as booleans. But that looks kind of messy and inelegant. An alternative is this: We could add a migration script to /scripts to convert all boole

Re: [web2py] web2py DAL connection failing in Apache?

2012-07-17 Thread Osman Masood
t; ovidio...@gmail.com > ovidiomari...@itjp.net.br > ITJP - itjp.net.br >83 8826 9088 - Oi >83 9334 0266 - Claro > Brasil > > > > > 2012/7/8 Osma

[web2py] web2py DAL connection failing in Apache?

2012-07-08 Thread Osman Masood
Hi, I'm running web2py from an Apache server (in production), and it occasionally shuts down, i.e. fails to connect to the DAL until Apache is reset with 'sudo service apache2 restart'. The version of web2py is: Version 2.0.0 (2012-05-16 18:23:15) dev Running on Apache/2.2.14 (Ubuntu) Here's

[web2py] Re: Validation on all fields when updating only certain specific fields?

2012-06-21 Thread Osman Masood
Awesome, thanks for the clarification, Anthony. I thought hidden fields were normal fields processed by SQLFORM. I used the code you gave me and it works great...hope others can benefit from it too. Thanks On Thursday, June 21, 2012 6:33:29 PM UTC-7, Anthony wrote: > > candidate_form = SQL

[web2py] Re: Validation on all fields when updating only certain specific fields?

2012-06-21 Thread Osman Masood
None, so all fields will be > included, but when a form is submitted, fields will include only the > submitted field. > > Anthony > > On Thursday, June 21, 2012 5:11:32 PM UTC-4, Osman Masood wrote: >> >> Hey all, >> Was just wondering about thiscurrently we

[web2py] Re: Small bug in ajax(u, t, s) function

2012-06-21 Thread Osman Masood
I ran into the same bug as well. The patch would work unless the attribute itself has quotes in it, which would need to be escaped: http://stackoverflow.com/questions/4015345/how-to-properly-escape-quotes-inside-html-attributes On Thursday, June 21, 2012 11:50:34 AM UTC-7, Thomas Le wrote: > > H

[web2py] Validation on all fields when updating only certain specific fields?

2012-06-21 Thread Osman Masood
Hey all, Was just wondering about thiscurrently web2py re-runs the form validations for every single field, even if you only update one field. For example, in the models file: db.define_table('user', format = '%(id)s') db.define_table('thing', Field('name', length=100), Field('type', length

[web2py] Re: Using 'username' field instead of 'email' doesn't work?

2012-05-31 Thread Osman Masood
In our case, the app we were migrating had PHP and Python scripts accessing the database, so changing a column name would require lots of code changes everywhere else. I'm going to try forking and making the changes to support auth.settings.email_field . On Thursday, May 31, 2012 5:21:18 PM UT

[web2py] Re: Using 'username' field instead of 'email' doesn't work?

2012-05-31 Thread Osman Masood
user.username.requires = \ > [IS_MATCH('[\w\.\-]+'), > IS_NOT_IN_DB(db, db.auth_user.username)] > > On Thursday, 31 May 2012 15:36:59 UTC-5, Osman Masood wrote: >> >> Thanks for the prompt response. Looks like according to t

[web2py] Re: Using 'username' field instead of 'email' doesn't work?

2012-05-31 Thread Osman Masood
) > > You do not need all the code before that line. > > On Thursday, 31 May 2012 15:09:39 UTC-5, Osman Masood wrote: >> >> Hi, >> I have a custom table, and I'm trying to use a 'username' field instead >> of an 'email' field (since the book s

[web2py] Re: Using 'username' field instead of 'email' doesn't work?

2012-05-31 Thread Osman Masood
n Thursday, May 31, 2012 1:09:39 PM UTC-7, Osman Masood wrote: > > Hi, > I have a custom table, and I'm trying to use a 'username' field instead of > an 'email' field (since the book says if there's a username field, it will > be used instead of the

[web2py] Using 'username' field instead of 'email' doesn't work?

2012-05-31 Thread Osman Masood
Hi, I have a custom table, and I'm trying to use a 'username' field instead of an 'email' field (since the book says if there's a username field, it will be used instead of the email field). However, whenever I try the 'forgot my username' function, it gives me an error, saying: 'email' (Looks