[web2py] Re: autodelete image computed field

2012-11-09 Thread Mark Li
Any success on getting the computed thumbnail image to autodelete? I'm having trouble with this too, where an update of a new thumbnail will not delete the old file. On Saturday, April 28, 2012 5:06:25 PM UTC-7, ctrlSoft wrote: hi i have a resize function wich creates image thumbanils...

Re: [web2py] Re: REF: Modal Window: Automatically close and update parent window:

2012-11-09 Thread Teddy Nyambe
Oke gr8!!! will give it a shot!!! thanx you guys, so much to learn!! wb2py rocks!! On 11/8/12, Paolo Caruccio paolo.carucci...@gmail.com wrote: a possible solution (skeleton code so please check for errors and omissions): # controllers def companies(): return dict() def add_company():

[web2py] Re: Optimized way to use web2py Scheduler

2012-11-09 Thread Niphlod
ehm, missing something here: worker(s) do(es) auto-assignments of tasks. there's no web2py involved in assigning task to a particular worker. Said that, I'd run one worker if there are no requisites like I need function1 and function2 to run concurrently, in which case, start 2 workers, they'll

[web2py] REF: Tabs and FORMSQL.Grid focus

2012-11-09 Thread Teddy Nyambe
HI, I have tabs and in one one of them I have a SQLFORM.grid displayed. But when i hit say view or search the grid, the default tabs is displayed. Is there a way of making SQLFORM.grid make ajax calls instead of refreshing whole page...or is there another way i can ensure my grid refreshes the

[web2py] Re: how i can write a web2py code nto javascript

2012-11-09 Thread lyn2py
Do you mean that you want the code to appear on the webpage? Save your code into a file in the static folder, and include in your views file using response.files: {{response.files.append(URL('static','js_folder/your_file.js'))}} On Wednesday, November 7, 2012 5:39:36 PM UTC+8, Ali Alroomi

Re: [web2py] Re: Optimized way to use web2py Scheduler

2012-11-09 Thread Amit
Thanks Niphold for your informative response so If i understood correctly, in my case , I don't need to start 10 different workers as all these 10 tasks will have different time period to run hence one worker will be sufficient to perform the required tasks and in any case, suppose I have to run

Re: [web2py] Re: Optimized way to use web2py Scheduler

2012-11-09 Thread Niphlod
yep. The only limit to having a single scheduler for all your tasks is that it's allowed to have only one running task in a single point in time. NB: no task is discarded at all, only the concurrency is avoided, e.g.: if you have five tasks scheduled for 9.00 AM you'll get all your five tasks

Re: [web2py] Re: Optimized way to use web2py Scheduler

2012-11-09 Thread Ramos
How to start 2 or more workers? Em sexta-feira, 9 de novembro de 2012 11h47min31s UTC, Niphlod escreveu: yep. The only limit to having a single scheduler for all your tasks is that it's allowed to have only one running task in a single point in time. NB: no task is discarded at all, only

[web2py] Salting tables with legacy data, when to turn on record versioning?

2012-11-09 Thread Cliff Kachinske
I am migrating data from a legacy PHP/MySQL app to Web2py/Postgres. The new app will have record versioning for archival purposes. Should I migrate the data with record versioning turned on, or should I wait and turn it on after the completing the migration? Thanks, Cliff Kachinske --

Re: [web2py] Re: Optimized way to use web2py Scheduler

2012-11-09 Thread Niphlod
one worker web2py.py -K yourapp two workers: two shells of the above one, or just web2py.py -K yourapp,yourapp --

[web2py] OperationalError: database is locked

2012-11-09 Thread Mike Anson
Greetings... I may have a problem with my database (sqlite) locking. Traceback (most recent call last): File /home/web2py/src/web2py/gluon/scheduler.py, line 218, in executor result = dumps(_function(*args,**vars)) File applications/ircmessage/models/tasks.py, line 57, in

[web2py] Re: OperationalError: database is locked

2012-11-09 Thread Niphlod
if you can, use a separate db for the scheduler. SQLite doesn't handle well concurrent writes (with default operational capabilities), so having the scheduler operating on the same database of your insertion of messages can lead to locks. Just do db = DAL('whatever.db') db2 =

Re: [web2py] OperationalError: database is locked

2012-11-09 Thread Vasile Ermicioi
what version of sqlite ? import sqlite3 print sqlite3.sqlite_version for sqlite =3.7 you can do db.executesql('PRAGMA journal_mode=WAL') to enable wal ( http://www.sqlite.org/draft/wal.html ) and I am sure that you will not get this error anymore, I remember I had something like that some

Re: [web2py] OperationalError: database is locked

2012-11-09 Thread Vasile Ermicioi
PS: it is enough to execute that only once db.executesql('PRAGMA journal_mode=WAL') then you can remove it --

[web2py] Re: OperationalError: database is locked

2012-11-09 Thread Mike Anson
Thank you again Niphlod. That seems like a sensible way for me to separate the two out. I'll give that a try. On Friday, 9 November 2012 10:31:04 UTC-5, Niphlod wrote: if you can, use a separate db for the scheduler. SQLite doesn't handle well concurrent writes (with default operational

Re: [web2py] OperationalError: database is locked

2012-11-09 Thread Mike Anson
I really appreciate your input Vasile. I will round back on to your advice should Niphlod's advice of separating the scheduler DB and my messaging DB not help me out here. On Friday, 9 November 2012 10:33:01 UTC-5, Vasile Ermicioi wrote: PS: it is enough to execute that only once

[web2py] Re: What can cause unable to install application?

2012-11-09 Thread Massimo Di Pierro
Hello Luca, where do you teach? Look into gluon/admin.py app_install. There is a try...except. Try replace except Exception: if did_mkdir: rmtree(path) return False with except Exception: import traceback print traceback.format_exc()

[web2py] Re: gitpython module error

2012-11-09 Thread Massimo Di Pierro
It is not a requirement. It is an experimental feature for now. We cannot include it because has binary dependences. When we'll support hg, we'll include it since it has no binary dependencies. On Friday, 9 November 2012 01:19:23 UTC-6, Luc Chase wrote: When trying to install a package from

Re: [web2py] Re: Help with db query

2012-11-09 Thread Wikus van de Merwe
Assuming that request.args contains the right values, this should work: category = request.args[1].replace('_', ' ') query = (db.Supplements.Category == category) ((db.Supplements.Users == request.args[0]) | (db.Supplements.Users == Both)) records = db(query).select() Notes: - contains does

[web2py] Capturing field changes with _after_update and smartgrid

2012-11-09 Thread Jim S
I'm missing something. I have a table where I want to react to changes to a particular field. I'm trying to use the _after_update callback check for this. However, using this it appears to me that I am only seeing the data values after the update. I can't see what they were before the

[web2py] Re: Capturing field changes with _after_update and smartgrid

2012-11-09 Thread Derek
Why not just use before_update? On Friday, November 9, 2012 10:53:21 AM UTC-7, Jim S wrote: I'm missing something. I have a table where I want to react to changes to a particular field. I'm trying to use the _after_update callback check for this. However, using this it appears to me that

[web2py] Re: Capturing field changes with _after_update and smartgrid

2012-11-09 Thread Jim S
Because the update may fail. -Jim On Friday, November 9, 2012 12:20:18 PM UTC-6, Derek wrote: Why not just use before_update? On Friday, November 9, 2012 10:53:21 AM UTC-7, Jim S wrote: I'm missing something. I have a table where I want to react to changes to a particular field. I'm

[web2py] Re: What can cause unable to install application?

2012-11-09 Thread Luca
Massimo, I teach at UCSC; here is the class web page: https://sites.google.com/a/ucsc.edu/luca/classes/cmps-183-hypermedia-and-the-web/cmps-183-fall-2012 Thank you for the help; I will do this next time a student package does not load properly! Luca On Friday, November 9, 2012 8:18:21 AM

[web2py] Re: how i can write a web2py code nto javascript

2012-11-09 Thread Derek
No, he's trying to use a web2py function within the javascript, or have web2py write javascript instead of html. I'm not sure it can do that. On Friday, November 9, 2012 3:37:10 AM UTC-7, lyn2py wrote: Do you mean that you want the code to appear on the webpage? Save your code into a file

[web2py] Re: Capturing field changes with _after_update and smartgrid

2012-11-09 Thread Derek
Use before_update to store the current data in the session, then the after_update would have access to it. On Friday, November 9, 2012 11:55:36 AM UTC-7, Jim S wrote: Because the update may fail. -Jim On Friday, November 9, 2012 12:20:18 PM UTC-6, Derek wrote: Why not just use

[web2py] Re: Optimized way to use web2py Scheduler

2012-11-09 Thread pbreit
cron On Thursday, November 8, 2012 10:59:04 PM UTC-8, Amit wrote: Hi, I have more than 10 functions which has to be executed by Scheduler and each task has assigned different time ( for e.g...one has to execute on every 15 minutes, other one has to executes on every 24 hrs etc... ) to

[web2py] Re: How many error tickets does a typical newbie handle?

2012-11-09 Thread pbreit
Are you saying your app used to work but now it doesn't? I don't understand your problem exactly. On Tuesday, November 6, 2012 5:34:40 PM UTC-8, Bill Thayer wrote: Didn't have ANY problems with this line of work in 2 years of deployment. So your post does help with migration errors but...

[web2py] Re: sym link for an application - is it possible?

2012-11-09 Thread pbreit
Symlinks should work fine. The symlink should be to the app's directory on your hard drive. On Tuesday, November 6, 2012 12:40:37 AM UTC-8, dederocks wrote: I'd like to have an application folder on dropbox, so I've replaced the application folder with a link on the folder in dropbox -- but

[web2py] DAL and Pivot Tables

2012-11-09 Thread Rocco
(I already post this question, but it was deleted in few seconds and no reason was mentioned. I try to repost it, removing formatting and external links... If something is wrong, please inform me :) I have defined this model: db.define_table('fruits_in_shop', Field('shop_name'),

[web2py] Routing help with url helper

2012-11-09 Thread Ashu Verma
Hi, i am having the basic routing where i omitted the application name in url. Below is the content of my routes.py default_application = 'init' default_controller = 'default' default_function = 'index' routes_in = ( ( '/$c/$f' , '/init/$c/$f' ), ( '/$c/$f/$anything' ,

[web2py] web2py appliance not working

2012-11-09 Thread elyase
Can some one tell if the eStore example appliance is working for you? https://github.com/mdipierro/web2py-appliances/tree/master/EStoreExample In web2py 2.1.1 the products don't get listed, I get an invalid SQL error. --

[web2py] Pivot tables using DAL?

2012-11-09 Thread Rocco
Dear All, I have defined this model: db.define_table('fruits_in_shop', Field('shop_name'), Field('species'), Field('number','integer')) With this kind of record inside: fruits_in_shop.idhttp://127.0.0.1:8000/welcome/appadmin/select/db?orderby=fruits_in_shop.id

[web2py] Something I have been working on ...

2012-11-09 Thread Massimo Di Pierro
https://github.com/mdipierro/mdpcl This is not web2py related but it is python related. The JS part could find applications in web2py apps. --

Re: [web2py] Re: Capturing field changes with _after_update and smartgrid

2012-11-09 Thread Jim Steil
I thought of that too, but for some reason it appears to be a fragile solution in my mind. Should I be putting more faith in the stack? Is this something that is commonly done? -Jim On Fri, Nov 9, 2012 at 1:39 PM, Derek sp1d...@gmail.com wrote: Use before_update to store the current data in

Re: [web2py] Re: Capturing field changes with _after_update and smartgrid

2012-11-09 Thread Niphlod
simple scientific thoughts. It's like databases triggers. Db triggers apply to the onupdate event, i.e. they let you use a set of just updated fields AND the fields that are going to be updated. Web2py has to intercept the update before or after, because databases (the python dbapi in general)

Re: [web2py] Re: Capturing field changes with _after_update and smartgrid

2012-11-09 Thread Jim Steil
Thanks Niphlid, I was going to ask about the db.commit issue before but forgot. I'm going to give the _before_update callback a try and see how well that works for me. Thanks for all the responses, I truly appreciate it. -Jim On Fri, Nov 9, 2012 at 3:32 PM, Niphlod niph...@gmail.com wrote:

Re: [web2py] Re: Capturing field changes with _after_update and smartgrid

2012-11-09 Thread Jim Steil
Just reporting back. The _before_update is working perfectly for me. -Jim On Fri, Nov 9, 2012 at 3:45 PM, Jim Steil ato.st...@gmail.com wrote: Thanks Niphlid, I was going to ask about the db.commit issue before but forgot. I'm going to give the _before_update callback a try and see how

Re: [web2py] Re: Capturing field changes with _after_update and smartgrid

2012-11-09 Thread Derek
Cool, I might have suggested using versioning if all you are trying to do is to track changes. On Friday, November 9, 2012 3:38:28 PM UTC-7, Jim S wrote: Just reporting back. The _before_update is working perfectly for me. -Jim On Fri, Nov 9, 2012 at 3:45 PM, Jim Steil ato@gmail.com

[web2py] Re: DAL and Pivot Tables

2012-11-09 Thread Derek
try using groupby and sum http://web2py.com/books/default/chapter/29/06#sum,-avg,-min,-max-and-len On Friday, November 9, 2012 1:10:40 PM UTC-7, Rocco wrote: (I already post this question, but it was deleted in few seconds and no reason was mentioned. I try to repost it, removing formatting

[web2py] Re: calendar display

2012-11-09 Thread dantuluri jaganadha raju
Please reply to this as soon as possible.Thank you in advance On Sunday, November 4, 2012 8:03:20 AM UTC+5:30, dantuluri jaganadha raju wrote: Hi, I want to display the calendar that will display when we click on some field(appropriate) of a form .One thing is that I will not click

[web2py] Images not laoded

2012-11-09 Thread Julien Courteau
Hello All, The images of my home page didn't load if I try to access it with the following URLs: localhost:8000/ localhost:8000/mm/ but loaded fine with: localhost:8000/mm/default/ or localhost:8000/mm/default/index/ the name of my application being, of course, mm and my

[web2py] Re: Images not laoded

2012-11-09 Thread pbreit
Are you doing images like this? IMG(_src=URL('static','logo.png'), _alt=My Logo) or img src=URL('static','logo.png') alt=My Logo On Friday, November 9, 2012 7:20:03 PM UTC-8, Julien Courteau wrote: Hello All, The images of my home page didn't load if I try to access it with the

[web2py] Ref: SQLFORM.grid question

2012-11-09 Thread Teddy Nyambe
Hi, How does one achieve clicking a row SQLFORM.grid and the details open in a modal window form, save changes to fields then modal window closes and the grid is refreshed with changes. Whr can I find comprehensive documentation on the SQLFORM.grid. Teddy L --