[web2py] Re: Web2Py compute fields not working on update

2015-04-17 Thread Ian Ryder
Same problem here - all works fine but am using an after_update callback on a child record but the compute doesn't work when the parent record values are updated. On Tuesday, June 19, 2012 at 2:24:05 AM UTC+10, Brandon Reynolds wrote: > > I have this problem when i try to generate thumbnails.

[web2py] Re: Web2Py compute fields not working on update

2015-01-18 Thread 黄祥
hi, i face the same problem, when trying to update the other table that have computed field with after_update callback. e.g. # after_update_purchase_header def __after_update_purchase_header(s, f): purchase = s.select().first() # purchase_header db(db.purchase_detail.purchase_no == purchase.id).

[web2py] Re: Web2Py compute fields not working on update

2013-09-17 Thread Tim Richardson
On Wednesday, 18 September 2013 01:05:28 UTC+10, Anthony wrote: > > On Monday, September 16, 2013 9:07:35 PM UTC-4, Tim Richardson wrote: > >> The importance of definition order is in the book > > > Where specifically? Are you talking about the fact that a computed field > can depend on a previo

[web2py] Re: Web2Py compute fields not working on update

2013-09-17 Thread Anthony
On Monday, September 16, 2013 9:07:35 PM UTC-4, Tim Richardson wrote: > The importance of definition order is in the book Where specifically? Are you talking about the fact that a computed field can depend on a previously defined computed field (but not a computed field that hasn't been define

[web2py] Re: Web2Py compute fields not working on update

2013-09-16 Thread Tim Richardson
The importance of definition order is in the book -- 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 received this message because you are subscribed to

[web2py] Re: Web2Py compute fields not working on update

2013-09-15 Thread Anthony
On Sunday, September 15, 2013 10:27:51 AM UTC-4, step wrote: > Sorry for resurrecting such an old thread, but I wanted to add my solution > to a very similar issue. > It might seem obvious to expert web2py users; I found out that when some > compute fields weren't updating in my app it was due t

[web2py] Re: Web2Py compute fields not working on update

2013-09-15 Thread step
Sorry for resurrecting such an old thread, but I wanted to add my solution to a very similar issue. It might seem obvious to expert web2py users; I found out that when some compute fields weren't updating in my app it was due to unordered cross-dependencies. In other words, if the computation of

[web2py] Re: Web2Py compute fields not working on update

2013-01-22 Thread palomar
sorry, I posted a new threat about it... https://groups.google.com/forum/?fromgroups=#!topic/web2py/8RWkVAYVG1c s. Il giorno martedì 22 gennaio 2013 23:14:17 UTC+1, Massimo Di Pierro ha scritto: > > What web2py version? I cannot reproduce this. > > On Friday, 11 January 2013 14:13:04 UTC-6, palom

[web2py] Re: Web2Py compute fields not working on update

2013-01-22 Thread Massimo Di Pierro
What web2py version? I cannot reproduce this. On Friday, 11 January 2013 14:13:04 UTC-6, palomar wrote: > > Sorry but I have the same problem; i tried with readable=true and > writable=true and to comment the line in DAL.py, but nothing. > I have this table: > db.define_table('magazzino', >

[web2py] Re: Web2Py compute fields not working on update

2013-01-11 Thread palomar
Sorry but I have the same problem; i tried with readable=true and writable=true and to uncomment the line in DAL.py, but nothing. I have this table: db.define_table('magazzino', Field('id_tipo', 'integer',default=0), Field('p_p','double', default=0.0), Field('pp_tot','double', writabl

[web2py] Re: Web2Py compute fields not working on update

2012-08-21 Thread Brandon Reynolds
Thank you so much i got it working. I removed the readable=false and writable=false and it works on update now. Those are not needed anyway because when the compute field is added on the model it hides it automatically. Brandon On Thursday, August 9, 2012 2:14:42 PM UTC-6, Deidre wrote: > >

[web2py] Re: Web2Py compute fields not working on update

2012-08-09 Thread Deidre
If you look at issue 822 you will see an example of a thumb that works on update. As the comments say, you have to not set writeable to false for the thumb. If you do set writeable to false then compute only works on add not edit or update. So my experience is that compute for images to create a

[web2py] Re: Web2Py compute fields not working on update

2012-08-09 Thread Brandon Reynolds
Has anyone found a way to fix this yet? Or is there a thumbnail module out now? Like django's http://djangothumbnails.com/ Brandon On Monday, June 18, 2012 10:24:05 AM UTC-6, Brandon Reynolds wrote: > > I have this problem when i try to generate thumbnails. If the field is > empty it inserts t

[web2py] Re: Web2Py compute fields not working on update

2012-06-29 Thread web2py_Superfan
as a workaround in my update statement, I updated the computed field to be the computed field via mint_order = db(db.mint_orders2.id==coin.deannas_dough.mint_orders_id).select(db.mint_orders2.ALL)[0] db(db.mint_orders2.id==mint_order.id).update(num_won=num_won+1,image_thumb=mint_order.image_thu

[web2py] Re: Web2Py compute fields not working on update

2012-06-29 Thread web2py_Superfan
I have a much older build, and I have this issue as well. The compute field gives me an error when I do an update, 'key error' image On Wednesday, June 20, 2012 9:08:31 PM UTC-7, Brandon Reynolds wrote: > > If i am not the only one not having i think it's possible it may be a > web2py bug. I be

[web2py] Re: Web2Py compute fields not working on update

2012-06-20 Thread Brandon Reynolds
If i am not the only one not having i think it's possible it may be a web2py bug. I bet it is only a bug in update fields as i have seem some other complaints online. I have filed a bug ticket. Hopefully it is fixed soon. I am only a beginner programmer so i still am learning debugging and how

[web2py] Re: Web2Py compute fields not working on update

2012-06-20 Thread pbreit
Oh, my bad. You're right, looks like not updating. Will dig in more. Sorry about that.

[web2py] Re: Web2Py compute fields not working on update

2012-06-20 Thread Brandon Reynolds
pbreit, I just used your script and my first time thumbnails are working again. However the are still not computing on update. Do your thumbnails compute when updating? Brandon On Wednesday, June 20, 2012 1:58:12 PM UTC-6, pbreit wrote: > > Mine seems to work OK with current trunk: > > db.item

[web2py] Re: Web2Py compute fields not working on update

2012-06-20 Thread pbreit
Mine seems to work OK with current trunk: db.item.image_thumb.compute = lambda r: resize_image(r['image'], (150,130), 'thumb') def resize_image(image, size, path, rotate=0): if image: try: img = Image.open('%sstatic/uploads/%s' % (request.folder, image)) img

[web2py] Re: Web2Py compute fields not working on update

2012-06-20 Thread Brandon Reynolds
You are correct. I am still sort of new to python and i didn't realize that .thumbnail was a PIL method. However after i fixed that issue it still isn't working at all. Does anyone have a simple script to do thumbnails? Maybe one that doesn't involve compute. Brandon On Tuesday, June 19, 201

[web2py] Re: Web2Py compute fields not working on update

2012-06-19 Thread villas
I don't understand this line: img.db_photo_var((nx, ny), Image.ANTIALIAS) why isn't it this?? img.thumbnail((nx, ny), Image.ANTIALIAS) Isn't thumbnail a method in PIL? Maybe I'm missing something? Regards, David

[web2py] Re: Web2Py compute fields not working on update

2012-06-19 Thread Brandon Reynolds
I have spend a long time on this and haven't come up with a fix. My script is back to the original but oddly enough not the new record thumbnails aren't generating either. I had the files when they were working saved elsewhere and just put them back in. Now thumbnails aren't generating at all.

[web2py] Re: Web2Py compute fields not working on update

2012-06-19 Thread Massimo Di Pierro
Basically the function _listify is called by both inser and update. It figures out which fields are missing and gets their default, update or computed value. Looks like it is not calling compute. It has three loops: for name in fields: ... for ofield in self:

[web2py] Re: Web2Py compute fields not working on update

2012-06-19 Thread Brandon Reynolds
Peter, I tried your fix with no luck. It did not work unfortunately. Massimo, I replaced the lines you specified with no luck. It never printed out computing. What should we try to next to debug this? Brandon On Tuesday, June 19, 2012 8:28:20 AM UTC-6, Massimo Di Pierro wrote: > > I need your

[web2py] Re: Web2Py compute fields not working on update

2012-06-19 Thread Massimo Di Pierro
I need your help debugging this. In dal.py there are these lines: def _listify(self,fields,update=False): for ofield in self: if not ofield.name in new_fields_names and ofield.compute: try: new_fields.append((ofield,ofield.compute(Row(fie

[web2py] Re: Web2Py compute fields not working on update

2012-06-19 Thread LightDot
I think this is closely connected to an existing Issue 687 (Compute= should work always, not once): http://code.google.com/p/web2py/issues/detail?id=687 Regards On Monday, June 18, 2012 11:21:57 PM UTC+2, peter wrote: > > I would try removing the readable and writeable false for the compute >

[web2py] Re: Web2Py compute fields not working on update

2012-06-18 Thread peter
I would try removing the readable and writeable false for the compute fields. It seems that it does automatically not show them. I found that setting readable and writeable to False means the thumbs only get computed on insert, not update. I reported this a while back. Peter On Monday, 18 June

[web2py] Re: Web2Py compute fields not working on update

2012-06-18 Thread Massimo Di Pierro
Will look into this asap. Please open a ticket about it so that it is tracked. On Monday, 18 June 2012 14:40:30 UTC-5, Brandon Reynolds wrote: > > In a new record a thumbnail is correctly generated from photo. But if I > didn't upload a photo or want to change the photo the thumbnail doesn't >

[web2py] Re: Web2Py compute fields not working on update

2012-06-18 Thread Brandon Reynolds
In a new record a thumbnail is correctly generated from photo. But if I didn't upload a photo or want to change the photo the thumbnail doesn't generate. So basically a new record works properly but when updating nothing in the thumbnail changes at all whether or not is currently has a photo in

[web2py] Re: Web2Py compute fields not working on update

2012-06-18 Thread Massimo Di Pierro
Let me understand this better. on insert, the thumbnails are created. on update, if you upload a new photo1 is photo_thing1 generated? Can you provide a simpler code to reproduce the problem with a just one upload field and one thumbnail field? massimo On Monday, 18 June 2012 11:24:05 UTC-