[web2py] Placeholder in SQLFORM factory

2016-04-01 Thread Nick Michael
Hi there, I can't seem to find a way to add placeholder text using SQLFORM.factory. My table design is as follows: upload_folder = os.getcwd() + "/applications/" + request.application + "/uploads" form = SQLFORM.factory( Field('name', requires=db.user_items.name.requires), Field(

[web2py] Upload file from 'static/images' to database

2016-03-29 Thread Nick Michael
Hi, I'm having some trouble and was hoping someone could point me in the right direction. I'm creating an application which has an input form which stores to a database. One entry accepts images, but can also be left empty (by using requires IS_EMPTY_OR). I also have a placeholder image saved u

[web2py] Re: web2py + maps. Any sugestion?

2015-02-02 Thread nick name
Also have a look at: https://github.com/jwass/mplleaflet Seems to also make Matplotlib-style plots work well with leaflet. haven't tried it yet, but it looks awesome. On Monday, January 19, 2015 at 7:42:30 AM UTC+2, Carlos A. Armenta Castro wrote: > > Im trying to work with maps for a vehicle t

[web2py] Re: Uploaded PDF viewing

2015-01-21 Thread nick name
Note, however, you potentially let anyone download any other user's file. If you do this, make sure you require signed URLs on the display controller On Thursday, January 8, 2015 at 7:25:11 PM UTC-5, Rob Paire wrote: > > Hi Dominic, > I found the simplest way to serve PDF files is to save them i

[web2py] Re: add task and wait the result

2014-11-30 Thread nick name
are being processed, workers not > ready, db contention, etc etc etc) > > On Friday, November 28, 2014 8:02:15 PM UTC+1, nick name wrote: >> >> Related, but not exactly the same question: >> >> I'm submitting an immediate task in a regular (no sleep or anythi

[web2py] Pagination within a SQLFORM.factory

2014-11-28 Thread nick name
I want to let the user do a query and paginate through the resulting table. grid/smartgrid would be great, except that I need to supply the query through a form and not leave it open -- the query has minimum and maximum values for most fields, multiple selects for others (I build the search que

[web2py] Re: add task and wait the result

2014-11-28 Thread nick name
Related, but not exactly the same question: I'm submitting an immediate task in a regular (no sleep or anything -- though no special commit either); I can see it's queued for seconds and sometimes minutes before getting assigned and running. There are no other tasks waiting or running, there ar

Re: [web2py] web2py + OSM (OpenStreetMap) integration?

2014-11-06 Thread nick name
se example enought for your needs? > > http://dev.openlayers.org/examples/osm-google.html > > http://dev.openlayers.org/examples/osm-marker-popup.html > > http://dev.openlayers.org/examples/osm.html > > > > Cheers > > M. > Dear Nick, > i

[web2py] Re: Recent python -> native code compiler status (PyPy, Nuitka, Cython, Numba)?

2014-11-06 Thread nick name
On Thursday, November 6, 2014 5:26:28 PM UTC+2, Leonel Câmara wrote: > > Frankly I have no interest in making my code harder to decompile or not > delivering the code, it's protected by copyright and usually I sell the > costumer projects that they paid to develop so I find it ethically wrong >

[web2py] Re: Recent python -> native code compiler status (PyPy, Nuitka, Cython, Numba)?

2014-11-06 Thread nick name
On Thursday, November 6, 2014 4:12:01 PM UTC+2, Leonel Câmara wrote: > > Does any of them eventually let you pack the app in a native executable >> that does not include the source code of the app? (not even compiled byte >> code) >> > > Don't use python if you don't want to give out source code.

[web2py] Recent python -> native code compiler status (PyPy, Nuitka, Cython, Numba)?

2014-11-06 Thread nick name
I remember PyPy was able to run web2py apps in the past. Is this still the case? Did anyone try to run web2py apps under Nuitka, Cython or Numba? Was it successful? Was there an observable speed difference? Does any of them eventually let you pack the app in a native executable that does not i

[web2py] web2py + OSM (OpenStreetMap) integration?

2014-11-06 Thread nick name
Is there an example of using web2py together with OSM, similar to the google maps examples? Or some application I can look at and learn from? (I'm not a Google Maps or OSM expert, just need to add a small map + markers to an app) Thanks -- Resources: - http://web2py.com - http://web2py.com/b

[web2py] Re: Slower task scheduler performance

2014-10-26 Thread nick name
On Wednesday, October 22, 2014 6:21:43 PM UTC+3, Carolina Nogueira wrote: > I'm not quite sure whether I am doing something wrong or not... As far as > I understand, the overhead from the web service should be completely > located outside the script and not reflect during its execution. What am

[web2py] Re: Is it possible to restrict a user to single login instance ?

2014-10-14 Thread nick name
On Tuesday, October 14, 2014 9:01:19 PM UTC+3, Mandar Vaze wrote: > Is it possible to either : > not allow login from MachineB (show message that "You are currently logged > in from MachineA - continue to access the application from MachineA, or > logout from MachineA"... or some such message.)

[web2py] Can a register_onvalidation function reject registration?

2014-10-04 Thread Nick C
If I want to have a custom function that gets called after a user clicks "register", is it possible for that function to reject registration? e.g. def checkForm(form): if form no good: reject registration(?) auth.settings.register_onvalidation.append(checkForm) -- Resources: - http://web2p

[web2py] Beginner question: separate styles of auth for two groups of users

2014-10-02 Thread Nick C
uot;Add new patient", a new id is generated and placed into this table. Then with the patient registration, I thought I would have a IS_IN_DB() validator that checks whether the id they input is in the "pending_patients" table. Is this a reasonable way to do this? Thanks in ad

[web2py] Re: web2py resources

2014-09-07 Thread nick name
A nice web2py tutorial: https://impythonist.wordpress.com/2014/02/15/web2py-a-simpleclean-but-powerful-webframework-in-python/ Shamelessly copied to the DigitalOcean community board: https://www.digitalocean.com/community/tutorials/how-to-use-the-web2py-framework-to-quickly-build-your-python-app

[web2py] Re: web2py and anaconda

2014-08-10 Thread nick name
Don't have a mac, and can't reproduce. However, that's not how you're supposed to run it, I think - you should activate the specific environment you set up for web2py and then let the path select the right python. On Friday, August 8, 2014 9:29:09 AM UTC+3, Massimo Di Pierro wrote: > > > ~/anac

[web2py] Re: Security Problem: appadmin is accessible whithout any authentication

2014-07-01 Thread nick name
By any chance, do any of you connect to a local vpn/proxy running on the server that relays the connection, rather than directly? (through openvpn, sshuttle, ssh tunnels, nginx, socks or anything of the sort?) If you do, then it is possible that the connection arrives to the app from 127.0.0.1

[web2py] RapydScript / RapydML - impressive

2014-06-08 Thread nick name
Does anyone have experience with RapydScript (lightweight py-like to JS translator) and RapydML (pythonic-template to html/xml/svg translator)? Have just discovered them, and from a cursory examination they seem extremely nice and useful. RapydScript seems to bridge the JS<->Python bridge bette

Re: [web2py] datetime column with milliseconds precision

2014-04-02 Thread nick name
On Wednesday, February 12, 2014 5:11:29 PM UTC+2, Alex wrote: > > IS_DATETIME validator doesn't change anything. I doubt that validators are > used by the DAL. > I guess I have to use native sql to set milliseconds > (Better late than never ... I just saw this) You don't have to go directly to n

Re: [web2py] Coding of the future?

2013-02-01 Thread Nick Vargish
elopment environment. Have you tried Eclipse? That thing has more buttons and dials than the space shuttle. Nick -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails f

[web2py] Re: Triggering imports during web2py startup

2013-01-16 Thread nick name
You can have web2py's internal cron do that for you with the @reboot instruction: http://web2py.com/books/default/chapter/29/04#Cron Note that soft cron is turned off by default with wsgi. --

[web2py] SoapClient method times out when called with a variable

2013-01-10 Thread Nick Vargish
lues used in the call, and TallyNumber is always reported as a valid string. The values in the log messages that indicate success look exactly the same as the values in the log messages that indicate a failure. How do I get TallyNumber into some kind of form that will not cause the call to timeout? Any clues would be very much appreciated... Thanks! Nick --

[web2py] Documentation bug, mail attachment initializer

2012-12-18 Thread Nick Vargish
. Someone might want to update the documentation to reflect the correct case. Many thanks to Massimo and other contributors... Web2py has been an excellent tool for building our in-house applications. Nick --

[web2py] utf8 encoding trick for IE8 and earlier

2012-10-24 Thread nick name
Interesting post in http://programmers.stackexchange.com/questions/168751/is-the-use-of-utf8-preferable-to-utf8-true , referenced from http://news.ycombinator.com/item?id=4668373 - I didn't know that! tl;dr: It's helpful to add a hidden form variable “utf8=✓” to forms, to force older IE to us

[web2py] Ajax Live Search Issue

2012-09-11 Thread Nick
I used this slice: http://www.web2pyslices.com/slice/show/1378/ajax-live-search-auto-complete to do a search on one of my databases. My question is how to pass that value back to my app. For instance, I have a list of data that I show to the user: controllers: def index(): example_list = [

[web2py] Re: Best way to insert 200k records?

2012-08-17 Thread nick name
On Friday, August 17, 2012 8:29:12 AM UTC-4, Mike Girard wrote: > > The data will be coming from a large XML file, so my script will parse > that and make inserts into several different tables. It's fairly > straightforward. > > So is it correct to say that - > > 1. There is no compelling reason

[web2py] Re: [web2py-dev] Asyncronous Application Sync

2012-07-12 Thread nick name
On Wednesday, July 11, 2012 6:26:00 PM UTC-4, Massimo Di Pierro wrote: > > I am planning to improve this functionality but it would help to know if > it works for you as it is and what problems you encounter with it. > I originally used the "export-to-csv", but a few months ago, I switched to j

[web2py] Re: Best practice using scheduler as a task queue?

2012-07-05 Thread nick name
This might have been solved in this week, but in case it wasn't: You're tackling a general database problem, not a specific task queue or web2py problem. So you need to solve it with the database: set up another table to refer to you the task table, such as: db.define_table('tasks_that_were_set

[web2py] Re: Audit for all tables, independent of CRUD; and transaction rollback.

2012-07-05 Thread nick name
> > and mytable will have a mytable_archive that works as Nick suggested. > Indeed, it works beautifully, and is much simpler (and much more general) than my monkeypatching solution. Thanks, Massimo!

[web2py] Re: Standalone DAL leaves mysql connections opened

2012-07-05 Thread nick name
On Thursday, June 28, 2012 10:47:15 AM UTC-4, Massimo Di Pierro wrote: > > why not simply? > > db.commit() > db.close() > > if db in an on object attribute like self.db you can do > > if self.db: >self.db.commit() >self.db.close() >self.db = 0 > > you can also do: > > BaseAdapter.close_

Re: [web2py] DAL performance vs executesql

2012-07-05 Thread nick name
On Friday, June 22, 2012 11:37:10 AM UTC-4, Anthony wrote: > Maybe it would be possible to convert the results of executesql() to a > pseudo-Rows object (without all the processing of each individual field > value) so it could be used with the grid, etc. > The original ticket that prompted addi

[web2py] Re: Rocket server truncating long responses

2012-07-05 Thread nick name
On Tuesday, June 26, 2012 3:43:16 PM UTC-4, Massimo Di Pierro wrote: > > If you can reproduce. Chould you try wireshark to do a packet capture? I > would like to see what is going on. > Tim is a new dad and has not been responsive. I will try an attempt to fix > this myself (although I cannot rep

[web2py] Re: Remote admin of sqlite - through ssh

2012-06-10 Thread nick name
On Sunday, June 10, 2012 6:18:26 AM UTC-4, wdtatenh wrote: > > Unfortunately, the update didn't occur (was not a schema change) - simple > insert to auth_membership table. Could see change when using local > cmd/python shell. Wasn't visible when I check using appadamin. > > sqlite is fine in

[web2py] Which checker (PyChecker, Lint, PyFlakes, ...?) is good for using with web2py projects, and how?

2012-06-07 Thread nick name
What works? What doesn't work? What are the pitfalls? Do you need to write any "if 0: import ..." statements to make it recognize the functions? Thanks in advance.

Re: [web2py] Development Environments vs Live Environment

2012-05-24 Thread nick name
On Thursday, May 24, 2012 2:22:50 PM UTC-4, Cliff Kachinske wrote: > > If your development environment is Linux, you can set and read an > environment variable to take care of this. > > As sudo or su, add the following line to /etc/environment: > W2PYENV="dev" > > Python only loads the environme

[web2py] Re: What to expect in web2py 2.0

2012-05-20 Thread nick name
On Saturday, May 19, 2012 4:10:13 PM UTC-4, Massimo Di Pierro wrote: > > Basically the same features we have in trunk now. Just lots of bug fixes > compared to latest table. > We will also have full versining, geo api in db, possibly better support > for mongodb and sybase, and a new welcome app

[web2py] Possible problem with cron using python 2.7.3 and Ubuntu 12.04

2012-05-07 Thread Nick Noel
more, I find that each time a cronjob is scheduled to kick off I get the same error. This seems to prevent the job from starting up. A little research led me to the following Python bug report: http://bugs.python.org/issue14308 Has anyone else experienced this? Thanks, --Nick

[web2py] Re: Copying Date From Sqlite to a Mysql database

2012-05-01 Thread nick name
On Tuesday, May 1, 2012 3:11:19 AM UTC-4, Hassan Alnatour wrote: > > How Can i copy all the records and tables in my sqlite database to a mysql > database ? > Web2py comes with a tool called "cpdb" (under scripts/) that does exactly that, and more. run with "--help" to get complete explanation.

[web2py] Re: Using _before_insert to implement subsecond precision?

2012-04-25 Thread nick name
On Tuesday, April 24, 2012 9:24:34 AM UTC-4, Massimo Di Pierro wrote: > > I think this belongs to the validator. If the validator has already > removed the subseconds you are in no luck. > If it works for you, I do not see a problem. Anyway, remember that this > API is experimental. They will sta

[web2py] Re: Using _before_insert to implement subsecond precision?

2012-04-24 Thread nick name
Bump. Anyone know the answer? On Wednesday, April 18, 2012 4:02:37 PM UTC-4, nick name wrote: > > A question I keep bugging (and submitting patches about) is the > implementation of subsecond precision in the database. With the new code, I > believe it is as simple as do

[web2py] Re: trouble with background queue

2012-04-23 Thread nick name
On Sunday, April 22, 2012 10:47:04 PM UTC-4, weheh wrote: > This works fine with sqlite. But postgres and mysql don't work. The > problem is when I launch the queue on postgres or mysql, as per above (with > or without the -N argument), the db().select(...) doesn't see anything in > the db.inpu

Re: [web2py] Memory leak in standalone DAL (issue #731), can you please help test?

2012-04-20 Thread nick name
On Thursday, April 19, 2012 7:08:06 PM UTC-4, Ricardo Pedroso wrote: > I post a comment on this issue: > http://code.google.com/p/web2py/issues/detail?id=731#c4 > > I think this is not a bug but an incorrect use of the dal api. > Ricardo, thanks! That is indeed the problem. Whether or not it is a

[web2py] Re: Memory leak in standalone DAL (issue #731), can you please help test?

2012-04-19 Thread nick name
On Wednesday, April 18, 2012 10:26:32 PM UTC-4, Massimo Di Pierro wrote: > > In order to isolate the problem, let's check if this is a sqlite:memory > issue. Can you reproduce the problem with sqlite://storage.db ? > Yes, same result exactly. Note that the 'storage.db' is empty, but I'm seeing t

[web2py] Re: Postgres expers -- interesting design issue

2012-04-19 Thread nick name
I don't understand what you are trying to achieve, but whatever it is, you are doing it wrong; your model should be: db.define_table('A', Field('name')) db.define_table('B', Field('name'), Field('id_from_table_a', 'reference A')) # alternatively: # db.define_table('B', Field('name'), Field('id_f

[web2py] Memory leak in standalone DAL (issue #731), can you please help test?

2012-04-18 Thread nick name
I can reproduce this problem on both Linux and Windows (have no access to a Mac), and Massimo cannot reproduce this on his Mac. Perhaps something is borked about all my python installations (some site-packages I use or something). Can you help test? Just go into the web2py directory, and start

[web2py] Using _before_insert to implement subsecond precision?

2012-04-18 Thread nick name
I was away for two weeks and finally caught up with the git updates and the mailing list; what a pleasant surprise! The before/after infrastructure is a joy. It is simple and elegant, much faster and more effective than the monkeypatching I submitted, AND with auditing implemented on top of it.

[web2py] Re: Downloaded file size differs from the original file size.

2012-04-12 Thread nick name
On Wednesday, April 11, 2012 5:56:22 AM UTC-4, Changju wrote: > > I put a file on the static folder, let say 'testApp/static'. > And I download the file on static folder, the downloaded file differs from > the original file in size. > Original file size is 15,227,904 and 15,096,832 for downloaded

[web2py] CSRF protection - off by default?

2012-03-30 Thread nick name
I was intrigued by this discussion: http://news.ycombinator.com/item?id=3778158 about CSRF. Do I understand correctly that the FORM / SQLFORM CSRF protection only works when you pass a session (which is by default None)? If so, I think it is important to update the book to caution everyone to

[web2py] Re: data source configuration

2012-03-30 Thread nick name
The database connection is initialized in models/db.py (assuming you used the wizard to generate your application). Look for the line that says "db=DAL(...)", and make it select the right database according to your request, e.g. request.host, or however else you determine the configuration envi

[web2py] Re: New HackerNews discussion about python frameworks - web2py is not getting enough love

2012-03-28 Thread nick name
On Wednesday, March 28, 2012 10:13:52 AM UTC-4, Richard Penman wrote: > > "the smartest web hackers I know universally regard web2py as a > fundamentally incorrect way to approach web development—but usually say so > in far more colorful terms." I just went and re-read the original threads (fro

[web2py] New HackerNews discussion about python frameworks - web2py is not getting enough love

2012-03-28 Thread nick name
Come say the good things you have to say about web2py on http://news.ycombinator.com/item?id=3765610

[web2py] Re: sqlite to postgres

2012-03-27 Thread nick name
On Tuesday, March 27, 2012 11:26:17 AM UTC-4, Marco Tulio wrote: > > How do I get the data that was on my app (on the sqlite database). Web2py comes with scripts/cpdb.py, which copies databases from one connection string to another with lots of other goodies. see http://web2py.com/books/defaul

[web2py] Re: missing FROM-clause entry

2012-03-23 Thread nick name
On Friday, March 23, 2012 10:09:07 PM UTC-4, Limedrop wrote: > > Thanks for the information. Unfortunately, in my case I really do > need to store the raw query in the session...and then convert it back > to a Query so I can then add a few more filters before the final > select(). Has anyone ma

[web2py] Re: missing FROM-clause entry

2012-03-23 Thread nick name
On Friday, March 23, 2012 6:09:30 PM UTC-4, Anthony wrote: > > There is also an .as_list() method, which converts to a list of > dictionaries rather than a dictionary of dictionaries. You can also just > store Rows objects directly in the session or cache -- the DAL defines a > reduction functi

[web2py] Re: DAL / connection pool leaking objects?

2012-03-23 Thread nick name
Probably a bug in DAL (at least for standalone use, but I suspect also when used in web2py). A test case that easily reproduces this behavior can be found in Issue 731 : Standalone DAL is leaking memory+resources (don't know whether or not i

Re: [web2py] DAL / connection pool leaking objects?

2012-03-23 Thread nick name
On Friday, March 23, 2012 10:21:07 AM UTC-4, Richard wrote: > > Why are you doing that? > > Richard > A legacy system, which has stand-alone appservers+databases in geographically distributed locations, with intermittent and low bandwidth connections (think mobile GPRS modems for the kind and q

[web2py] DAL / connection pool leaking objects?

2012-03-22 Thread nick name
In one of my management scripts (which runs continuously, after setting up a web2py environment), I copy a complete sqlite database directory from another server (copied_db.sqlite, and *.table), open them with "DAL('sqlite://copiedfile.sqlite', auto_import=True, path='/tmp/copy_path)". I copy t

[web2py] Re: Database auditing - comments please

2012-03-20 Thread nick name
On Tuesday, March 20, 2012 2:30:08 PM UTC-4, Rick Ree wrote: > > In case anyone else is using this, I found that 1.99.7 requires a change > at line 78: > > #rows = self.select(query, ['id'], {}) > rows = self.select(query, [table['id']], {}) > Please note that there is a ticket tracking t

Re: [web2py] Database trigger like django save ?

2012-03-10 Thread nick name
Le vendredi 9 mars 2012 23:48:30 UTC+1, rochacbruno a écrit : > > To do what Django does we need to have some "hooks' for that 3 events >> (dbset.insert, dbsert.update and Row.update_record) >> >> I can see that if you extend DAL it is possible to redefine via monkey >> patching the .insert metho

Re: [web2py] Re: DAL speed - an idea

2012-03-09 Thread nick name
On Friday, March 9, 2012 2:18:58 PM UTC-5, viniciusban wrote: > > Anthony, I'm not supposed to retrieve tens os thousands records from a > single query in a web app It's all a question of what each layer is doing. Let's say you have a database with 100,000 records. You need a summary: select su

[web2py] Re: DAL speed - an idea

2012-03-09 Thread nick name
On Friday, March 9, 2012 1:48:06 PM UTC-5, spiffytech wrote: > > Before we add special features to the DAL, has anyone profiled the DAL > with queries and data similar to nick name's to see if there's any > low-hanging fruit we can tackle to speed up the normal select()?

[web2py] Three suggestion tickets opened, please review and comment

2012-03-08 Thread nick name
I have opened 3 suggestion tickets on the tracker at http://code.google.com/p/web2py/issues/list Issue 701 : Suggestion: lightweight DAL select processing - x10 to x100 speedup with large query results Issue 702

[web2py] Re: How to display reference field in sqltable?

2012-03-08 Thread nick name
On Thursday, March 8, 2012 8:52:34 PM UTC-5, Edward Shave wrote: > > Many thanks for reply, unfortunately it didn't work in this instance... I > wonder if it is because the table is referencing itself? By coincidence, I noticed the same problem earlier myself and opened ticket #700 http://code.

[web2py] Re: DAL speed - an idea

2012-03-08 Thread nick name
On Friday, February 10, 2012 12:04:59 AM UTC-5, Massimo Di Pierro wrote: > > open a ticket, this can be done. I like the idea of passing a > processor. > Opened in http://code.google.com/p/web2py/issues/detail?id=701 with discussion and a much improved suggestion of how to handle this.

[web2py] hg and git have diverged again

2012-03-08 Thread nick name
As of yesterday, hg has a few files that neither git repo (mdipierro and web2py) does. Surprisingly, the git push run make 9 minutes later, but seems to lag behind the hg. Only in web2py.hg/applications/admin/controllers: webservices.py Only in web2py.hg/applications/admin/views/debug: breakpoin

[web2py] Re: Unable to stream to ios devices

2012-03-05 Thread nick name
On Friday, March 2, 2012 12:43:03 PM UTC-5, Rajesh Subramanian wrote: > > Hello, > First of all, what a beautiful framework web2py is! Thank you! > > I am having issues streaming a video file to ios devices. > The file is not the problem because the same file plays properly on > those devices w

[web2py] Re: New official release, any time soon?

2012-02-21 Thread nick name
Is that going to be 2.0? IMO, the rocket download problem which AFAIK has not yet been fixed is a blocker for 2.0 Also, IIRC, Bruno is working on Bootstrap integration -- which is probably worthy of delaying 2.0 for (Web2py 2: Now with bootstrap!)

[web2py] Re: Hide the Links based on Permission

2012-02-21 Thread nick name
Whichever way you choose, make sure you verify permissions on the server as well -- don't rely on not presenting the link to the client as a form of security.

[web2py] Re: security check in web2py

2012-02-10 Thread nick name
I usually run it with -i 0.0.0.0 , which means it listens simultaneously on 127.x.y.z and on any other address the computer might have. The admin pages are accessible only when coming through localhost (127.0.0.1) or ssl, no need for different processes/ports.

[web2py] Re: Modules: how to access db

2012-02-10 Thread nick name
This solution will lead to a race condition. Do not use it! If you have multiple threads, they might update your commons at the same time and you'll get request from one session, and session from another, and db from a third. "current" is a thread-local thing, guaranteed not to be touched by an

Re: [web2py] DAL speed - an idea

2012-02-10 Thread nick name
There's a tree structure among the record, upon which the aggregation is computed. Some dbs (e.g. oracle) have extensions for tree-like structures (CONNECT BY etc), but it is not standard, and I need to support both sqlite and postgres in this app.

Re: [web2py] DAL speed - an idea

2012-02-09 Thread nick name
Yes, that is the basis of what I am suggesting. There is not currently such a thing; there is something called 'select_raw' implemented in the GoogleDataStore adapter, but not in anything else, and it isn't exactly what I am proposing. To elaborate: Assume the table is defined as follows:

[web2py] DAL speed - an idea

2012-02-09 Thread nick name
One of my controllers need to go through a lot of records to provide a meaningful answer -- as in, 60k records. Just loading them from the database takes about 100ms (db.executesql("select * from table order by id;")); Doing the same through DAL takes over 6 seconds. I realize that the DAL does

[web2py] Table inheritance issues and a possible fix (648, 649, 353)

2012-02-06 Thread nick name
I've run against table inheritance problems (documented in http://code.google.com/p/web2py/issues/detail?id=649 and http://code.google.com/p/web2py/issues/detail?id=648) and others have too (http://code.google.com/p/web2py/issues/detail?id=353). Patches are provided with specific solutions. Ho

[web2py] Re: DAL patch to support fractional seconds

2012-02-05 Thread nick name
I tried to maintain backward compatibility in the best way possible - by keeping the old code in place if you don't need higher resolution. (Note, however, that there's a place in DAL where time() retains microseconds, and datetime does not, which was probably a bug -- in that case, I fixed it

[web2py] DAL patch to support fractional seconds

2012-02-04 Thread nick name
I've posted a patch for DAL that adds support for fractional seconds; the existing dal just silently truncates fractional seconds both when storing to the database and selecting from the database. http://code.google.com/p/web2py/issues/detail?id=542 While I don't think it's ready for prime time

[web2py] Make all migrations explicit, and know when they are needed?

2012-02-03 Thread nick name
I run my app with migrate=migrate_enabled=False, because when migrations _are_ needed, they are nontrivial, and the default logic is never what I want. I would like to have some "migration needed" response from the database, so that when a user of the app runs a new version of the app on an old

[web2py] Re: Default controller function

2012-02-01 Thread nick name
Working with unsanitized input like this might be dangerous. http://localhost/content/../../../etc/passwd

[web2py] Re: Chunked downloads and corrupt files with Internet Explorer 8 (IE8)

2012-01-31 Thread nick name
On Tuesday, January 31, 2012 9:37:54 AM UTC-5, Massimo Di Pierro wrote: > > In trunk socket timeout is 60 and this resulted in another problem. > Ctrl-C waits for 60 seconds before joining the worker processes. > Perhaps we should increate socket-timeout, catch Ctrl+C and then kill > the process

Re: [web2py] Re: Nginx + uwsgi file download problem

2012-01-31 Thread nick name
No, the thread started with Ie8 being suspects, but at least from my experiments it is a problem in Rocket which can be triggered with any browser or even without a browser (e.g. wget/curl instead of a browser) See e.g. https://github.com/explorigin/Rocket/issues/1#issuecomment-3734231 The reas

[web2py] Re: Nginx + uwsgi file download problem

2012-01-30 Thread nick name
Almost surely the same problem discussed in this thread: https://groups.google.com/d/msg/web2py/1_b63bhBeQs/sYFbXNJL8D4J

Re: [web2py] Re: Chunked downloads and corrupt files with Internet Explorer 8 (IE8)

2012-01-30 Thread nick name
On Saturday, January 28, 2012 10:22:58 AM UTC-5, Phyo Arkar wrote: > > its 2.7 as all my servers are (distro default) > Sorry for the confusion. This is true for every version down to at least 2.3 and up to 2.7; At the time I posted, I wrote 2.6 because that was the only one I verified and did n

[web2py] Re: Chunked downloads and corrupt files with Internet Explorer 8 (IE8)

2012-01-30 Thread nick name
Ok, the culprit is definitely ignoring exceptions raised in sendall. In my humble opinion this is serious enough to be on the 2.0 blocker list. How to reproduce: you have to have a wsgi worker, that produces output in parts (that is, returns a list or yields part as a generator). e.g: use we

[web2py] Re: Chunked downloads and corrupt files with Internet Explorer 8 (IE8)

2012-01-27 Thread nick name
I posted https://github.com/explorigin/Rocket/issues/1#issuecomment-3648126- I suspect it is an interplay between timeouts and sendall(), though I can't really prove it (and I can't reliably reproduce this either right now). Also some characterization about when this happens to me (slow links,

[web2py] Re: Chunked downloads and corrupt files with Internet Explorer 8 (IE8)

2012-01-25 Thread nick name
I posted https://github.com/explorigin/Rocket/issues/1#issuecomment-3648126 - I suspect it is an interplay between timeouts and sendall(), though I can't really prove it (and I can't reliably reproduce this either right now). Also some characterization about when this happens to me (slow links,

[web2py] Using powertable plugin emits deprecation warning for me -- is it just me?

2011-12-27 Thread nick name
I suspect not, I've filed bug 581 ( http://code.google.com/p/web2py/issues/detail?id=581 ) But I haven't seen any other reports of this. Am I doing something wrong?

[web2py] Re: bulk_insert

2011-12-15 Thread nick name
bulk insert is not really bulk except on GAE, although it might potentially be in the future. The non GAE implementation at this point is: def bulk_insert(self, table, items): return [self.insert(table,item) for item in items] No database seems to override it.

[web2py] Re: WARNING:web2py.cron:WEB2PY CRON: Disabled because no file locking still showing up

2011-12-15 Thread nick name
Are you sure you got the right win32? e.g. it needs to match the Python version number (2.6) and bit width (32? 64?) of your interpreter. If you start Python independently, can you "import win32con" without error?

[web2py] Re: web2py 1.99.3 is OUT

2011-12-09 Thread nick name
I just pulled git and hg and there's a small difference (that was also already there a few days ago): Only in web2py.hg/applications/examples/static/js: modernizr-1.6.min.js Only in web2py.hg/applications: __init__.py Only in web2py.hg/applications/welcome/models: db.py.orig Only in web2py.gi

[web2py] Re: Factoid: How to reset id field in Postgres tables

2011-12-08 Thread nick name
Interesting. DAL has specific reset code for MS SQL and SQLite, but not for postgresql (or any of the other databases, it seems)

[web2py] foreign key reference and "not null" mutually exclusive. by design, or a bug?

2011-12-08 Thread nick name
I want to have a non-null foreign key reference, e.g. owner = db.define_table('owner'', Field('name')) package = db.define_table('package', Field('owner_id', owner, notnull=True), Field('name')) SQLite for example has no problem with this: sqlite> create table owner(id int primary key, name tex

[web2py] "user" tickets vs. "system" exception tickets?

2011-11-30 Thread nick name
Currently, there are two ways exceptions are handled in web2py: If the controller/view does *NOT* use try: except:, and an exception is raised, then it is very helpfully logged in the ticket system, and a somewhat-useful message (that can be customized a little, see e.g.

[web2py] Re: Help with socket timeout error

2011-11-30 Thread nick name
A possibly related (and possibly unrelated) data point: I've always been running from source. Occasionally, when I try to read request.body I get a socket timeout, even though exactly zero seconds have passed, and the timeout is set at 60 seconds. Running the same request again (it's programati

[web2py] Re: DAL caching values automatically?

2011-11-16 Thread nick name
Does your cron program run continuously? what database are you using? If you are using a database that supports mvcc (Oracle, Postgres, MySQL with InnoDB tables, possibly others), your first select (of any kind, not just this query) logically freezes the state of the database, and you will not

[web2py] datetime handling in web2py

2011-11-16 Thread nick name
I keep getting burned by how web2py handles datetimes; specifically, my project requires millisecond precision of timestamps. The two databases I care about support it, pgsql has microsecond resolution and sqlite is agnostic (pysqlite3 specifically supports microseconds). MySQL and Oracle, howe

[web2py] Re: Problem with 'unique' in DAL and validators

2011-11-14 Thread nick name
add "requires=[]" on the unique field to disable the vaidation, if you need the validate_and_update for any of the other fields. The database itself should validate it for you (you'll get an sql error, rather than a web2py error). In your first case, just dropping the "name='') from the update w

[web2py] Re: Bug in included table, or am I using this incorrectly?

2011-10-13 Thread nick name
I would classify this as a bug, or at least warranting mention in the documentation - it causes the appadmin to break for the including tables, which is very confusing. This is specifically for the "unique=True", whose validator is "IS_NOT_IN_DB()". Perhaps a better solution would be a "UNIQUE(

[web2py] Bug in included table, or am I using this incorrectly?

2011-10-12 Thread nick name
Note: tested on 1.97.1; I believe problem (or my misunderstanding) is still on trunk. I tried to check with trunk, but I have some compatibility problems to solve first - I will post an update when I have solved them. I have an included table defined like this: included = db.Table('included',

  1   2   >