Re: [web2py] Disabling few functions for certain users

2010-04-30 Thread Jonathan Lundell
can have an assigned role with permissions. You'll still have to *check* the permissions. -- Thadeus On Fri, Apr 30, 2010 at 9:38 AM, Jonathan Lundell jlund...@pobox.com wrote: On Apr 30, 2010, at 7:22 AM, Thadeus Burgess wrote: You need to store the preferences in the database

Re: [web2py] web2py app on gae / can't upload app

2010-05-02 Thread Jonathan Lundell
On May 2, 2010, at 10:58 AM, Vasile Ermicioi wrote: from this link: http://code.google.com/appengine/docs/whatisgoogleappengine.html An application cannot write to the file system. An app can read files, but only files uploaded with the application code. The app must use the App Engine

Re: [web2py] Re: Houston, Houston, the rocket lost contact!

2010-05-03 Thread Jonathan Lundell
On May 3, 2010, at 9:41 AM, Timothy Farrell wrote: So changing line 86 from ssl = None to ssl = False should take care of it. This pattern is repeated around line 130; that might be why mr freeze didn't see a change.

Re: [web2py] Re: Previous location

2010-05-03 Thread Jonathan Lundell
web2py probably isn't setting referer on a redirect, and if it did, you'd have to interpret the URL. How about putting the previous location in session before you redirect? On Mon, May 3, 2010 at 3:05 PM, Miguel Lopes mig.e.lo...@gmail.com wrote: request.env.http_referer is not working for me.

Re: [web2py] Re: Previous location

2010-05-03 Thread Jonathan Lundell
On Mon, May 3, 2010 at 11:08 PM, Jonathan Lundell jlund...@pobox.com wrote: web2py probably isn't setting referer on a redirect, and if it did, you'd have to interpret the URL. No. If I have no redirect and call a location with no args the referer is not set when I arrive at web2py's

Re: [web2py] Re: global name 'db' is not recognize in a module

2010-05-04 Thread Jonathan Lundell
On May 4, 2010, at 4:26 AM, canna wrote: Thank you for the answer so how would you share functions between controllers easily? without passing global objects to the functions all the time? is the only way is to bundle it all in one class that will be initialized with the 'db' variable? or

Re: [web2py] Re: web2py cheat sheet for a pyday

2010-05-04 Thread Jonathan Lundell
On May 4, 2010, at 11:01 AM, Mariano Reingart wrote: Fixed. I've also * added: db(query).update(field=val) * added: @cache('key', 3600, cache.ram) -removed ('domain') from amfrpc- * modified: T('message') = ‘translation’ * added: “ajax(url,[id1,id2,...],target)” Mariano Reingart

Re: [web2py] Re: web2py cheat sheet for a pyday

2010-05-04 Thread Jonathan Lundell
On May 4, 2010, at 12:47 PM, Mariano Reingart wrote: On Tue, May 4, 2010 at 3:49 PM, Jonathan Lundell jlund...@pobox.com wrote: What does it mean that response has a pointer to request? Maybe because that is more clear than a pointer to db.py, default.py and/or index.html What I'm

Re: [web2py] Re: Different results in console vs. script

2010-05-05 Thread Jonathan Lundell
On May 5, 2010, at 8:59 AM, Thadeus Burgess wrote: I am about to post a unittesting module as part of web2py_utils, it takes out all needed configurations for unittesting and makes it dead simple. Looking forward to it. Consider adding support for coverage; it's pretty easy to call.

Re: [web2py] Re: Different results in console vs. script

2010-05-05 Thread Jonathan Lundell
On May 5, 2010, at 9:13 AM, Thadeus Burgess wrote: It supports nosetests which includes a coverage plugin. I will look into adding the option stand-alone so you do not need nosetests. Nosetests works for me just fine; in fact it's preferable. The problem is that there is no way to

Re: [web2py] Re: Previous location

2010-05-05 Thread Jonathan Lundell
/default/ contact, but I want it to return http://127.0.0.1:8000/contact -- which is the what is displayed in the browser. On May 3, 8:59 pm, Jonathan Lundell jlund...@pobox.com wrote: On Mon, May 3, 2010 at 11:08 PM, Jonathan Lundell jlund...@pobox.com wrote: web2py probably isn't setting

Re: [web2py] Bug and fix about IS_DATE_IN_RANGE()

2010-05-07 Thread Jonathan Lundell
On May 7, 2010, at 9:30 AM, Iceberg wrote: Right now, IS_DATE_IN_RANGE(minimum=foo, maximum=bar) does NOT accept the given minimum nor maximum value. That is not the design intention according to error message. Please get rid off the two equal marks in IS_DATE_IN_RANGE.__call__(). Same

Re: [web2py] Re: Bug and fix about IS_DATE_IN_RANGE()

2010-05-07 Thread Jonathan Lundell
with unit tests. On May 7, 4:26 pm, Jonathan Lundell jlund...@pobox.com wrote: On May 7, 2010, at 9:30 AM, Iceberg wrote: Right now, IS_DATE_IN_RANGE(minimum=foo, maximum=bar) does NOT accept the given minimum nor maximum value. That is not the design intention according to error message. Please

Re: [web2py] Re: Bug and fix about IS_DATE_IN_RANGE()

2010-05-08 Thread Jonathan Lundell
each. we should have more tests in gluon/tests we have none, only doctests for validators. On May 7, 4:26 pm, Jonathan Lundell jlund...@pobox.com wrote: On May 7, 2010, at 9:30 AM, Iceberg wrote: Right now, IS_DATE_IN_RANGE(minimum=foo, maximum=bar) does NOT accept the given minimum nor

Re: [web2py] Problem with IS_URL

2010-05-12 Thread Jonathan Lundell
On May 12, 2010, at 6:09 AM, Sverre wrote: I have a field in DB to store URLs. But for the user this is optional. So the user should put in nothing or a URL. But if I use IS_URL in the database specification this field is demands always an URL. Is there a solution? IS_EMPTY_OR(IS_URL())

Re: [web2py] Re: Idea: Appliance remote management

2010-05-13 Thread Jonathan Lundell
On May 13, 2010, at 9:26 AM, Thadeus Burgess wrote: This is similar to how PluginCentral will be designed, if we ever get that spec finalised =) It'd be reasonable to do both at the same site. -- Thadeus On Thu, May 13, 2010 at 11:14 AM, blackthorne francisco@gmail.com

Re: [web2py] Re: Problem with IS_URL

2010-05-13 Thread Jonathan Lundell
On May 13, 2010, at 1:01 PM, weheh wrote: @mdp: thanks for the clarification. I like having 1 way of doing things, which is why I dumped perl years ago. Perhaps IS_NULL_OR should be officially deprecated? Is there a place for that? It'd be nice to be able to look that up. Maybe an appendix

Re: [web2py] Re: Problem with IS_URL

2010-05-13 Thread Jonathan Lundell
to be desired. Here's a current example: IS_EMPTY_OR dummy class for testing IS_EMPTY_OR IS_NULL_OR dummy class for testing IS_EMPTY_OR Now that's helpful. My point with the book is that the information is already there, but scattered and hard to find. On May 13, 3:22 pm, Jonathan

Re: [web2py] Re: Do you use web2py in your company?

2010-05-14 Thread Jonathan Lundell
On May 14, 2010, at 4:41 PM, mdipierro wrote: *www.tenthrow.com is all webpy with cherokee and postgres. (I was puzzling over ten throw until I visited the site) We vpeptech.com use web2py in a server management application. There's a small local table for server ID and credentials, but

Re: [web2py] Re: When and how to use command line option -f FOLDER?

2010-05-14 Thread Jonathan Lundell
On May 14, 2010, at 11:27 AM, Iceberg wrote: Turns out that the fix [1] is not completed. Most apps work when using web2py -f another_web2py_folder, but not those contains local_import('my_module', app='my_app'). Should be easy to fix, but I even tried to add following lines at line 706 of

Re: [web2py] Re: When and how to use command line option -f FOLDER?

2010-05-15 Thread Jonathan Lundell
On May 15, 2010, at 12:46 AM, Iceberg wrote: Mysteriously, using sys.path.insert(...) rather than sys.path.append(...) does help. But I just don't understand. I used to think that the build-in import statement always goes through all folders inside sys.path, one by one, so in theory it does

Re: [web2py] web2py 1.78.2

2010-05-16 Thread Jonathan Lundell
On May 16, 2010, at 9:35 PM, mdipierro wrote: We found some problems in 1.78.1 and errors in views will not display correctly in tickets thus causing problems. We have a temporary fix in 1.78.2 but it will still not correctly report correctly report errors in the new {{block}} feature. We are

Re: [web2py] Re: web2py 1.78.2

2010-05-17 Thread Jonathan Lundell
On May 16, 2010, at 10:49 PM, mdipierro wrote: I just did it. I think. Yes, I see it now. On May 17, 12:36 am, Jonathan Lundell jlund...@pobox.com wrote: On May 16, 2010, at 9:35 PM, mdipierro wrote: We found some problems in 1.78.1 and errors in views will not display correctly

Re: [web2py] Re: web2py 1.78.2

2010-05-17 Thread Jonathan Lundell
On May 17, 2010, at 7:53 AM, Thadeus Burgess wrote: You cannot have random = signs in your view. The syntax is {{python code here}} {{=python variable here}} You MUST declare {{= with no space in between. the bracket and equal sign. Alternatively (correct me if I'm wrong), replace,

Re: [web2py] Password too strong

2010-05-18 Thread Jonathan Lundell
On May 18, 2010, at 6:31 AM, Jason Brower wrote: tried logging in with the auth system and it's very much way flipping too strong. How to I take such a password picky beast? There are people that don't even know all those symbols on the keyboard. Well, it's not requiring *all* the symbols;

Re: [web2py] google fonts

2010-05-20 Thread Jonathan Lundell
On May 20, 2010, at 5:51 AM, Albert Abril wrote: Woow! Nice. As said in the FAQ: All the fonts in the Google Font Directory are licensed under open source licenses that let you use them on any website ...as long as it's being viewed with a browser that supports @font-face... On Thu,

Re: [web2py] Re: Email perfect regex

2010-05-30 Thread Jonathan Lundell
On May 29, 2010, at 9:39 PM, mdipierro wrote: The one your propose fails two of our tests: Failed example: IS_EMAIL()('a...@d_-f.us') Expected: ('a...@d_-f.us', None) Got: ('a...@d_-f.us', 'enter a valid email address') Underscores are not allowed, but we accept them because

Re: [web2py] Re: Best CSS framework for web2py

2010-06-09 Thread Jonathan Lundell
On Jun 9, 2010, at 5:54 AM, Pepe wrote: Hello, ez-css is great for layout, I'm using it. for typography, you could use the typography.css of blueprint. That's what I'm doing. I started out with blueprint, but switched my layout to ez-css to get a variable-width section. Highly

Re: [web2py] Re: Best CSS framework for web2py

2010-06-09 Thread Jonathan Lundell
On Jun 9, 2010, at 5:39 PM, GoldenTiger wrote: At http://www.ez-css.org/rapid_prototyping , code of Module3A and Module3B are identical, but looks different. I don't understand it. Any help please? The classes are subtly different. The difference is whether column 3, which does not have

Re: [web2py] Re: stumped on a regex

2010-06-10 Thread Jonathan Lundell
On Jun 10, 2010, at 10:00 PM, mr.freeze wrote: Massimo's worked on the first try so I went with it! It may have a problem when there are two pre blocks. On Jun 5, 2:05 pm, mr.freeze nat...@freezable.com wrote: Thanks Thadeus/Massimo. I'll give each a try and let you know what I find.

Re: [web2py] import of web2py modules very complicated

2010-06-13 Thread Jonathan Lundell
On Jun 13, 2010, at 4:46 PM, pierreth wrote: I found that importing modules in Web2py seems to be very complex: http://web2py.com/book/default/section/4/18 I have a module in 'modules' and I do 'import modules.my_module' to import the module in my application. This is working fine with

Re: [web2py] Re: my app instead of welcome app???

2010-06-15 Thread Jonathan Lundell
On Jun 14, 2010, at 8:40 PM, Richard wrote: would that go against the web2py philosophy of having no configuration files? Not really. It could go in routes.py, which already (potentially) exists. On Jun 15, 1:33 pm, Thadeus Burgess thade...@thadeusb.com wrote: Why can't we configure the

Re: [web2py] url rewrite for SEO optimization

2010-06-17 Thread Jonathan Lundell
On Jun 16, 2010, at 11:36 AM, Michelle Jun wrote: i am wondering if i can do these things for example, i have list of businesses url links (this is generated from my web2py default) http://domain.com/default/business/8 http://domain.com/default/business/9

Re: [web2py] drop shadow on text in admin editor safari

2010-06-17 Thread Jonathan Lundell
On Jun 17, 2010, at 5:21 PM, Mike wrote: Just got an iMac (windows switcher) and ran the latest version of web2py from source. However when I opened a controlled in the admin editor all the text has a drop shadow behind it which makes it really hard to read. Only appears to be an issue with

Re: [web2py] Re: drop shadow on text in admin editor safari

2010-06-18 Thread Jonathan Lundell
: On Jun 17, 7:45 pm, Jonathan Lundell jlund...@pobox.com wrote: On Jun 17, 2010, at 5:21 PM, Mike wrote: Just got an iMac (windows switcher) and ran the latest version of web2py from source. However when I opened a controlled in the admin editor all the text has a drop shadow behind it which

Re: [web2py] Re: my app instead of welcome app???

2010-06-19 Thread Jonathan Lundell
On Jun 19, 2010, at 9:11 AM, Christopher Steel wrote: I use a link from init to my app as well. Works great for me. You just need to set up your app name. I have not tried the routes way as of yet. Here's something I've been using. I've added comments that I hope are clear. My intent here

Re: [web2py] a problem with routes.py

2010-06-25 Thread Jonathan Lundell
On Jun 25, 2010, at 5:40 AM, ilovesss2004 wrote: Here is code of my routes.py routes_in = (('/', '/myapp/default/index'), ) routes_out = (('/myapp/default/index', '/'), ) When I enter 127.0.0.1:8000 in browser, myapp do show but the ajax function does't work. I

Re: [web2py] Re: a problem with routes.py

2010-06-25 Thread Jonathan Lundell
On Jun 25, 2010, at 7:33 AM, ilovesss2004 wrote: the same And with no routes.py at all? On Jun 25, 4:18 pm, Jonathan Lundell jlund...@pobox.com wrote: On Jun 25, 2010, at 5:40 AM, ilovesss2004 wrote: Here is code of my routes.py routes_in = (('/', '/myapp/default/index

Re: [web2py] Re: Anybody having trouble accessing web2py google group on mozilla firefox 3.6.6? [CLOSED]

2010-06-28 Thread Jonathan Lundell
On Jun 28, 2010, at 9:53 AM, weheh wrote: Yup. Problem was with a cookie somewhere. As soon as I blew away the Google cookies it worked OK. Thx. I had this happen with Safari 5 as well. Same fix. On Jun 28, 12:34 pm, Thadeus Burgess thade...@thadeusb.com wrote: try logging completely out

Re: [web2py] markmin, t2, t3, cube9 etc. (important update)

2010-07-07 Thread Jonathan Lundell
On Jul 7, 2010, at 5:27 AM, mdipierro wrote: As you know T2 and T3 are deprecated. Some time ago I started a reimplementation of T3 called cube9. I got stuck. I now re-factored it completely - http://code.google.com/p/cube9/ (requires web2py trunk) - It uses markmin: -

Re: [web2py] Re: markmin, t2, t3, cube9 etc. (important update)

2010-07-07 Thread Jonathan Lundell
On Jul 7, 2010, at 5:42 AM, mdipierro wrote: The philosophy is the same as T3. Every URL is a wiki. Would you elaborate a little on that statement, please?

Re: [web2py] Re: markmin, t2, t3, cube9 etc. (important update)

2010-07-07 Thread Jonathan Lundell
On Jul 7, 2010, at 8:30 AM, mdipierro wrote: The idea is that any web app is a set of pages that contain stuff. Some are public some are not, some have other permissions, some are listed in a hierarchical menu some not. Therefore it should be possible to develop as app as one creates a wiki,

Re: [web2py] Re: markmin, t2, t3, cube9 etc. (important update)

2010-07-07 Thread Jonathan Lundell
an anchor is much less frequent, so the extra '=' is not much of a burden. and you include attachments with [[this is an image attachment:id center 200px]] On 7 Lug, 10:05, Jonathan Lundell jlund...@pobox.com wrote: On Jul 7, 2010, at 5:27 AM, mdipierro wrote: As you know T2 and T3

Re: [web2py] Re: markmin, t2, t3, cube9 etc. (important update)

2010-07-07 Thread Jonathan Lundell
On Jul 7, 2010, at 3:14 PM, mdipierro wrote: Right now you can do links with url [[name url]] [[name #anchor]] [[name url#anchor]] [[name page:slug]] and define an anchor with [[anchor]] If I understand your suggestions: 1) also allow [[url]] [[url#anchor]] [[#anchor]]

Re: [web2py] Beginner Question

2010-07-08 Thread Jonathan Lundell
On Jul 7, 2010, at 7:29 PM, Bruno Rocha wrote: Open a Python terminal, and try this example d = {'id':1,'title':'web2py'} d {'id': 1, 'title': 'web2py'} Title for id %(id)s is %(title)s % d 'Title for id 1 is web2py ' Unfortunately, none of this explains how the label argument is used

Re: [web2py] Re: markmin, t2, t3, cube9 etc. (important update)

2010-07-08 Thread Jonathan Lundell
, Jonathan Lundell jlund...@pobox.com wrote: On Jul 7, 2010, at 3:14 PM, mdipierro wrote: Right now you can do links with url [[name url]] [[name #anchor]] [[name url#anchor]] [[name page:slug]] and define an anchor with [[anchor]] If I understand your suggestions: 1) also

Re: [web2py] new welcome (scaffolding) app

2010-07-09 Thread Jonathan Lundell
On Jul 9, 2010, at 6:34 AM, mdipierro wrote: let's consider a new scaffolding app. What should be in it? What should not be in it? Either the features should be modular, and easily removable, or IMO there should be two scaffolding apps. One would be a minimal framework, suitable for

Re: [web2py] Re: Beginner Question

2010-07-09 Thread Jonathan Lundell
a lot of undocumented options. Perhaps you could add something to the source comment, as a start. On 8 Lug, 01:26, Jonathan Lundell jlund...@pobox.com wrote: On Jul 7, 2010, at 7:29 PM, Bruno Rocha wrote: Open a Python terminal, and try this example d = {'id':1,'title':'web2py

Re: [web2py] Re: web2py Reference Manual -- a call to arms

2010-07-12 Thread Jonathan Lundell
On Jul 12, 2010, at 9:20 AM, weheh wrote: Yes, I see it, thanks. I really do not like this format for a reference manual. Just a personal preference. Sorry. I do like the PHP index and cross linking, and I do think there are some good ideas there, but I think a Reference Manual should be

Re: [web2py] Re: markmin, t2, t3, cube9 etc. (important update)

2010-07-12 Thread Jonathan Lundell
call related to the plugin. In particular, we don't want to have to embed it in every page (though the *ability* to do so would be handy). Or every page could implicitly include a master page, if present. Massimo On 7 Lug, 17:24, Jonathan Lundell jlund...@pobox.com wrote: On Jul 7, 2010

Re: [web2py] Re: web2py Reference Manual -- a call to arms

2010-07-12 Thread Jonathan Lundell
On Jul 12, 2010, at 12:33 PM, mdipierro wrote: Why GAE? Is there a performance issue with the current book? For my part, only because it'd be a prominent demonstration of web2py on GAE. Other than that, it doesn't matter. On 12 Lug, 12:53, weheh richard_gor...@verizon.net wrote: Jonathan,

Re: [web2py] Re: language

2010-07-12 Thread Jonathan Lundell
On Jul 12, 2010, at 12:38 PM, mdipierro wrote: If the developer knows that some string should be stripped, he can do: T(my_string.strip()) Not all strings should be stripped (really, I think in general cases strings must not be stripped). In some cases when I need to translate only one word

Re: [web2py] Re: language

2010-07-12 Thread Jonathan Lundell
write: T('blah blah [[blah]][[]]') ...and only the trailing [[]] would be stripped. BTW, there's a typo in languages.py: # patter for a valid accept_language (and the pattern could use a comment or three) On 12 Lug, 14:49, Jonathan Lundell jlund...@pobox.com wrote: On Jul 12, 2010, at 12:38

Re: [web2py] Re: loop generated forms

2010-07-12 Thread Jonathan Lundell
On Jul 12, 2010, at 3:04 PM, Rick wrote: Thanks for your inspiring answer, After I found this page: http://code.activestate.com/recipes/440502-a-dictionary-with-multiple-values-for-each-key/ ...I tried with: return dict['form'].append([x]) ...but my new code doesn't work neither. I just

Re: [web2py] Re: language

2010-07-12 Thread Jonathan Lundell
everything, I think, so T(' canto /* my room */') is equivalent to T('canto/*my room*/'). (That's why I don't much like /*...*/, though; it's sort of ugly without extra spaces.) On 12 Lug, 15:39, Jonathan Lundell jlund...@pobox.com wrote: On Jul 12, 2010, at 1:32 PM, Álvaro Justen wrote

Re: [web2py] Re: language

2010-07-12 Thread Jonathan Lundell
Lug, 17:22, Jonathan Lundell jlund...@pobox.com wrote: On Jul 12, 2010, at 3:15 PM, mdipierro wrote: Ok but can I propose we use T('canto /* my room */') instead of [[...]] to avoid confusion with markmin syntax? This would b easy to implement. Or ((my room)). Or my room

Re: [web2py] Re: language

2010-07-12 Thread Jonathan Lundell
to be fixed, no? What do you think? On 12 Lug, 17:30, Jonathan Lundell jlund...@pobox.com wrote: On Jul 12, 2010, at 3:26 PM, mdipierro wrote: I like ((...)). If I understand you suggest stripping the whitespaces ONLY inside ((..)). Did I understand? Stripping the main string, too--wasn't

Re: [web2py] Re: language

2010-07-12 Thread Jonathan Lundell
. That would reduce the likelihood of a collision, yes. And you're right; the close is superfluous, given that there's nothing following the variant string. On 12 Lug, 17:56, Jonathan Lundell jlund...@pobox.com wrote: On Jul 12, 2010, at 3:50 PM, mdipierro wrote: As a test, I implemented

Re: [web2py] Re: prohibit users to edit their profiles

2010-07-13 Thread Jonathan Lundell
On Jul 13, 2010, at 6:52 AM, Jean-Guy wrote: The : {{=auth.navbar('welcome',URL(r=request,c='default',c='user'))}} Try f='user' (not c=). Not working : Traceback (most recent call last): File /nigthly_build/web2py/gluon/restricted.py, line 176, in restricted ccode =

Re: [web2py] Re: prohibit users to edit their profiles

2010-07-13 Thread Jonathan Lundell
, so I don't have a view on that. The SyntaxError you're seeing below, though, is simply that you've got two c= keyword arguments, which Python objects to. 'user' is a function, not a controller. Jonhy On 2010-07-13 10:25, Jonathan Lundell wrote: On Jul 13, 2010, at 6:52 AM, Jean-Guy wrote

Re: [web2py] Re: loop generated forms

2010-07-13 Thread Jonathan Lundell
is that you'll need to give each form a unique name. See Multiple forms per page in the manual, Chapter 7. On Jul 13, 12:19 am, Jonathan Lundell jlund...@pobox.com wrote: On Jul 12, 2010, at 3:04 PM, Rick wrote: Thanks for your inspiring answer, After I found this page: http

Re: [web2py] Re: forcing request.vars.something to be a list

2010-07-16 Thread Jonathan Lundell
On Jul 16, 2010, at 8:53 AM, ae wrote: I never said request.vars is a list. If I have a multiple select box on a page and one entry is selected then I get a string. If multiple entries are selected, I get a list of strings. That's not good. select multiple name=things option

[web2py] Rocket cache response

2010-07-19 Thread Jonathan Lundell
On Jul 18, 2010, at 4:10 PM, MikeEllis wrote: Here's the Header info from the long fetch on base.css: Request URL:http://192.168.253.105:8000/init/static/base.css Request Method:GET Status Code:304 Not Modified Request Headers Accept:text/css,*/*;q=0.1 Cache-Control:max-age=0

Re: [web2py] Re: Rocket cache response

2010-07-19 Thread Jonathan Lundell
(the more the merrier) and email it to me. As a side-note, some of you have requested some features for Rocket. I'm limiting development to essentials right now because of a case of dual-arm tendinitis. Thanks. On Jul 19, 12:11 pm, Jonathan Lundell jlund...@pobox.com wrote: On Jul 19

Re: [web2py] Web2py and w3validator

2010-07-20 Thread Jonathan Lundell
On Jul 20, 2010, at 11:32 AM, Johann Spies wrote: I am not an experienced web developer but I have always valued the output from validator.w3.org. After being disappointed with the output I received when validating a web2py app I built, I checked out http://www.web2py.com and it reported

Re: [web2py] Re: Rocket cache response

2010-07-20 Thread Jonathan Lundell
On Jul 20, 2010, at 4:27 PM, Timbo wrote: @Jon, Notice that HTTP(304) call, that doesn't read response.headers, it only takes in what headers you give it. In this case it's none. Flip over to http.py line 77...there's your answer. Ah, right. We shouldn't be adding content-type headers to

[web2py] is None

2010-07-21 Thread Jonathan Lundell
From time to time we see advice to use 'is' when testing against None in Python. I was reminded of that by this checkin (which I should say I don't think is actually a problem) -self.default = default or update # default value for field +self.default = default==None and update

Re: [web2py] Re: rocket performance issues

2010-07-21 Thread Jonathan Lundell
On Jul 21, 2010, at 2:03 PM, mdipierro wrote: The fact that you are having the problem with static files is giving me an idea for a test. Can you please try the web2py I just posted in trunk? That seems like a nice optimization, but (assuming it fixes the symptom) does it explain the

Re: [web2py] Re: rocket performance issues

2010-07-22 Thread Jonathan Lundell
On Jul 22, 2010, at 6:55 AM, MikeEllis wrote: Doesn't fix the symptom Ah. Well, negative results are still results. On Jul 21, 8:54 pm, Jonathan Lundell jlund...@pobox.com wrote: On Jul 21, 2010, at 2:03 PM, mdipierro wrote: The fact that you are having the problem with static files

Re: [web2py] XML sanitizer question

2010-07-22 Thread Jonathan Lundell
On Jul 22, 2010, at 7:04 PM, mr.freeze wrote: XML('btest/b',sanitize=True,permitted_tags = ['b']).xml() 'btest/b' XML('atest/a',sanitize=True,permitted_tags = ['a']).xml() 'test' Why does the 'a' element get sanitized? At first glance, it looks like it might require an attribute from

[web2py] chunks

2010-07-22 Thread Jonathan Lundell
It'd be nice to be able to return a dynamic page in (controlled) chunks. I have no idea how the interface to something like that might work

Re: [web2py] Re: XML sanitizer question

2010-07-22 Thread Jonathan Lundell
On Jul 22, 2010, at 7:41 PM, mr.freeze wrote: Negative, it sanitizes those too: XML('a href=web2py.comtest/a',sanitize=True,permitted_tags = ['a']).xml() 'test' Only absolute URLs are acceptable. Try http://web2py.com. On Jul 22, 9:38 pm, Jonathan Lundell jlund...@pobox.com wrote

Re: [web2py] chunks

2010-07-22 Thread Jonathan Lundell
On Jul 22, 2010, at 9:32 PM, Phyo Arkar wrote: You mean ajax? You can do this using Ajax. In Jquery: $(#div_id).load(Path_To_Your_Page) No, I meant just serving a regular (dynamic) page. I'm not using Ajax. On 7/23/10, Jonathan Lundell jlund...@pobox.com wrote: It'd be nice to be able

Re: [web2py] Re: book revision

2010-07-24 Thread Jonathan Lundell
More on the DAL objects would be nice, especially on the details of their methods. Which operations they support, how they're combined, etc. There's something there already, but it could use fleshing out.

Re: [web2py] Re: book revision

2010-07-24 Thread Jonathan Lundell
http://code.google.com/p/web2py-book/wiki/BookGeneralIssues

Re: [web2py] Re: new in trunk: clone.py

2010-07-26 Thread Jonathan Lundell
On Jul 25, 2010, at 12:16 PM, mdipierro wrote: BTW I am working on it... I had not realized how much new stuff was still undocumented. Sorry. It's been a year, after all. That's the problem with relatively static docs, though.

Re: [web2py] Re: rocket performance issues

2010-07-27 Thread Jonathan Lundell
On Jul 27, 2010, at 5:33 AM, Michael Ellis wrote: This morning I found several OSError reports about Too many open files in a web2py development server that's been running locally for several days. The app code isn't doing any explicit file i/o so I don't know what's going on, but here

Re: [web2py] Re: rocket performance issues

2010-07-27 Thread Jonathan Lundell
On Jul 27, 2010, at 9:01 AM, Michael Ellis wrote: Thanks for the info about sloth. I may try it later. It was pretty easy to get what I needed with ipython: procs = !ps ax | grep web2py pids = [r[0] for r in procs.fields()[0:-2]] for p in pids: print p !lsof | grep $p | wc

Re: [web2py] Re: book 3rd edition call of help

2010-07-27 Thread Jonathan Lundell
:20 am, Jonathan Lundell jlund...@pobox.com wrote: On Jul 27, 2010, at 4:51 AM, mdipierro wrote: web2py.com/book was broken into section web2py.com/book2 is broken into chapters what is better? Once printed it will be the same. Offhand I'd say chapters, so I can use my browser-native

Re: [web2py] Re: where to put helper functions?

2010-07-27 Thread Jonathan Lundell
On Jul 27, 2010, at 9:26 AM, Mathieu Clabaut wrote: But then note that you have to pass as arguments to your helpers objects that are otherwise directly available in models and controllers, like : db, request, response, T, auth,... Or import them. I wrote a module to give me a nicer

Re: [web2py] Re: book 3rd edition call of help

2010-07-27 Thread Jonathan Lundell
On Jul 27, 2010, at 9:37 AM, mwolfe02 wrote: I'd vote for CHAPTERS as well, with the previously mentioned caveat that searches would need to be able to jump to the relevant section(s) within a chapter. Also, I think a fixed (ie, non-scrolling and always on-screen) sidebar with the current

Re: [web2py] Re: rocket performance issues

2010-07-29 Thread Jonathan Lundell
On Jul 28, 2010, at 11:57 PM, mdipierro wrote: I modified the expire_sessions.py in trunk and added a try:...execept... If the problem was that a file was locked and the cron task got stuck, it may be solved now. Can you test it? In this patch: @@ -6,8 +6,14 @@ now=time.time() for file in

Re: [web2py] Re: question/suggestion about URL, controller

2010-07-30 Thread Jonathan Lundell
On Jul 30, 2010, at 12:05 AM, mdipierro wrote: You are right but it only breaks backward compatibility in a case where things would be misleading. Here are some example: # old syntax that still works URL('a','c','f') URL(a='a',c='c',f='f') URL(f='f',r=request) #new syntax that resulted

Re: [web2py] Re: encrypt source code

2010-07-30 Thread Jonathan Lundell
On Jul 30, 2010, at 8:32 AM, Michele Comitini wrote: This is not possible in general. If you do not want anyone to copy something than do not show it. Think of writing a book that no one can read... Right. It's worth making a distinction, too, about how an application gets distributed. If

Re: [web2py] Re: fun with metaclasses

2010-07-30 Thread Jonathan Lundell
On Jul 30, 2010, at 9:19 AM, VP wrote: This is really nice. Please do more of this. On Jul 30, 9:35 am, mdipierro mdipie...@cs.depaul.edu wrote: http://gluonframework.wordpress.com/2010/07/30/web2py-and-metaclasses/ My initial reaction is the opposite. The result might be more readable,

Re: [web2py] Re: Why I hate Django by Cal Henderson

2010-07-31 Thread Jonathan Lundell
On Jul 31, 2010, at 5:09 PM, Scott wrote: In essence your argument is that it would take too much time and you could change the hmac key monthly to prevent an attack. I understand and respect that signed cookies are one way to solve the problem, but I do not believe they are the most correct

Re: [web2py] Re: rewrite url using routes.py

2010-08-01 Thread Jonathan Lundell
On Aug 1, 2010, at 2:54 AM, mdipierro wrote: I realized there was a bug in rewrite that prevented $1, $2, etc from working. Please check if this is now fixed in trunk. A very minor redundancy: regex_at = re.compile('(?!)\$[a-zA-Z][\w_]*') is equivalent to: regex_at =

Re: [web2py] OT: email notifications on repo change?

2010-08-01 Thread Jonathan Lundell
On Aug 1, 2010, at 12:38 PM, Tim Michelsen wrote: when we were using bazaar and Lunchpad, there was a possibility to subscribe to code repositories and Launchpad would send me a email when a new revision was submitted. Is there a similar feature with google code? I could find the setting

Re: [web2py] Re: OT: email notifications on repo change?

2010-08-01 Thread Jonathan Lundell
On Aug 1, 2010, at 1:03 PM, Tim Michelsen wrote: Alternatively, as an ordinary user, you can go to the Project Home - Updates and subscribe to its rss feed: feed://code.google.com/feeds/p/web2py/updates/basic (It's not shown as a link on the page, but it's in the header, and Safari, at

Re: [web2py] Re: book revision

2010-08-01 Thread Jonathan Lundell
On Jul 26, 2010, at 9:09 AM, VP wrote: I think the book needs some work. I'm learning web2py. I like it. But I feel there are some mysteries that have not been explained in the book. I hope you put a team on the book. Chapter 3 needs to be thoughtfully expanded. The problem with magic

Re: [web2py] Re: book 3rd edition call of help

2010-08-01 Thread Jonathan Lundell
On Aug 1, 2010, at 1:25 PM, Scott wrote: Regarding the IDE, my preference is Wing IDE for its superior debugging capabilities and there are detailed instructions on using it with web2py here: http://wingware.com/doc/howtos/web2py I've used both Wing and Komodo with web2py, mainly for

Re: [web2py] Re: ARTICLE: The good and bad about web2py

2010-08-02 Thread Jonathan Lundell
On Aug 2, 2010, at 2:36 AM, Michele Comitini wrote: Python magic was all over the place, variables defined globally are allover, you cannot see real OO in the design I only agree that Python is magic, but that is the only thing I agree with. Probably a long exposure to COO (Class Object

Re: [web2py] Re: Debugging view template logic

2010-08-02 Thread Jonathan Lundell
On Aug 2, 2010, at 9:21 AM, Michael Ellis wrote: I'm pretty sure it does because I've fixed several instances during the past two days by correcting pass statements. I'll try to create a minimal example to post here. That would be good. Whatever it is, it's leading to rocket seeing an

Re: [web2py] Re: How to detect in controller that request is via AJAX?

2010-08-03 Thread Jonathan Lundell
On Aug 3, 2010, at 5:33 AM, Niphlod wrote: +1 for this method, is pretty standard in other frameworks too. Also, according to http://www.w3.org/TR/XMLHttpRequest/#send , the Accept header must be set as '*/*'. (and I think that there is one too much lower()), : ... if

Re: [web2py] Re: routes.py in applications or how to access request in routes.py

2010-08-06 Thread Jonathan Lundell
On Aug 6, 2010, at 7:52 AM, Lasiaf wrote: cool. is there any date on when it will be added? I've been promising to write a new route-rewriter for months now, and not finding the time. Massimo has suggested an interim solution to allow app-specific routing using the current logic which ought

Re: [web2py] per app routes

2010-08-07 Thread Jonathan Lundell
On Aug 7, 2010, at 9:03 AM, mdipierro wrote: Thanks to Jonathan Lundell we have an experimental version in trunk of app level routes. To understand how it works read routes.example.py and comments in the file gluon/rewrite.py If you test it please report your findings here. *Very

Re: [web2py] Re: per app routes

2010-08-07 Thread Jonathan Lundell
. In particular, the routing files are read and the regexes compiled only once, when web2py starts up, so the per-request overhead is quite low. david On 7 srp, 18:26, Jonathan Lundell jlund...@pobox.com wrote: On Aug 7, 2010, at 9:03 AM, mdipierro wrote: Thanks to Jonathan Lundell we have

Re: [web2py] routes problem

2010-08-08 Thread Jonathan Lundell
On Aug 7, 2010, at 11:16 PM, elffikk wrote: I use version 1.82.1 (latest) and this seems not to work ('(.*):https?://(.*)site\.com:(.*)/(.*)', '/site/$4'), for simple site.com getting error site - is another name :) Is this 1.82.1 or the trunk?

Re: [web2py] routes problem

2010-08-08 Thread Jonathan Lundell
On Aug 7, 2010, at 11:16 PM, elffikk wrote: I use version 1.82.1 (latest) and this seems not to work ('(.*):https?://(.*)site\.com:(.*)/(.*)', '/site/$4'), for simple site.com getting error site - is another name :) I think I see the problem, but I'm not sure what you're trying to

Re: [web2py] routes problem

2010-08-08 Thread Jonathan Lundell
On Aug 7, 2010, at 11:16 PM, elffikk wrote: I use version 1.82.1 (latest) and this seems not to work ('(.*):https?://(.*)site\.com:(.*)/(.*)', '/site/$4'), for simple site.com getting error site - is another name :) From the manual (chapter 4): [remote

<    1   2   3   4   5   6   7   8   9   10   >