[web2py] Speeding up the admin interface

2012-08-24 Thread Omri Har-Shemesh
file). Do you have any suggestions as to how to speed up the admin interface? Or, for that matter, the server response time which is sometimes quite long? Thanks, Omri Har-Shemesh --

[web2py] Re: Add dict to SERIALIZABLE_TYPES in Row object's as_dict method

2012-07-30 Thread Omri Har-Shemesh
It seems to have been already done by Anthony, thanks for the quick fix! :) Omri On Friday, July 27, 2012 4:33:34 PM UTC+2, Massimo Di Pierro wrote: Send me a patch and I will take a look. It is probably safe. On Friday, 27 July 2012 06:30:54 UTC-5, Omri Har-Shemesh wrote: I recently

[web2py] Add dict to SERIALIZABLE_TYPES in Row object's as_dict method

2012-07-27 Thread Omri Har-Shemesh
I recently defined a pickled SQLCustomType field for automatic dumping/loading of inserted types to the field. The definition is: pickled = SQLCustomType( type = 'text', native = 'text', encoder = (lambda x: pickle.dumps(x)), decoder = (lambda x: pickle.loads(x)) ) I use it to store

[web2py] Re: Suggestion - a pickled DAL field

2012-07-25 Thread Omri Har-Shemesh
Thanks! I will try it out :) On Wednesday, July 25, 2012 3:55:39 AM UTC+2, Anthony wrote: On Tuesday, July 24, 2012 5:58:29 PM UTC-4, Derek wrote: Make it a computed field? I'm not sure that would be helpful in this case. A computed field computes its value automatically based on other

[web2py] Suggestion - a pickled DAL field

2012-07-24 Thread Omri Har-Shemesh
Hi web2pyers, very often, I have a field in the table which has to hold a complicated value (most often numpy arrays). The way I implement it is that I use text as the type of field, and then simply pickle.dumps(my_value) when I save the field, and then pickle.loads(value_from_db) to access the

[web2py] Re: Watching a table for changes

2012-06-12 Thread Omri Har-Shemesh
is specific to that request and does not persist to subsequent requests (unless, of course, you explicitly store it in the cache, session, db, filesystem, etc.). Anthony On Monday, June 11, 2012 11:56:36 AM UTC-4, Omri Har-Shemesh wrote: In order to attach the function, I have a function which

[web2py] Re: Watching a table for changes

2012-06-11 Thread Omri Har-Shemesh
the timestamp to see if it is more recent than the last request. To determine the time of the last request, you could store a timestamp in the session upon each request (so it will be specific to each user). Anthony On Wednesday, June 6, 2012 5:30:56 AM UTC-4, Omri Har-Shemesh wrote

[web2py] Re: Watching a table for changes

2012-06-11 Thread Omri Har-Shemesh
and _after_delete? Best wishes, Omri On Monday, June 11, 2012 3:06:35 PM UTC+2, Omri Har-Shemesh wrote: Hi Anthony, thanks for the reply! I have been looking at the code and there is something I don't really understand (sorry for a noob question): when the functions get called

[web2py] Re: Watching a table for changes

2012-06-11 Thread Omri Har-Shemesh
In order to attach the function, I have a function which is being called through JSON-RPC, and looks like this: @service.jsonrpc def append_listeners(): print db.comments._after_insert # prints [] db.comments._after_insert.append(MyFunction) print db.comments._after_insert # prints

[web2py] Watching a table for changes

2012-06-06 Thread Omri Har-Shemesh
Is it possible to watch a table for changes and define a callback whenever the table is changed? I am trying to implement a mechanism where the client is asking for data every 5 seconds from the server and the server should only return not a null value whenever the data has changed. The problem

[web2py] db.table.insert() inserts a field with id=None but returns an id number

2012-05-09 Thread Omri Har-Shemesh
Hi, I suddenly came across a weird bug, where when I add a record to a specific table (it doesn't happen with other tables), it inserts the record with the id field == null, but returns a number as if it is the id. Furthermore, the number returned is close to (but not exactly) the number of

[web2py] Re: db.table.insert() inserts a field with id=None but returns an id number

2012-05-09 Thread Omri Har-Shemesh
web2py happy again? I'm guessing that now the table's definition as it really is, is different from what web2py expects. Any help would be greatly appreciated! Omri On Wednesday, May 9, 2012 11:14:57 AM UTC+2, Omri Har-Shemesh wrote: Hi, I suddenly came across a weird bug, where when I add

[web2py] Re: db.table.insert() inserts a field with id=None but returns an id number

2012-05-09 Thread Omri Har-Shemesh
Sorry for the frequent e-mails. I just solved the problem - I forgot to set the type of the ID field to INTEGER PRIMARY KEY AUTOINCREMENT, since Sqliteman does not show it as an option. Best, Omri On Wednesday, May 9, 2012 12:15:31 PM UTC+2, Omri Har-Shemesh wrote: Additional information

[web2py] Sharing application across development machines - what files to synchronize from databases directory

2012-03-30 Thread Omri Har-Shemesh
Hey List, I am developing a database application with web2py as the server back-end, and a client application in qooxdoo, which interacts with the server through JSON-RPC. I use Mercurial as my VCS and synchronize the code from qooxdoo, the code from the controller and the code of the model (I

[web2py] Re: Using regular expressions in DAL queries

2012-02-24 Thread Omri Har-Shemesh
I do not know, but I did some internet research and found the following: *PostgreSQL*: supports POSIX style regexps, described to great detail in: http://www.postgresql.org/docs/9.0/static/functions-matching.html *MySQL*: supports a style which is aimed at conformance with POSIX 1003.2,

[web2py] Re: Using regular expressions in DAL queries

2012-02-24 Thread Omri Har-Shemesh
Hi Massimo, I already opened an issuehttp://code.google.com/p/web2py/issues/detail?id=678at Google code, its link is in my second e-mail in this discussion. I will add there a link to this discussion. Best, Omri

[web2py] Using regular expressions in DAL queries

2012-02-23 Thread Omri Har-Shemesh
Hi All, I have been wondering if there is somewhere a hidden method of using regexps in queries. I found this discussionhttps://groups.google.com/d/topic/web2py/-XnMx24to8s/discussion on the mailing list, where a way to do it was suggested and it was said there that this will be added to

[web2py] Re: Using regular expressions in DAL queries

2012-02-23 Thread Omri Har-Shemesh
I opened an issue: http://code.google.com/p/web2py/issues/detail?id=678 Thanks for finding out how this should be done, I don't mind helping nagging about it ;-) Best, Omri

[web2py] Re: regexp in like expressions

2012-02-22 Thread Omri Har-Shemesh
Hi, I have been looking for this option in the DAL and came across this discussion, however it seems that this is no longer defined in the dal.py I have (version 1.99.2). Has this option been dropped again? Is it possible to achieve this behavior in a different way? I looked through the book

[web2py] (Very) small improvement suggestion

2011-12-12 Thread Omri Har-Shemesh
Hi All, I have an extremely small suggestion to make life a tiny bit easier - in the beginning when starting web2py using python web2py.py there appears a dialog box. In the dialog box, the password field has a binding on the 'Return' to start the server when the return key is pressed. I

[web2py] importing gluon to a module in the modules directory

2011-04-21 Thread Omri Har-Shemesh
Hello, I'm writing a module to contain some class definitions I need for my application's business logic and I would like to access gluon from my module. I placed my module inside the modules directory and import it using local_import. I want to have the classes in the module access the

[web2py] Re: importing gluon to a module in the modules directory

2011-04-21 Thread Omri Har-Shemesh
This is stable - I only use the stable version and frequently update using the Update link.

[web2py] Re: importing gluon to a module in the modules directory

2011-04-21 Thread Omri Har-Shemesh
I thought I tried it before, but apparently I didn't, or I changed something because this way seems to work. It also works if I use import gluon.dal and check for gluon.dal.DAL. Sorry to have bothered you, but beforehand I got an error saying that gluon is not recognized. I'm not so sure what

[web2py] Re: datetime, DAL and JSON serialization

2011-04-08 Thread Omri Har-Shemesh
Sorry for the long reply time (I am working at two jobs and didn't have time to get to it yet). I can supply the following simple example: the data model is: db.define_table(timestamps, Field(by, db.auth_user), Field(at, datetime, default=request.now)) and the controller function is:

[web2py] Re: datetime, DAL and JSON serialization

2011-04-01 Thread Omri Har-Shemesh
Sorry for the long reply time (I am working at two jobs and didn't have time to get to it yet). I can supply the following simple example: the data model is: db.define_table(timestamps, Field(by, db.auth_user), Field(at, datetime, default=request.now)) and the controller function is:

[web2py] Re: Web2py uses the wrong database

2011-03-29 Thread Omri Har-Shemesh
Thanks for your quick reply! Omri

[web2py] datetime, DAL and JSON serialization

2011-03-29 Thread Omri Har-Shemesh
Hey, I have a problem with datetime json serialization. I am using the DAL with sqlite, and accessing web2py using JSONRPC. Today I started getting an error when trying to pass datetime fields back to the client. I haven't changed anything in the code for the routines, but it seems that the