[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:33957] new web2py book in the works?

2009-10-28 Thread Nick
uying/ printing this book only to see a new version in another 6 months? Thanks, -nick --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to w

[web2py:33964] Re: new web2py book in the works?

2009-10-28 Thread Nick
gt; > http://he-cda.wiley.com/WileyCDA/Section/id-321954.html > > but somehow Amazon did not pick that up. I have been complaining with > the publisher for one month. > > Massimo > > On Oct 28, 1:06 pm, Nick wrote: > > > Hello All, > > >  I'm a fan of

[web2py:33989] Re: new web2py book in the works?

2009-10-28 Thread Nick
it struck me as something worth bringing up. Love the framework! :) -Nick On Oct 28, 8:43 pm, mdipierro wrote: > There is a second edition on lulu: > > http://www.lulu.com/content/4968879 > > There will be a 3rd ed but not too soon. > > massimo > > On Oct 28, 2:10 pm, Nick

[web2py:34004] Re: new web2py book in the works?

2009-10-28 Thread Nick
That's great! I didn't know this. How do I get the free copy? I purchased the original from lulu.com, I just tried logging in and ordering the second edition, but it still wants me to pay to get it. Thanks for any help! -Nick On Oct 28, 11:24 pm, Richard wrote: > yep I can confi

[web2py:34121] web2py book, correction

2009-10-29 Thread Nick
r the image post). hope this helps! -Nick --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group

[web2py:34123] Re: web2py book, correction

2009-10-29 Thread Nick
Ah, looks like it's already been caught. :) I'll remember that errata if I see anything else though. Cheers, Nick On Oct 30, 12:30 am, mdipierro wrote: > Thank you Nick. Would you mind adding it here? > > http://wiki.web2py.com/Errata_for_web2py_2nd_Edition_Book &

[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: 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] 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: 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] 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] "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] 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] 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] 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: 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: 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] 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: 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] 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-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

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: 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: 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: 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

[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] 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] 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] 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] 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] 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

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:

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.

[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

[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: 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: 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: 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] 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: 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] 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] 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: 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()?

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

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

[web2py] Use the ORM for a robot?

2011-06-29 Thread Nick Arnett
at isn't coming from a request - or give me an idea of the right way to organize it into the Web2Py structure? Thanks in advance. Nick

Re: [web2py] SQL UNIQUE IN WEB2PY : CONSTRAINT unique_test UNIQUE (num_part1, num_part2, num_part3, title)

2011-06-30 Thread Nick Arnett
t quite sure what you're trying to do here. > > I think what he wants is the equivalent of Django's "unique together", which I'm also trying to figure out. IS_NOT_IN_DB seems to accomplish it, but is that going to create a unique index on the combined fields? Otherwise, it will be expensive to do inserts. Nick

Re: [web2py] SQL UNIQUE IN WEB2PY : CONSTRAINT unique_test UNIQUE (num_part1, num_part2, num_part3, title)

2011-06-30 Thread Nick Arnett
On Thu, Jun 30, 2011 at 6:43 PM, Nick Arnett wrote: > > > On Thu, Jun 30, 2011 at 4:15 PM, Anthony wrote: > >> IS_NOT_IN_DB does take a DAL Set object as the first argument, so you can >> limit the records checked to a particular set within the table (see >>

Re: [web2py] SQL UNIQUE IN WEB2PY : CONSTRAINT unique_test UNIQUE (num_part1, num_part2, num_part3, title)

2011-06-30 Thread Nick Arnett
cs. I guess I will just use that approach to create a multi-column unique index but at this point I was really hoping to avoid raw SQL. Nick

Re: [web2py] SQL UNIQUE IN WEB2PY : CONSTRAINT unique_test UNIQUE (num_part1, num_part2, num_part3, title)

2011-07-02 Thread Nick Arnett
th Django - sqlite throws an error that it cannot create a unique field. However, it seems to work fine with MySQL; it did create a unique index on the column. I wasn't really planning to use sqlite, anyway, just thought I'd keep things simpler at first. I just switched to MySQL now and it's working fine. Thanks for the help. Nick

[web2py] Best practice for inserting possible duplicates?

2011-07-02 Thread Nick Arnett
which does this. I don't see that that even made its way into Web2Py. NIck

Re: [web2py] Re: Best practice for inserting possible duplicates?

2011-07-02 Thread Nick Arnett
e would mention that... was just shortcutting! Nick

Re: [web2py] Re: talks

2011-07-04 Thread Nick Arnett
ver? I should be able to get there, too, and can offer my impression from having just moved from Django to Web2Py! However, I can't figure out what group this is, either. Nick

[web2py] Integrity errors DAL - insert, bulk insert

2011-07-21 Thread nick name
Documenting for others a behaviour I found surprising: Database insert for one record eats integrity errors and returns a None key for the inserted record. It doesn't tell you what the integrity problem is (I guess it is ok for code, because there is no reasonable to describe the integrity prob

[web2py] Database auditing - comments please

2011-07-21 Thread nick name
Attached you'll find my first go at a database audit module for web2py. It will log every change to a table. The crud versioning system is nice, but it only versions stuff that happens on crud. If you insert/modify records not through crud, you'd need to manually update it -- the attached code w

[web2py] Re: Database auditing - comments please

2011-07-25 Thread nick name
Newer version attached, has been tested in one specific app which brought up some issues with tables that have references to them (these have been fixed). Now patches instance instead of class (so web2py's normal reloading works equally well) Massimo / Jonathan - could you comment on the proba

Re: [web2py] send email "on create" a record

2011-07-28 Thread nick name
I have written a simple "audit" system for tables that patches the dal. You can do something similar to send an email on record creation. See this thread: https://groups.google.com/d/msg/web2py/jKpUVyvNHeE/oufbLz_n1GEJ - which did not receive any response so far.

[web2py] request.now is in local time?

2011-08-19 Thread nick name
request.now is in local time, is that on purpose? I think a "request.utcnow" would also be useful (now can be derived from utcnow, but the other way around is not 1:1 on days when daylight saving time changes)

[web2py] Opposite of "required..." for field?

2011-08-19 Thread nick name
I have multiple fields in a record that I want to be always generated on insert, never modified on update. Typical use case is a record creation timestamp; a default of request.now is perfect, I don't want anyone to ever override it, and I do want to get an error if accidentally trying to change

[web2py] Re: comparing datetime objects in db query fails

2011-08-19 Thread nick name
This thread might be relevant: https://groups.google.com/d/topic/web2py/1N0TwMOgp3o/discussion If you do use the PARSE_COLTYPES feature, datetimes work perfectly.

Re: [web2py] Opposite of "required..." for field?

2011-08-20 Thread nick name
But that only works for web forms. I want the same for programmatic access. (db.table.insert() call etc)

[web2py] Re: request.now is in local time?

2011-08-20 Thread nick name
using local time puts you in a world of pain when you try to co-ordinate systems. Windows for years couldn't correctly do dst<->utc conversion other than the current year (if rules have changed; which they did in 2004). Not sure if they fixed that in 7 or not. When you stat having services (and

Re: [web2py] request.now is in local time?

2011-08-20 Thread nick name
On Saturday, August 20, 2011 11:19:07 AM UTC-4, Jonathan Lundell wrote: > Yeah, it probably should have been utcnow. Nothing to stop you (or web2py, > for that matter) from setting request.utcnow, though. > Yep, I am already doing that. It may differ by a millisecond or 100 from the original re

[web2py] Re: comparing datetime objects in db query fails

2011-09-01 Thread nick name
If I understand correctly, Massimo was unaware of this option when he originally implemented the DAL for sqlite, and making it default now is not backward compatible.

[web2py] On storing datetime in the database, and textual representation of fields

2011-09-01 Thread nick name
I've just opened issue #404: datetime gets downgraded to 1-sec resolution when inserting to database - example and full details there. And just 90 minutes before that, someone else submitted issue #403

[web2py] Re: On storing datetime in the database, and textual representation of fields

2011-09-02 Thread nick name
psycopg uses a Postgres provided routine to escape the strings, which is aware of what version of postgres is at the other end of the connection (apparently since library shipped with 8.1.4, if I can read the source correctly): Link to relevant psycopg file is here

[web2py] Re: comparing datetime objects in db query fails

2011-09-02 Thread nick name
Two patches that solve this in different ways (both against trunk, but would probably apply cleanly to any recent version): 1 - patch to welcome application diff -r 1462bcd5ea7a applications/welcome/models/db.py --- a/applications/welcome/models/db.pyFri Sep 02 20:41:54 2011 -0500 +++ b/appl

[web2py] Re: preparing for 1.99.1

2011-09-13 Thread nick name
The 'detect_types" patchfor sqlite has not been applied (not sure if you were planning to or not)

[web2py] Re: comparing datetime objects in db query fails

2011-09-13 Thread nick name
by default, the sqlite driver will return everything as a string, regardless of what the real type of the field is -- because sqlite actually stores everything as a string (as the original poster describes here https://groups.google.com/d/msg/web2py/5ABy8XH4ujU/6xtq0xQB8nEJ ; ). I can't find my

[web2py] Re: comparing datetime objects in db query fails

2011-09-13 Thread nick name
Oh, and regarding backward compatibility - it will break anything that was expecting a string returned from selecting a date or timestamp field. Such code wouldn't work on other databases.

[web2py] Re: comparing datetime objects in db query fails

2011-09-13 Thread nick name
Ok, so I've just spent an hour trying to recreate the old problems I have (without the PARSE_DECLTYPES), and I am unable to. I know for sure that I was occasionally getting strings back when I expected a datetime() object, because I had a test in the code that would report that, and it stopped

[web2py] Re: comparing datetime objects in db query fails

2011-09-14 Thread nick name
Yes. I'm saying I can't find my test case that was failing without it (although I'm still trying to recreate one). > I thought this was a performance issue as well as db(...).select() returns parsed types and it is best if the driver does it as opposed if web2py does it. It probably is bette

[web2py] Re: History tables how?

2011-09-14 Thread nick name
Temporary solution: http://code.google.com/p/web2py/issues/detail?id=354 ; todor's version is better than mine (also see my comment #4 in that thread) Haven't yet tested it with 1.99 dal, but it should work as it is not very dependent on implementation details.

[web2py] web2py/DAL support for "increasing number"?

2011-09-20 Thread nick name
I need to have a number that generally increases with every request made to the service. The only requirement is that it is strictly monotonous - I don't need a specific start, and I don't care if there are any holes. Possible solutions: - just use request.utcnow -- seems to satisfy, but I've

Re: [web2py] web2py/DAL support for "increasing number"?

2011-09-21 Thread nick name
Using request.now is _guaranteeed_ to go backwards once a year in most of the world (when going back from daylight saving time to standard time; the date this happens differs between countries). request.utcnow, which I mentioned in my original post (and appears in the readme, but for some reaso

[web2py] Re: Are we ready to launch 1.99.1?

2011-09-21 Thread nick name
I've just done an hg pull -u: changeset: 2435:8cbfa1244549 tag: tip user:mdipierro@massimo-di-pierros-macbook-2.local date:Wed Sep 21 00:17:23 2011 -0500 summary: sys.exit(0), thanks Praneeth The "README" file mentions request.utcnow, but the code doesn't. So either

[web2py] Re: problem changing version 1.95.1 to version 1.98.2

2011-09-21 Thread nick name
As this issue keeps popping up every week, how about a mechanism to cope with this kind of change in the future: In the wizard generated code, add a first line that calls UpdatedForWeb2PyVersion('1.97.1', true) (Where the 1.97.1 is the version that the wizard was run in, and 'true' means rai

Re: [web2py] web2py/DAL support for "increasing number"?

2011-09-21 Thread nick name
I hate these kind of hacks. In this case, a good solution (because of bandwidth and everything) would be: "give me all the updates since 1 hour _before_ what I think is the most up-to-date update)", and that would cover clocks going backwards up to 1 hour. And the cost would be in bandwidth,

Re: [web2py] web2py/DAL support for "increasing number"?

2011-09-21 Thread nick name
> the key fact is not request.now, or request.utcnow but the fact that you can define your table to update these fields automatically so you can forget about them Thank you for your thoughtful answer, but that wasn't what I was asking (apologize for the misunderstanding), and if you actually re

[web2py] Re: online book

2011-09-21 Thread nick name
This is quite amazing. Thanks to everyone involved for the great work, and especially Massimo for masterfully co-ordinating everything without breaking backward compatibility Small remark: (posted it in another thread, but repeating here in case it was not visible enough) request.utcnow is men

Re: [web2py] web2py/DAL support for "increasing number"?

2011-09-21 Thread nick name
time.time or datetime.datetime.utcnow() both give you a number that is independent of timezone (and datetime.utcnow() is supposed to be available as request.utcnow, although that still isn't the case). However, as I pointed out, there is still a chance that this can go backwards in time on a pr

[web2py] Re: problem changing version 1.95.1 to version 1.98.2

2011-09-21 Thread nick name
Python does, in a way ... if you use a depcreated feature, you get a deprecation warning when running the code. And, the purpose of such a change is to optimize support/googlegroup traffic -- this specific issue comes up every single week since it was introduced.

[web2py] Re: web2py/DAL support for "increasing number"?

2011-09-21 Thread nick name
That actually makes a lot more sense than my dumb idea And seems to be the way to go. Yes, I keep a "update number" field on each record, which is essential to track which records changed since the last check (you could have a "changed" bit instead, which is reset on sync -- but that makes

[web2py] Re: Are we ready to launch 1.99.1?

2011-09-21 Thread nick name
On Wednesday, September 21, 2011 4:16:07 PM UTC-4, guruyaya wrote: > > This is what I got. No fix, for now. > Say you have a datetime field. The database adapter will save it as a > TIMESTAMP sqlite type. > Now if you decide you just want the date, you don't care for the time. > You change th

[web2py] dal inner join - implemented, but not documented and not tested

2011-09-22 Thread nick name
The book describes how to use the dal left join syntax. Where it talks about inner join, it uses equality test (e.g. db(table1.field1 == table2.field2).select()) However, inside dal.py there is an implementation for an inner join, used like db().select(join=table1.field.on(table2.field)) (i.e.

[web2py] Re: db events trigger

2011-10-12 Thread nick name
Reminder of issue 354: http://code.google.com/p/web2py/issues/detail?id=354 I have never used a select trigger, so I only have vague ideas about how it would be useful. For inserts, a single line is sufficient. For deletes/update, that is not true. You can look at (todor's fixes to) my implem

[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',

[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] Using date/datetime fields with sqlite3, and wcf xml/json clients

2011-02-25 Thread nick name
Hello good people. I've recently started a project using web2py, and I find it extremely well designed. However, within a 2 days of starting, I have already needed to patch it in 3 places, so either I'm doing something wrong, something non-standard, or I should find out what is the preferred wa

[web2py] Re: Using date/datetime fields with sqlite3, and wcf xml/json clients

2011-02-25 Thread nick name
On Feb 25, 6:54 pm, Massimo Di Pierro wrote: > 1) is in trunk... > > db = > DAL(...,driver_options=dict(detect_types=sqlite3.PARSE_DECLTYPES)) > > you can pass named options to all divers now, not just sqlite3. Thanks! Super cool!

[web2py] How do you change xml format of datetime?

2011-02-25 Thread nick name
I am using the xml serializer to print datetime values. I need to put it out in .isoformat() e.g. 2011-12-31T10:20:30 (possibly with a second fraction, but not necessarily). However, I've been unable to find how to do that: db.field.represent = lambda x: x.isoformat() doesn't make a difference (ac

[web2py] Newbie questions

2011-03-16 Thread Nick Rosencrantz
Hi I just deployed my first attempt to try web2py with google app engine (http://matochsovklockan.appspot.com) Basically it works while a few links return "invalid request" eg http://matochsovklockan.appspot.com/examples/default/index Is this an expected result or something that I did wrong? I like

[web2py] Re: How do you change xml format of datetime?

2011-03-25 Thread nick name
(sorry for taking so long to reply, I've been sidetracked by other things.) While trying to prepare a concise example and trace through everything, I was able to figure out the problem - I was using as_list(). Turns out that as_list() has a parameter "datetime_as_str" which defaults to True

[web2py] Re: Using date/datetime fields with sqlite3, and wcf xml/json clients

2011-03-25 Thread nick name
*> 2nd: Talking json to a WCF / .NET client * > My solution here was to modify simplejson so that it also escapes the '/' character, and just return '/Date(...)/' as my date value. This works, and (based on the same reasoning used by MS) is safe for anything. But I don't like it; Is there any si

[web2py] Re: datetime, DAL and JSON serialization

2011-03-29 Thread nick name
This thread might be relevant: https://groups.google.com/d/topic/web2py/1N0TwMOgp3o/discussion - have you started using detect_types? (if not, you should!) This thread might also be relevant: https://groups.google.com/d/topic/web2py/RuBOLSyDc40/discussion - as_list and as_dict (if you use them

[web2py] Bug in populate?

2011-04-01 Thread nick name
I think there's a bug in the populate.py code: when a string field has an IS_IN_SET(['a','b','c','d']) validator, populate will also add a fifth option '' (zero length string). This follows from it reading the field.options set (which includes the zero length string *unless* you set zero=None i

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

2011-05-06 Thread nick name
My use of web2py requires an audit trail for (essentially) all database tables; The preferable way to do that is to keep a "foo_history" table for each table "foo". The records (both audited and original) need to have a "revision" that increments with each update, and "last modified on", "last

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

2011-05-06 Thread nick name
On Friday, May 6, 2011 6:44:18 PM UTC-4, pbreit wrote: > > Check out "auth.signature". It adds and manipulates these columns: > is_active, created_on, created_by, modified_on, modified_by. > Thank you for your answer. This is a good "mix-in" table for the things I need. However, neither signatu

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

2011-05-06 Thread nick name
Thanks for the answer. However, as I mentioned in my original post, the crud's record versioning is not sufficient for my needs.

  1   2   >