[web2py] Re: Apache, Wsgi problem

2011-07-08 Thread cjrh
On Monday, January 10, 2011 6:36:18 AM UTC+2, Anthony wrote: On Sunday, January 9, 2011 1:24:02 AM UTC-5, Graham Dumpleton wrote: You guys really just got to learn to do your own thing and not treating it like a crusade where you have to convert the world. But that's exactly the

[web2py] R: Re: How to display 'complete strings' in a view table ?

2011-07-08 Thread Valter Foresto
Many thanks Anthony, Firstly I changed the default in 'gluon/sqlhtml.py' with 'truncate=32' on line 1312. Using '{{=records}}' in the view and, after restart web2py from source, all the string fields are truncated only after 32 characters. This solve effectively the problem without change in

Re: [web2py] R: Re: How to display 'complete strings' in a view table ?

2011-07-08 Thread Martín Mulone
Also you can pass truncate=None and use field.represent and make your own field representation. What version of web2py?. You are not mixing this sqlhtml.py file (trunk) with older web2py version?. 2011/7/8 Valter Foresto valter.fore...@gmail.com Many thanks Anthony, Firstly I changed the

Re: [web2py] Re: Metaprogramming in controller

2011-07-08 Thread Miguel Lopes
:-) On Fri, Jul 8, 2011 at 2:25 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: yes. even better use router (vs routes) On Jul 6, 10:03 am, Miguel Lopes mig.e.lo...@gmail.com wrote: Humm, Nice. Yes, closures are enough, and cleaner too. Is routes OK for production mode?

Re: [web2py] Re: A catchall action per controller - would be proposal

2011-07-08 Thread Miguel Lopes
Yes. That's what I meant. Thank you for making it much clearer. Like you mention the benefit is unclear. This makes it unnecessary to toy with routes or router, which I believe is in the spirit of web2py and benefits beginners with one less location to edit, thing to learn (routes rules vs.

R: Re: [web2py] R: Re: How to display 'complete strings' in a view table ?

2011-07-08 Thread Valter Foresto
I'm using the last version souces of web2py - Version 1.97.1 (2011-06-26 19:25:44) . With the view: {{extend 'layout.html'}} {{=SQLTABLE(records, truncate=None)}} I get the Traceback (most recent call last): File C:\Users\valter\Desktop\ALTECH\web2py\web2py\gluon\restricted.py, line

[web2py] Re: Passing JavaScript variable to web2py session variable?

2011-07-08 Thread Ross Peoples
You're doing it right, but there are a couple of things to keep in mind. Using $.post(url, {input_n: input_number}); is easier than using $.ajax, but that's merely preference. The other thing you should know is that if a web2py ticket is generated during an AJAX call, you will not know about

[web2py] Re: Passing JavaScript variable to web2py session variable?

2011-07-08 Thread Vasil Petkov
On Jul 8, 3:02 pm, Ross Peoples ross.peop...@gmail.com wrote: You're doing it right, but there are a couple of things to keep in mind. Using $.post(url, {input_n: input_number}); is easier than using $.ajax, but that's merely preference. The other thing you should know is that if a web2py

[web2py] conditional {{include}} in view

2011-07-08 Thread Kernc
Ok, so this is my setup: I have article() function inside default controller, which obtains article title in request.args, puts ('articles/'+str(request.args[0]) +'.html') into returned dict(article=...), and serves appropriate article's HTML from article.html with !-- various common tags along

[web2py] Re: Passing JavaScript variable to web2py session variable?

2011-07-08 Thread Ross Peoples
Going from web2py - JavaScript is easy: {{=var}} However, going from JavaScript - web2py requires an AJAX call. Since JavaScript is run on the user's machine and not the web server, the two machines have to communicate somehow, which is where AJAX comes in. You should also know that things

[web2py] Re: Apache, Wsgi problem

2011-07-08 Thread Anthony
On Friday, July 8, 2011 3:25:45 AM UTC-4, cjrh wrote: On Monday, January 10, 2011 6:36:18 AM UTC+2, Anthony wrote: On Sunday, January 9, 2011 1:24:02 AM UTC-5, Graham Dumpleton wrote: You guys really just got to learn to do your own thing and not treating it like a crusade where you

[web2py] Re: conditional {{include}} in view

2011-07-08 Thread Anthony
First, if you want to use a particular view, you can always explicitly assign response.view: def about(): response.view='default/article.html' # This view will be used instead of 'default/about.html'. # more code return dict(...) Also, note that the {{include}} statement is not a

[web2py] Re: Passing JavaScript variable to web2py session variable?

2011-07-08 Thread ron_m
You need to have the AJAX URL formed in a way that invokes a controller. eg /application_name/controller_name/function_name/arg0/arg1 . and include the variable(s) you want to send back. The variables can be either addition items after the function as above where they show up as args or if

Re: R: Re: [web2py] R: Re: How to display 'complete strings' in a view table ?

2011-07-08 Thread Anthony
Can you show the code that produces the 'records' object -- it looks like it's already a SQLTABLE object rather than a DAL Rows object. Anthony On Friday, July 8, 2011 7:53:08 AM UTC-4, Valter Foresto wrote: I'm using the last version souces of web2py - Version 1.97.1 (2011-06-26 19:25:44)

[web2py] New Plugin: plugin_ckeditor

2011-07-08 Thread Ross Peoples
This will be my second public plugin release. I will put it up on BitBucket soon, but for now, I thought I would introduce a new plugin I've been working on. Sometimes you just need a WYSIWYG editor. This plugin integrates CKEditor into web2py. It acts much like the Auth object in its usage.

[web2py] Re: Call functions periodically from WEB2PY at short time basis (like 0.05 ... 5 seconds)

2011-07-08 Thread Francisco Costa
Hardo to say. 0.9.7 branch is now obsolete, and a lot of fix has been added to signal framework in 0.9.8. If you want to manage timer reliably you should use the latest tip (it is really the 0.9.8.2 release, i am only waiting for a last patch before release) -- Roberto De

Re: [web2py] Re: conditional {{include}} in view

2011-07-08 Thread Kernc
OMG, setting response.view does it for me 110%! Confident in the ease of use of web2py, I swear I tried this the very first. Maybe I mistyped it to response.view = 'article.html' or request.view, and then just turned to alternatives. Anyway, now it works! :-D I also understand your explanation,

R: Re: R: Re: [web2py] R: Re: How to display 'complete strings' in a view table ?

2011-07-08 Thread Valter Foresto
Anthony, you are a 'clairvoyant', the controller code is : @auth.requires_login() def current_logs(): records=SQLTABLE(db().select(db.logs.ALL)) return dict(records=records) ... oops, you say that I need to use DAL Rows object. not SQLTABLE object ! Then I suddenly changed the

Re: [web2py] Re: conditional {{include}} in view

2011-07-08 Thread Anthony
On Friday, July 8, 2011 12:14:48 PM UTC-4, Kernc wrote: I also understand your explanation, except one thing: if I have an {{include}} inside a {{block}} as a default value (both these statements are template, non-python statements), and that default is overridden, and since {{block}}

Re: [web2py] Re: How to display 'complete strings' in a view table ?

2011-07-08 Thread valter.foresto
Anthony, I reply to you also privately to say many thanks for your support on the web2py-users group. I give you my references and if you are on LinkedIn I very appreciate if you join my professional networks. Best Regards. Valter Foresto

Re: R: Re: R: Re: [web2py] R: Re: How to display 'complete strings' in a view table ?

2011-07-08 Thread Anthony
No problem. Unfortunately, SQLTABLE does not appear to be well documented in the book. You could also leave the call to SQLTABLE in the controller and just add the 'truncate' argument there (and keep {{=records}} in the view), though since it's a display issue, I suppose it makes most sense in

[web2py] Re: New Plugin: plugin_ckeditor

2011-07-08 Thread Anthony
This looks great. I would certainly find it useful. Thanks for contributing. Anthony

[web2py] Re: New Plugin: plugin_ckeditor

2011-07-08 Thread mart
I think this is awesome and really like the double-click edit feature! I'm sure this will be of great use to many. Good on you! Mart :) On Jul 8, 12:00 pm, Ross Peoples ross.peop...@gmail.com wrote: This will be my second public plugin release. I will put it up on BitBucket soon, but for

Re: [web2py] New Plugin: plugin_ckeditor

2011-07-08 Thread Bruno Rocha
Congrats, this is a very useful plugin, and certainly will be one of most importants and for sure it is very wanted. I would like to use, let me know if you want some help testing. (i am curious to see how it integrates with FormWizard plugin) I am working a lot to finish the web2pyslices 2. In

[web2py] Demystifying some web2py magic

2011-07-08 Thread Jim Steil
Hi I have a utility module that I use regularly where I put some of my application-specific helper functions. What is the proper way to import this to make it available in my controllers and views? I've tried the local_import in db.py but have seen references on this list that recommend

R: Re: R: Re: R: Re: [web2py] R: Re: How to display 'complete strings' in a view table ?

2011-07-08 Thread Valter Foresto
Yes, SQLTABLE is not well documented but WEB2PY is fantastic ! I agree with you that the use of SQLTABLE should be (typically) in the view. -- Valter

[web2py] Re: Demystifying some web2py magic

2011-07-08 Thread Anthony
local_import should work, but you should now use regular import statements instead. If you want your modules reloaded automatically, do the following: from gluon.custom_import import track_changes track_changes() That will reload your modules, but only when they change (which is an

Re: [web2py] Re: Demystifying some web2py magic

2011-07-08 Thread Jim Steil
Fantastic, that is exactly what I was looking for! -Jim On 7/8/2011 2:20 PM, Anthony wrote: local_import should work, but you should now use regular import statements instead. If you want your modules reloaded automatically, do the following: from gluon.custom_import import track_changes

[web2py] Re: Apache, Wsgi problem

2011-07-08 Thread cjrh
On Friday, 8 July 2011 16:05:54 UTC+2, Anthony wrote: On Friday, July 8, 2011 3:25:45 AM UTC-4, cjrh wrote: On Monday, January 10, 2011 6:36:18 AM UTC+2, Anthony wrote: On Sunday, January 9, 2011 1:24:02 AM UTC-5, Graham Dumpleton wrote: You guys really just got to learn to do your own

Re: [web2py] New Plugin: plugin_ckeditor

2011-07-08 Thread Ross Peoples
Ok, I have posted the source code on BitBucket. I don't have time to put any documentation up there yet other than what's here in this thread. I will update with more documentation hopefully this weekend when I have time. Until then, enjoy! https://bitbucket.org/PhreeStyle/web2py_ckeditor

[web2py] Re: Apache, Wsgi problem

2011-07-08 Thread Anthony
On Friday, July 8, 2011 3:47:09 PM UTC-4, cjrh wrote: *Why* should we care how many users we have? Again, this is not the most important thing, but the number of users is not entirely without consequence either. Generally, more users will translate into more expert contributors and

[web2py] Re: plugins

2011-07-08 Thread Anthony
Adding to the plugins thread... *web2py_ckeditor:* https://bitbucket.org/PhreeStyle/web2py_ckeditor https://groups.google.com/d/topic/web2py/fCia6IvhZew/discussion Thanks, Ross.

[web2py] DAL: About upload field and S3

2011-07-08 Thread Oscar
Hi, There exist a way to do an upload when a Upload field is defined at the model but it upload the file to a S3 bucket? Do I have to extend the upload field properties? How? Thanks in advance. Oscar.

[web2py] Re: Apache, Wsgi problem

2011-07-08 Thread pbreit
Sorry cjrh, but the number of users and the perception of the project DO matter. Some of us are building businesses around Web2py and need to feel comfortable that the project has longevity, that we can hire and retain engineers, that we can find resources if we need them, etc. Not everyone is

[web2py] URL() unexpectedly including app name in URLs

2011-07-08 Thread pbreit
I seem to have forgotten exactly how URL() works. I believe my URLs used to look like /static/image/asdfadsfa.jpg but now they are including /init at the beginning (ie: /init/static/image/asdfadsfa.jpg). I have default_application = 'init' in my route file. Am I missing something?

[web2py] Re: URL() unexpectedly including app name in URLs

2011-07-08 Thread pbreit
It only seems to be happening on images. OK: URL('default', 'item', extension='', args=item.item.slug) http://pricetack.com/item/us-open-2010-pebble-beach-greg-norman-golf-shirt-x-99 Not OK: {{=URL('static', 'uploads', extension='', args=item.item.image_thumb)}}

Re: [web2py] Re: URL() unexpectedly including app name in URLs

2011-07-08 Thread Jonathan Lundell
On Jul 8, 2011, at 2:31 PM, pbreit wrote: It only seems to be happening on images. OK: URL('default', 'item', extension='', args=item.item.slug) http://pricetack.com/item/us-open-2010-pebble-beach-greg-norman-golf-shirt-x-99 Not OK: {{=URL('static', 'uploads', extension='',

[web2py] Re: Apache, Wsgi problem

2011-07-08 Thread Massimo Di Pierro
Have I missed some new controversial reddit thread? On Jul 8, 4:18 pm, pbreit pbreitenb...@gmail.com wrote: Sorry cjrh, but the number of users and the perception of the project DO matter. Some of us are building businesses around Web2py and need to feel comfortable that the project has

Re: [web2py] Re: URL() unexpectedly including app name in URLs

2011-07-08 Thread pbreit
Bingo, thx. Not sure how I missed except that I guess it works either way. But now I have nginx handling /static which I presume is better.

Re: [web2py] Re: URL() unexpectedly including app name in URLs

2011-07-08 Thread Jonathan Lundell
On Jul 8, 2011, at 3:21 PM, pbreit wrote: Bingo, thx. Not sure how I missed except that I guess it works either way. But now I have nginx handling /static which I presume is better. Up to you. The idea is that static URLs aren't very visible to users, so there's less motivation to shorten

[web2py] admin complains at encoder

2011-07-08 Thread Carl
in my db.py I have import datetime rom time import mktime, localtime timestamp = SQLCustomType(type='datetime', native='NUMERIC(16,6)', encoder=(lambda x: str(mktime(x.timetuple()) + x.microsecond/100.0 if x else None)),

Re: [web2py] Re: URL() unexpectedly including app name in URLs

2011-07-08 Thread pbreit
I think I'd rather have my static URLs resemble my other URLs. Seems like if I'm removing the default appname, that should be global? Although I don't even know: on a URL like this, does it even touch web2py?

[web2py] Re: admin complains at encoder

2011-07-08 Thread pbreit
Could be a copy/paste error but there's a typo in line 2: rom should be from.

[web2py] Re: admin complains at encoder

2011-07-08 Thread Carl
thanks pbreit alas (and o heck!) it was just a lost character in my pasted posting. On Jul 8, 11:48 pm, pbreit pbreitenb...@gmail.com wrote: Could be a copy/paste error but there's a typo in line 2: rom should be from.

Re: [web2py] Re: URL() unexpectedly including app name in URLs

2011-07-08 Thread Jonathan Lundell
On Jul 8, 2011, at 3:39 PM, pbreit wrote: I think I'd rather have my static URLs resemble my other URLs. Seems like if I'm removing the default appname, that should be global? Although I don't even know: on a URL like this, does it even touch web2py?

[web2py] Re: Apache, Wsgi problem

2011-07-08 Thread cjrh
No, or rather, not that I am aware. We are discussing, I think, the principal of the matter.

[web2py] Re: Apache, Wsgi problem

2011-07-08 Thread cjrh
On Friday, 8 July 2011 23:18:57 UTC+2, pbreit wrote: You need to think slightly bigger than your own personal projects. Why should I? The bigger community does not concern me. I contribute to web2py for entirely selfish reasons, because it want it to be the best tool for me to use for my