[web2py] Re: on a possible web2py memory leak

2011-01-09 Thread ron_m
In the sample code if one comments out the __del__ method in the class the 
leak does not occur. That is not to say it can't happen I suppose in a more 
complicated code example but I believe the __del__ is a required piece. This 
test was performed without the gc.collect() being present. I ran System 
Monitor on Ubuntu and watched the python process after each edit and 
monitored memory size to verify. So the only way I got the leak was to have 
the __del__method present on the class in the exec example and not have the 
gc.collect() call.

I left the process running with the leak (__del__ present in class and 
gc.collect() commented out) and it got to 3 GB of process space so the 
collector never ran. The system was showing all the signs of a machine in 
trouble from memory pressure, I have 4 GB of physical memory. The size 
builds quite rapidly.

This is an old article published as the gc module was added to Python that 
explains a bit about gc in Python.

http://arctrix.com/nas/python/gc/

Because it is old it may not be 100% accurate today but does go into the 
problem some better than the reference documentation. 

This article was decent as well

http://www.algorithm.co.il/blogs/programming/python-gotchas-1-__del__-is-not-the-opposite-of-__init__/

Ron





[web2py] Re: Apache, Wsgi problem

2011-01-09 Thread pbreit
I came to Web2py recently and I can definitely see how the promotion of 
Web2py in places like Reddit would rub people the wrong way. Much of the 
hostility seems related to how Web2py is promoted, not to its technical 
merits.

Re: [web2py] Re: BETA: new URL routing facility

2011-01-09 Thread pbreit
I'm a bit confused as well. Perhaps some more example would help.

Also, I would agree that per-application routing should be the default. And 
further, the global routes file should be enabled by default and should 
provide the same routes as you currently get with a fresh install of Web2py 
(with any app-routes overriding).


[web2py] "undefined record" error in appadmin on GAE

2011-01-09 Thread johntynan
I am running a web2py application on GAE.  I would like to export
different tables as CSV files from my application by way of the
appadmin.  (My goal is to create both a backup of the data and a test
suite with actual data).

However, I am receiving the following "undefined record" error when
viewing different tables using the appadmin:

http://pastie.textmate.org/1444589

I am using web2py Version 1.83.2 and GAE release "1.4.0"

Awhile back, Massimo had helped me to understand what appears to be a
similar issue

"It is trying to represent a reference field with an invalid
reference"

as described in this thread (although this earlier error was occuring
in my application and not in the appadmin):

http://groups.google.com/group/web2py/browse_thread/thread/4fbc46b845d19598/e57db67349a60181?lnk=gst&q=%22undefined+record%22#e57db67349a60181

When displaying tables by way of the appadmin is there any
"represention of a reference field" which could be causing this issue?

I believe I know what could have led to this issue, my client deleted
a row from a table.  This row is referenced by data in other tables.

In thinking about a solution, I could try to re-create the entry in
the table by way of the appadmin (I am pretty sure I have the
information for this single row in the table from a previous backup).
I could also use the Datastore Viewer in GAE's admin console to create
or edit the entry.  I also wonder if Google's bulk loader tool would
be helpful in backing up, editing and restoring the data.

Have other people run into this issue and if so, what steps have you
taken to arrive at a solution?

Also, do you have any recommendations for ways where I could
periodically test for this kind of inconsistency?  Do you have any
suggestions for how I might prevent this issue from happening in the
future?


[web2py] Re: Inserting additional fields in crud

2011-01-09 Thread Martin H
I've tried using SQLFORM and adding additional fields by simply adding html 
inputs. The fields are not accessible via form.vars.name. Is it possible to 
have additional fields in SQLFORM or crud that are not in the model?

Re: [web2py] Re: BETA: new URL routing facility

2011-01-09 Thread Jonathan Lundell
On Jan 9, 2011, at 10:55 PM, Wikus van de Merwe wrote:
> Jonathan, can you explain a bit more about how the new routes would work on 
> some examples? How would the mappings below (just /c/f/args) look like with 
> the new routes?
> /_ah/xmpp/message/chat/  ->  /comm/jabber
> /new-article  ->  /post/create
> /about  ->  /article/2010/07/11/welcome-to-my-world
> /article/2010/11/02/new-world-order  ->  
> /article?year=2010&month=11&day=02&title=new-world-order
> /article/2010/11  ->  /article?year=2010&month=11
> /author/smith  ->  /author?name=smith
> /publisher/smith/update  ->  /publisher-update?name=smith

In general, transformations like this will have to use the existing regex 
mechanism.

Are you actually using those transformations? If the path on the left is the 
incoming URI, I'm not making sense of the paths on the right; we need to 
convert a URI into /a/c/f... for routing purposes.

> 
> > I'll be checking in a new feature in a day or two that allows you to define 
> > app-specific routers in the root routes.py.
> 
> I thought the goal is per application routes control for better 
> modularity/portability of apps. If so, global route management should be 
> minial and limited to the mapping to applications only. I don't think any 
> local/per application rules should be there. What is the reason why in your 
> proposition e.g. controllers of the default app are specified in global 
> routes instead of having them in the local ones?

It's an option only, for those who want to define system routing centrally.

Re: [web2py] Re: BETA: new URL routing facility

2011-01-09 Thread Wikus van de Merwe
Jonathan, can you explain a bit more about how the new routes would work on 
some examples? How would the mappings below (just /c/f/args) look like with 
the new routes?
 /_ah/xmpp/message/chat/  ->  /comm/jabber
/new-article  ->  /post/create
/about  ->  /article/2010/07/11/welcome-to-my-world
/article/2010/11/02/new-world-order  ->  
/article?year=2010&month=11&day=02&title=new-world-order
/article/2010/11  ->  /article?year=2010&month=11
/author/smith  ->  /author?name=smith
/publisher/smith/update  ->  /publisher-update?name=smith

> I'll be checking in a new feature in a day or two that allows you to 
define app-specific routers in the root routes.py.

I thought the goal is per application routes control for better 
modularity/portability of apps. If so, global route management should be 
minial and limited to the mapping to applications only. I don't think any 
local/per application rules should be there. What is the reason why in your 
proposition e.g. controllers of the default app are specified in global 
routes instead of having them in the local ones?



[web2py] Re: Apache, Wsgi problem

2011-01-09 Thread Anthony
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 problem -- web2py is trying to do its own thing, and 
there is a vocal clique of "Pythonistas" who don't like that thing and want 
to stop it. They say things like "web2py is *seriously harmful*" and "join 
the rest of us" and claim by fiat that web2py is "not really a Python 
framework." They are the ones on a crusade -- to expunge the diversity that 
web2py brings to the Python web framework world. web2py is not trying to say 
Django, Pyramid, and Flask are doing things wrong and everyone should do 
things the web2py way -- it's just saying, hey, here's another way to do 
things, and if it suits you, use it. The reddit gang, on the other hand, is 
in fact trying to "convert the world" to the "one true way" of doing things. 
The reddit gang wants to impose purity and homogeneity -- web2py users just 
want to get things done (and are happy to let other people get things done 
however they want).
 

>  Django became popular on technical merit and because of easily accessible 
> good documentation, not because its community went around like  of church group> knocking on doors trying to convert people or arguing every 
> little minor technical point to try and win people other. That sort of 
> behaviour really reminds me of some new age christians I have known in the 
> past who just could not shut up in trying to make you believe what they 
> believed.
>
 
Perhaps I'm looking in the wrong places, but I haven't seen anyone pushing 
web2py in this way. In your tweet, you said, "web2py is appearing more and 
more look like a religious cult." Mere promotion is not what characterizes a 
cult. Companies advertise their products, and (I assume) you do not consider 
them to be religious cults simply because they're trying to convince people 
to buy those products. Massimo actively promotes web2py because he wants 
people to become aware of it, consider it, and benefit from it if it suits 
their needs and preferences. Otherwise, what was the point of creating it? 
When he promotes web2py, he provides detailed information and code samples. 
When people ask questions, he answers. When people make challenges, he 
engages them in constructive dialogue. You may think he does this too much, 
or not always in the most relevant places, but this is not cult-like 
behavior.
 
In fact, it could be argued that the reddit Pythonistas are the ones engaged 
in more cult-like behavior. Their creeds include "import this" and PEP 8. 
Sometimes they can be prone to extremism ("explicit is *better* than 
implicit" becomes "explicitness at all cost") -- often forgetting that their 
own creeds advise "practicality beats purity" and "a foolish consistency is 
the hobgoblin of little minds." They call for wayward frameworks to "join 
us." When challenged or pressed for evidence, they retreat to the safety of 
their like-minded peers, re-directing their frustrations to Twitter, where 
they know they cannot be challenged. Of course, they're not really a cult -- 
the point is, calling web2py a cult is a bit of a pot and kettle situation.
 
Anyway, I'm not sure, but I suspect the problem may simply be one of 
perspective. It appears the reddit guys are for the most part hard-core, 
committed, expert Python web programmers with a fair amount of personal 
investment (and identity) in Python web frameworks and the Python community. 
They have a particular way of doing things and a particular set of needs, 
and web2py just isn't their cup of tea. That's fine. The problem is, they 
may not be considering that there are other market segments (besides people 
like themselves) for Python web frameworks. They may not appreciate the 
diversity of needs, backgrounds, and preferences to which web frameworks may 
be targeted. They also spend a lot of time on reddit, so they end up seeing 
every mention of web2py. This may seem annoying to *them*, but again, they 
may not be considering that they're not the target of the message and that 
the reddit audience is much broarder than just them.
 

>   ...if you think the latest outburst about imports was some reaction 
> about web2py getting a tutorial accepted in PyCon as some like to think, you 
> are very sadly mistaken. They are more likely just a manifestation of this 
> frustration of having web2py shoved in your face one too many times 
> especially when muds gets thrown in your direction.
>
 
I wasn't aware anyone was thinking "the latest outburst" was a reaction to 
the web2py tutorial -- who is saying that? Also, in this particular case, 
the reddit OP specifically asked about web2py, so certainly nothing was 
being shoved in anyone's face. And I don't think I've seen web2py folks 
throwing mud at anyone (unless mere disagreement automatically equals mud).
 

>   
> So, it d

Re: [web2py] Re: Hassle-Free Application Hosting?

2011-01-09 Thread Bruno Rocha
2011/1/9 Syed 

> Is there a demand for a Heroku-like service in the web2py community?
> If there was a critical mass, I wonder if someone/firm could be
> convinced to build out this type of offering.


I sent a message to some services that are still in private beta, they
asnswered that they are going to support web2py.

http://stable.io/

http://www.ep.io/

I am in contact with the owners of nodegrid to include
web2py deployment, would be great to push my mercurial repository directly
into a running app.



-- 

Bruno Rocha
http://about.me/rochacbruno/bio


Re: [web2py] [Off Topic] Appreport plugin - helpers for PDF reports

2011-01-09 Thread Bruno Rocha
Great! It is very good to see new plugins for web2py, your appreport and
appscafold are very nice too.

plugin_appreport will be very useful

Thank you Lucas!


2011/1/9 Lucas D'Avila 

> I sent to github [1] a plugin called appreport, using helpers provided by
> the plugin is possible generate PDF reports and HTML forms (for emission of
> the reports).
>
>
> *Screencast demo *> http://vimeo.com/18601633
> *
> *
> *[1] Download, documentation and examples are available on the wiki* >
> https://github.com/lucasdavila/plugin-appreport/wiki
>
> --
> Lucas D'Avila
> http://flavors.me/lucasdavila
>
>


-- 

Bruno Rocha
http://about.me/rochacbruno/bio


[web2py] Re: ADVOCACY: "every single other Python program ever written uses imports"?

2011-01-09 Thread Anthony
On Sunday, January 9, 2011 4:49:45 PM UTC-5, pbreit wrote: 
>
> For one, I don't think businesses care much about backwards compatibility. 
> My experience in the enterprise was that vendors were constantly churning 
> out non-backwards-compatibile updates and customers were routinely several 
> versions behind.

 
Maybe they remain several versions behind because they don't want to keep 
dealing with backwards-incompatible upgrades (i.e., skip a few versions and 
just deal with an occasional big incompatible change). The cool thing about 
web2py is you can take advantage of every new feature that comes out (every 
couple weeks) without breaking your programs.


[web2py] Web2py templates for HamlPY

2011-01-09 Thread Dane
Hey all, thought you might be interested to know that I just patched a
project HamlPy, a library for converting a pythonic haml-like syntax
to django templates/html, to work with web2py templates.

It allows for a less crufty, indentation-based syntax. Because it's
indentation-based, {{ pass }} is no longer needed to close flow-
control statements, and blocks are self-closed. Overall I think it's a
much cleaner and quicker way of creating templates. And if you do want
to use traditional {{ }} syntax, you can also do that in the .hamlpy
files and they'll be converted as-is.

https://github.com/danenania/HamlPy

Hope someone gets some use out of this. My first real open source
effort!


[web2py] Re: Hassle-Free Application Hosting?

2011-01-09 Thread Syed
Is there a demand for a Heroku-like service in the web2py community?
If there was a critical mass, I wonder if someone/firm could be
convinced to build out this type of offering.


[web2py] Re: response.menu

2011-01-09 Thread Massimo Di Pierro
It is not used by the menu in the scaffolding app but it could be used
to highlight differently a menu item that is True (visited).

On Jan 9, 12:59 pm, Nathan George  wrote:
> I'm new to web2py and trying to set up my site from the beginning.  I
> was trying to customize my menu, and couldn't find any relevant
> documentation on response.menu.  For example, in the code:
>
> response.menu = [
>     (T('Home'), False, URL(request.application,'default','index'), [])
>     ]
>
> what is the 'False' for?  I changed it to 'True' and didn't really
> notice any difference...thanks.


[web2py] Re: Appreport plugin - helpers for PDF reports

2011-01-09 Thread Massimo Di Pierro
+1

On Jan 9, 5:14 pm, "Lucas D'Avila"  wrote:
> I sent to github [1] a plugin called appreport, using helpers provided by
> the plugin is possible generate PDF reports and HTML forms (for emission of
> the reports).
>
> *Screencast demo *>http://vimeo.com/18601633
> *
> *
> *[1] Download, documentation and examples are available on the wiki* 
> >https://github.com/lucasdavila/plugin-appreport/wiki
>
> --
> Lucas D'Avilahttp://flavors.me/lucasdavila


[web2py] [Off Topic] Appreport plugin - helpers for PDF reports

2011-01-09 Thread Lucas D'Avila
I sent to github [1] a plugin called appreport, using helpers provided by
the plugin is possible generate PDF reports and HTML forms (for emission of
the reports).


*Screencast demo *> http://vimeo.com/18601633
*
*
*[1] Download, documentation and examples are available on the wiki* >
https://github.com/lucasdavila/plugin-appreport/wiki

-- 
Lucas D'Avila
http://flavors.me/lucasdavila


[web2py] response.menu

2011-01-09 Thread Nathan George
I'm new to web2py and trying to set up my site from the beginning.  I
was trying to customize my menu, and couldn't find any relevant
documentation on response.menu.  For example, in the code:

response.menu = [
(T('Home'), False, URL(request.application,'default','index'), [])
]

what is the 'False' for?  I changed it to 'True' and didn't really
notice any difference...thanks.


[web2py] Re: ADVOCACY: "every single other Python program ever written uses imports"?

2011-01-09 Thread Mengu
as david said, play! destroyed the traditional java -web app-
programming. it doesn't use servlets so it is extremely flexible. it
doesn't use maven, it uses python. it doesn't use jsp views, it is
using a template system built with groovy, and so forth. there are
lots of people using play!, contributing to play! and supporting play!
they stand for it.

i do not support the elitist criticism on reddit against web2py. these
guys, especially armin*, have a thing against web2py for a long time
now. web2py is not a library, its a platform where and what people
build web applications with. however the criticism by thadeus must be
taken very seriously as he is one of the oldest, most experienced and
top contributed web2py users.

* i like armin's work, especially werkzeug and pygments. however
nothing more.

On Jan 9, 8:38 pm, David Marko  wrote:
> I really reminds me situation I started to work with PlayFramework a few
> years ago. Its excelent JAVA web framework, but its done in
> completely(internaly) different way than how the rest of the JAVA frameworks
> being  done(using standard servlet concept). The developers of Play! have a
> nice section on their site(under FAQ) called: "You guys don’t even know how
> to program in Java..." and they are trying to explain here why they did many
> things in a very different way in many areas that others describe as it is
> against a "good JAVA practices"
>
> http://www.playframework.org/documentation/1.1/faq
>
> David


Re: [web2py] Re: ADVOCACY: "every single other Python program ever written uses imports"?

2011-01-09 Thread Jonathan Lundell
On Jan 9, 2011, at 1:35 PM, Massimo Di Pierro wrote:
> 
> About "enterprise":
> 
> For me "enterprise" always meant "business and non-profit" as a way to
> emphasize "non-profit" since that is what I have major interest in. It
> looks like many people read "enterprise" as large and bloated
> businesses.

I think that's right, especially in the world of frameworks. The meaning of 
"enterprise" here has been established (polluted?) by Enterprise Java, which is 
a large and bloated framework (or pile of frameworks). (Java is the new Cobol.)

I understand what you mean by "enterprise", but it's definitely not what 
readers are going to understand.

At the moment, I don't have a better idea. But I'm sure we can come up with one.

> I have nothing against changing the slogan (and we have have a poll
> like we did for the logo) but I stand by original intention: web2py
> targets businesses and non-profits as opposed to the occasional
> hacker. I claim this because our goals are backward compatibility,
> easy of development and security. Other frameworks like those that
> require programming at the WSGI level and release a new version under
> a different name every six months, seem to target python experts with
> above average hacking abilities.
> 
> I also want to challenge the notion that I am the only web2py
> developer. If you look at commits in the last 6 months, there has been
> way more code contributed by Jonathan, for example, than by me. The
> new template.py was written entirely by Thadeus. A lof of the code
> from contrib was created by Mariano. It is true that I have know
> web2py longer than other and I may know some inner working details
> better than other, but for every web2py module, there is somebody who
> know is at least as well than me if not better.




Re: [web2py] Re: ADVOCACY: "every single other Python program ever written uses imports"?

2011-01-09 Thread Tom Atkins
web2py - the resilient web framework ;-)


Re: [web2py] Re: Running PHP on top of Web2Py

2011-01-09 Thread pbreit
I'm late to the party here but my sense is that you'll be best off just 
moving everything over. You mentioned that it's a content site with not a 
lot of traffic any a moderate amount of content. Sounds to me like you would 
have a relatively easy time moving it over than trying to cobble together 
some python/php frankenstein.

[web2py] Re: on a possible web2py memory leak

2011-01-09 Thread Massimo Di Pierro
It is a bit of a puzzle to me.

On Jan 9, 3:34 pm, Jonathan Lundell  wrote:
> On Jan 9, 2011, at 1:20 PM, Massimo Di Pierro wrote:
>
>
>
> > correct.
>
> Isn't the need to call gc.collect() explicitly a bit of a puzzle? Or is it 
> just speeding up something that would happen eventually?
>
>
>
>
>
>
>
>
>
> > On Jan 9, 1:18 pm, Anthony  wrote:
> >> On Sunday, January 9, 2011 12:59:47 AM UTC-5, ron_m wrote:
>
> >>> To get the leak the __del__method has to be in the class. The gc.collect()
> >>> as suggested by Massimo cured the leak for the exec code case I believe
> >>> because gc.collect() runs a test on the objects to see if there are any
> >>> external references, finds none, and therefore allows them to be removed
> >>> from the heap.
>
> >> Sorry if I'm being dense, but to be clear, the leak can happen with exec
> >> even if the class does not have a __del__ method (i.e., web2py's case), and
> >> that kind of leak can be prevented using gc.collect (the recent fix put 
> >> into
> >> place). However, if the class has a __del__ method, you get a leak even if
> >> exec is not being used, and that kind of leak is not resolved by 
> >> gc.collect.
> >> Is that right?


[web2py] Re: ADVOCACY: "every single other Python program ever written uses imports"?

2011-01-09 Thread pbreit
It might make sense to dropt "enterprise" from the slogan. For one, I don't 
think businesses care much about backwards compatibility. My experience in 
the enterprise was that vendors were constantly churning out 
non-backwards-compatibile updates and customers were routinely several 
versions behind.

I also don't think "enterprise" suggests "non-profit". Perhaps the opposite, 
even.

Finally, I think it's fine to attract the "hacker" audience.


[web2py] Re: ADVOCACY: "every single other Python program ever written uses imports"?

2011-01-09 Thread pbreit
Interesting points. One thing I don't understand is the objection to the web 
IDE since it is 100% optional. Could it be presented differently so that 
people understand that instantly?

I like the commitment to backwards compatibility. Are there any good 
examples of things that would be worth changing or adding that would break 
backwards compatibility? A subtle but significant benefit of backwards 
compatibility is that it forces restraint and good design.


[web2py] Re: ADVOCACY: "every single other Python program ever written uses imports"?

2011-01-09 Thread Massimo Di Pierro
About "enterprise":

For me "enterprise" always meant "business and non-profit" as a way to
emphasize "non-profit" since that is what I have major interest in. It
looks like many people read "enterprise" as large and bloated
businesses.
I have nothing against changing the slogan (and we have have a poll
like we did for the logo) but I stand by original intention: web2py
targets businesses and non-profits as opposed to the occasional
hacker. I claim this because our goals are backward compatibility,
easy of development and security. Other frameworks like those that
require programming at the WSGI level and release a new version under
a different name every six months, seem to target python experts with
above average hacking abilities.

I also want to challenge the notion that I am the only web2py
developer. If you look at commits in the last 6 months, there has been
way more code contributed by Jonathan, for example, than by me. The
new template.py was written entirely by Thadeus. A lof of the code
from contrib was created by Mariano. It is true that I have know
web2py longer than other and I may know some inner working details
better than other, but for every web2py module, there is somebody who
know is at least as well than me if not better.

Massimo

On Jan 9, 1:46 pm, VP  wrote:
> >>I think web2py is very good for 'Corporate' and 'Enterprise', but perhaps we
> >>need to be less pretentious and change the slogan for something like:
> >>web2py - the getting things done web framework
>
> I know much less about web2py than most people here, but I feel
> compelled to add an opinion. There are many different things that are
> touched upon in this thread.
>
> First is the slogan of web2py.  I think the word "enterprise" is a
> mistake.  But at the same time, the attacks that center around this
> word is very unjustified.   For the sake of comparison, let's take a
> look at the Django's slogan: Webframework for perfectionists with
> deadlines.  Now, you can easily attack this slogan in much the same
> ways people have attacked Web2py.  But most people don't do that.
> Massimo is not great at PR, so his PR approach is easily prone to
> attack.  But at the same time, a slogan is just a slogan.  And yet
> people unfairly focused on a little slogan repeatedly.  That's utterly
> unfair.
>
> Second, let's talk about what it means to be "enterprise".  I think a
> many people tend to make this type of reasoning:  (1) I am doing real
> work, (2) this tool isn't quite the best thing for this work, (3)
> therefore, it is not "real" (enterprise).   I do not agree with this
> line of reasoning.  A tool, any tool, has its limitations and within
> its boundary of effectiveness it can be as real as any other tool.
> Drupal, for example, has been used extensively in many big companies
> to do real things.  And yet, Drupal, at its heart, is a CMS, and
> therefore is not as flexible as something like a webframework.  As
> such the domain of effectiveness of a CMS is smaller than that of a
> webframework.  But when people need to build CMS, Drupal is very
> effective and *real*.
>
> The right word, I think, is "generality".   A full stack webframework
> like web2py is more general than a CMS like Drupal.  Thus, it can do
> more things.  Something like Flask is not a full-stack framework, as
> such, it makes fewer assumptions, and it is more general than a full-
> stack framework.  At the same time, it doesn't have as much
> batteries.  And many will find a full-stack framework more useful in
> that regards.
>
> So to say that because you can not import pieces of a model into an
> app, therefore web2py is inappropriate for enterprise, is not right.
> I think many enterprise apps do not have to have highly connected
> models.  There  are many other dimensions that are important with
> respect to what it means to be enterprise, such as scalability,
> maintainability, etc.   And I think that web2py still needs to be
> proven in this regards.
>
> And third, there's a criticism that the internals of web2py is a
> mess.  That might or might not be true.  There are a few things I'd
> like to say in this regards.  First, from a user's point of view, this
> criticism is not very interesting.  But this criticism implies
> indirectly a few things, such as there are many bugs; or it's not easy
> to add features to web2py.   From an outsider's point of view, this is
> what I see.   In terms of man power, web2py has fewer than Django.  I
> think Flask also has a decent number of developers working on it.
> Web2py has mainly Massimo, who wears many hats; plus maybe 2, 3 other
> people putting a lot of time into it.   And yet, you look at features,
> there's not much Django has that Web2py doesn't have.   Another thing
> that adding features to Web2py is quite quick.  This is what I often
> see around here.  When someone has an idea, Massimo often does it
> right away.   Recently, it took a relatively quick effort for Massimo
> (and probably a han

Re: [web2py] Re: on a possible web2py memory leak

2011-01-09 Thread Jonathan Lundell
On Jan 9, 2011, at 1:20 PM, Massimo Di Pierro wrote:
> 
> correct.

Isn't the need to call gc.collect() explicitly a bit of a puzzle? Or is it just 
speeding up something that would happen eventually?

> 
> On Jan 9, 1:18 pm, Anthony  wrote:
>> On Sunday, January 9, 2011 12:59:47 AM UTC-5, ron_m wrote:
>> 
>>> To get the leak the __del__method has to be in the class. The gc.collect()
>>> as suggested by Massimo cured the leak for the exec code case I believe
>>> because gc.collect() runs a test on the objects to see if there are any
>>> external references, finds none, and therefore allows them to be removed
>>> from the heap.
>> 
>> Sorry if I'm being dense, but to be clear, the leak can happen with exec
>> even if the class does not have a __del__ method (i.e., web2py's case), and
>> that kind of leak can be prevented using gc.collect (the recent fix put into
>> place). However, if the class has a __del__ method, you get a leak even if
>> exec is not being used, and that kind of leak is not resolved by gc.collect.
>> Is that right?




Re: [web2py] Re: ADVOCACY: "every single other Python program ever written uses imports"?

2011-01-09 Thread pbreit
I don't buy the problem with integrating enterprise systems. Components 
should be more loosely coupled.

I do wonder about the balance between the features that make Web2py great 
for rapid prototyping vs what you would need to do "in the real world". But 
it seems to me that the productivity features are not required and that 
Web2py offers sufficient flexibility.

I'm not experienced enough to weigh-in on the functional vs object 
programming discussion.


[web2py] Re: Drupal alternatives in Python or web2py

2011-01-09 Thread ma...@rockiger.com
Of course digg into Drupal, it is one of the best CMS out there.



[web2py] Re: on a possible web2py memory leak

2011-01-09 Thread Massimo Di Pierro
correct.

On Jan 9, 1:18 pm, Anthony  wrote:
> On Sunday, January 9, 2011 12:59:47 AM UTC-5, ron_m wrote:
>
> > To get the leak the __del__method has to be in the class. The gc.collect()
> > as suggested by Massimo cured the leak for the exec code case I believe
> > because gc.collect() runs a test on the objects to see if there are any
> > external references, finds none, and therefore allows them to be removed
> > from the heap.
>
> Sorry if I'm being dense, but to be clear, the leak can happen with exec
> even if the class does not have a __del__ method (i.e., web2py's case), and
> that kind of leak can be prevented using gc.collect (the recent fix put into
> place). However, if the class has a __del__ method, you get a leak even if
> exec is not being used, and that kind of leak is not resolved by gc.collect.
> Is that right?


Re: [web2py] Re: ADVOCACY: "every single other Python program ever written uses imports"?

2011-01-09 Thread Thadeus Burgess
I think Massimo hit it on the spot. Its about coding style. Most of the
people I see giving web2py criticism are young. Considering that beginning
in about 2001 colleges starting only teaching java and handing out degrees,
it might be safe to assume that most of these guys knew Java as their first
language.  Not to mention that someone who went to school for 4 years for
software engineering will have been uniquely tuned to a specific coding
style (object oriented).

I like web2py, and I do have uses for it on a daily basis to accomplish real
world work. I use web2py alot to provide a web based access to automating
statistical analysis. Usually these type of apps need to change often and
can even change drastically, which is why I like web2py for them.

--
Thadeus




On Sun, Jan 9, 2011 at 1:46 PM, VP  wrote:

> >>I think web2py is very good for 'Corporate' and 'Enterprise', but perhaps
> we
> >>need to be less pretentious and change the slogan for something like:
>
> >>web2py - the getting things done web framework
>
> I know much less about web2py than most people here, but I feel
> compelled to add an opinion. There are many different things that are
> touched upon in this thread.
>
> First is the slogan of web2py.  I think the word "enterprise" is a
> mistake.  But at the same time, the attacks that center around this
> word is very unjustified.   For the sake of comparison, let's take a
> look at the Django's slogan: Webframework for perfectionists with
> deadlines.  Now, you can easily attack this slogan in much the same
> ways people have attacked Web2py.  But most people don't do that.
> Massimo is not great at PR, so his PR approach is easily prone to
> attack.  But at the same time, a slogan is just a slogan.  And yet
> people unfairly focused on a little slogan repeatedly.  That's utterly
> unfair.
>
> Second, let's talk about what it means to be "enterprise".  I think a
> many people tend to make this type of reasoning:  (1) I am doing real
> work, (2) this tool isn't quite the best thing for this work, (3)
> therefore, it is not "real" (enterprise).   I do not agree with this
> line of reasoning.  A tool, any tool, has its limitations and within
> its boundary of effectiveness it can be as real as any other tool.
> Drupal, for example, has been used extensively in many big companies
> to do real things.  And yet, Drupal, at its heart, is a CMS, and
> therefore is not as flexible as something like a webframework.  As
> such the domain of effectiveness of a CMS is smaller than that of a
> webframework.  But when people need to build CMS, Drupal is very
> effective and *real*.
>
> The right word, I think, is "generality".   A full stack webframework
> like web2py is more general than a CMS like Drupal.  Thus, it can do
> more things.  Something like Flask is not a full-stack framework, as
> such, it makes fewer assumptions, and it is more general than a full-
> stack framework.  At the same time, it doesn't have as much
> batteries.  And many will find a full-stack framework more useful in
> that regards.
>
> So to say that because you can not import pieces of a model into an
> app, therefore web2py is inappropriate for enterprise, is not right.
> I think many enterprise apps do not have to have highly connected
> models.  There  are many other dimensions that are important with
> respect to what it means to be enterprise, such as scalability,
> maintainability, etc.   And I think that web2py still needs to be
> proven in this regards.
>
>
> And third, there's a criticism that the internals of web2py is a
> mess.  That might or might not be true.  There are a few things I'd
> like to say in this regards.  First, from a user's point of view, this
> criticism is not very interesting.  But this criticism implies
> indirectly a few things, such as there are many bugs; or it's not easy
> to add features to web2py.   From an outsider's point of view, this is
> what I see.   In terms of man power, web2py has fewer than Django.  I
> think Flask also has a decent number of developers working on it.
> Web2py has mainly Massimo, who wears many hats; plus maybe 2, 3 other
> people putting a lot of time into it.   And yet, you look at features,
> there's not much Django has that Web2py doesn't have.   Another thing
> that adding features to Web2py is quite quick.  This is what I often
> see around here.  When someone has an idea, Massimo often does it
> right away.   Recently, it took a relatively quick effort for Massimo
> (and probably a handful of other people) to rewrite DAL
> completely. Now, going back to the criticism that Web2py's
> internal is real bad.  I am very reluctant to believe that is the
> case, given all of these I have seen and experienced around here.
>
>
> Having said this, I don't think I am a web2py zealous fan.  Trust me,
> if there are better frameworks, I'd jump in a second.  I have perused
> the Flask/Bottle/Django documentations countless of times, and each
> time, I just deci

[web2py] Re: ADVOCACY: "every single other Python program ever written uses imports"?

2011-01-09 Thread VP
>>I think web2py is very good for 'Corporate' and 'Enterprise', but perhaps we
>>need to be less pretentious and change the slogan for something like:

>>web2py - the getting things done web framework

I know much less about web2py than most people here, but I feel
compelled to add an opinion. There are many different things that are
touched upon in this thread.

First is the slogan of web2py.  I think the word "enterprise" is a
mistake.  But at the same time, the attacks that center around this
word is very unjustified.   For the sake of comparison, let's take a
look at the Django's slogan: Webframework for perfectionists with
deadlines.  Now, you can easily attack this slogan in much the same
ways people have attacked Web2py.  But most people don't do that.
Massimo is not great at PR, so his PR approach is easily prone to
attack.  But at the same time, a slogan is just a slogan.  And yet
people unfairly focused on a little slogan repeatedly.  That's utterly
unfair.

Second, let's talk about what it means to be "enterprise".  I think a
many people tend to make this type of reasoning:  (1) I am doing real
work, (2) this tool isn't quite the best thing for this work, (3)
therefore, it is not "real" (enterprise).   I do not agree with this
line of reasoning.  A tool, any tool, has its limitations and within
its boundary of effectiveness it can be as real as any other tool.
Drupal, for example, has been used extensively in many big companies
to do real things.  And yet, Drupal, at its heart, is a CMS, and
therefore is not as flexible as something like a webframework.  As
such the domain of effectiveness of a CMS is smaller than that of a
webframework.  But when people need to build CMS, Drupal is very
effective and *real*.

The right word, I think, is "generality".   A full stack webframework
like web2py is more general than a CMS like Drupal.  Thus, it can do
more things.  Something like Flask is not a full-stack framework, as
such, it makes fewer assumptions, and it is more general than a full-
stack framework.  At the same time, it doesn't have as much
batteries.  And many will find a full-stack framework more useful in
that regards.

So to say that because you can not import pieces of a model into an
app, therefore web2py is inappropriate for enterprise, is not right.
I think many enterprise apps do not have to have highly connected
models.  There  are many other dimensions that are important with
respect to what it means to be enterprise, such as scalability,
maintainability, etc.   And I think that web2py still needs to be
proven in this regards.


And third, there's a criticism that the internals of web2py is a
mess.  That might or might not be true.  There are a few things I'd
like to say in this regards.  First, from a user's point of view, this
criticism is not very interesting.  But this criticism implies
indirectly a few things, such as there are many bugs; or it's not easy
to add features to web2py.   From an outsider's point of view, this is
what I see.   In terms of man power, web2py has fewer than Django.  I
think Flask also has a decent number of developers working on it.
Web2py has mainly Massimo, who wears many hats; plus maybe 2, 3 other
people putting a lot of time into it.   And yet, you look at features,
there's not much Django has that Web2py doesn't have.   Another thing
that adding features to Web2py is quite quick.  This is what I often
see around here.  When someone has an idea, Massimo often does it
right away.   Recently, it took a relatively quick effort for Massimo
(and probably a handful of other people) to rewrite DAL
completely. Now, going back to the criticism that Web2py's
internal is real bad.  I am very reluctant to believe that is the
case, given all of these I have seen and experienced around here.


Having said this, I don't think I am a web2py zealous fan.  Trust me,
if there are better frameworks, I'd jump in a second.  I have perused
the Flask/Bottle/Django documentations countless of times, and each
time, I just decided they do not yet have what I want.   Further,
there are a few things I still wish web2py do better.  Frankly, one of
the design decision that I do not care for too much is the web IDE and
backward compatibility (which I think is useful but should not be an
absolute).

I am looking forward to web3py.  I hope Massimo starts this right
away, drawing lessons from web2py and other frameworks.












[web2py] Re: on a possible web2py memory leak

2011-01-09 Thread Anthony
On Sunday, January 9, 2011 12:59:47 AM UTC-5, ron_m wrote: 
>
> To get the leak the __del__method has to be in the class. The gc.collect() 
> as suggested by Massimo cured the leak for the exec code case I believe 
> because gc.collect() runs a test on the objects to see if there are any 
> external references, finds none, and therefore allows them to be removed 
> from the heap.

 
Sorry if I'm being dense, but to be clear, the leak can happen with exec 
even if the class does not have a __del__ method (i.e., web2py's case), and 
that kind of leak can be prevented using gc.collect (the recent fix put into 
place). However, if the class has a __del__ method, you get a leak even if 
exec is not being used, and that kind of leak is not resolved by gc.collect. 
Is that right? 


Re: [web2py] Re: ADVOCACY: "every single other Python program ever written uses imports"?

2011-01-09 Thread David Marko
I really reminds me situation I started to work with PlayFramework a few 
years ago. Its excelent JAVA web framework, but its done in 
completely(internaly) different way than how the rest of the JAVA frameworks 
being  done(using standard servlet concept). The developers of Play! have a 
nice section on their site(under FAQ) called: "You guys don’t even know how 
to program in Java..." and they are trying to explain here why they did many 
things in a very different way in many areas that others describe as it is 
against a "good JAVA practices"

http://www.playframework.org/documentation/1.1/faq 

David


Re: [web2py] Re: OFF TOPIC: Best way to get the mouse position.

2011-01-09 Thread Jason Brower
Thanks, I didn't know jqueryui has it, I will try that first.  
Processing looks really cool for some other things I have been wanted to 
do, but then I feel like a 2d graphics programmer at that point.

Best Regards,
Jason Brower

On 01/09/2011 08:14 PM, ron_m wrote:
jQueryUI has the Position utility if you are already using that 
Javascript library


http://jqueryui.com/demos/position/

The demo is a little different as in odd, they are positioning 2 boxes 
relative another based on the user moving one of them so I had to 
unwind from that a bit to get something that worked for me.


If you are dropping a pin on a map then look at the Draggable 
interaction for picking up the event.




[web2py] Re: OFF TOPIC: Best way to get the mouse position.

2011-01-09 Thread ron_m
jQueryUI has the Position utility if you are already using that Javascript 
library

http://jqueryui.com/demos/position/

The demo is a little different as in odd, they are positioning 2 boxes 
relative another based on the user moving one of them so I had to unwind 
from that a bit to get something that worked for me.

If you are dropping a pin on a map then look at the Draggable interaction 
for picking up the event.


Re: [web2py] Re: ADVOCACY: "every single other Python program ever written uses imports"?

2011-01-09 Thread Kuba Kucharski
Bruno, Pbreit, the discussion was starting to get really interesting,
please don't let it go OT


Re: [web2py] Re: ADVOCACY: "every single other Python program ever written uses imports"?

2011-01-09 Thread Bruno Rocha
2011/1/9 pbreit 

> So I guess the question remains: is Web2py suitable for large, public web
> sites or does it max out as a rapid prototyper and smaller "intranet" type
> sites?



http://www.web2py.com/poweredby (this site has not every web2py powered site
around the globe, people needs to update)

To point few of these sites:
SahanaEden, RadBox, TenthRow, Ru.ly, Campus
Online, Latinux, Paraiba Brazilian State Government, NatalAnimal (My non
profit e-commerce like website),

The list above is not about prototype or intranet websites.

Also, at my tiny company ( blouweb.com ) we are working only with web2py
development, in one year of existence we are making our lives working only
with web2py (developing and training)

Besides the public websites and intranets, we are developing some corporate
systems. Some of them are in production already, for more than 6 months and
we are having a great experience.

I also working a lot giving web2py classes (in-company) , and for example
one of the biggest state-company of Brazil are getting trained and
developing internal solutions with web2py.

Now, we are in the way to sign a contract to develop a financial system for
one of the São Paulo stock-exchange companies.

I think web2py is very good for 'Corporate' and 'Enterprise', but perhaps we
need to be less pretentious and change the slogan for something like:

web2py - the getting things done web framework


-- 

Bruno Rocha
http://about.me/rochacbruno/bio


[web2py] Re: ADVOCACY: "every single other Python program ever written uses imports"?

2011-01-09 Thread Massimo Di Pierro
I do not think this discussion has anything to do with it. This is a
scalability issue and web2py scales as well as any of the other web
frameworks. The issue is whether people like or not the programming
style. If you like it you use web2py. If you do not like it you use
something else.

On Jan 9, 11:24 am, pbreit  wrote:
> So I guess the question remains: is Web2py suitable for large, public web
> sites or does it max out as a rapid prototyper and smaller "intranet" type
> sites?


[web2py] Re: Apache, Wsgi problem

2011-01-09 Thread VP
It is indeed the case that there was a segmentation fault, reported in
apache error log.

Perhaps, it's not clear, but this problem occurs under posgres under
debian lenny, not sqlite.  I am not running web2py as a CGI script.  I
am using the web2py deployment script (for setting up apache and
web2py):


  WSGIDaemonProcess web2py user=myusername group=myusername \
   display-name=%{GROUP}
  WSGIProcessGroup web2py
  WSGIScriptAlias / /home/myusername/web2py/wsgihandler.py





On Jan 8, 9:59 pm, Graham Dumpleton 
wrote:
> You were possibly using a an old version of sqlite which isn't safe to use
> in a multithreaded configuration.
>
> The MPM settings are not going to help in this case as that error could only
> come about because you are using mod_wsgi daemon mode and so application is
> running in distinct process and not those affected by the MPM or its
> settings.
>
> The only other way you could get that error is that you are actually running
> web2py as a CGI script.
>
> Overall, that specific error message means your daemon mode process that is
> running web2py crashed. You would likely find that there is a segmentation
> fault messages in main Apache error log as well at that time.
>
> Crashing could be because of sqlite thread problems, but could also be
> because you are forcing web2py to run in main interpreter of daemon
> processes and at the same time are using a third party C extension module
> for Python that is not safe for use in sub interpreters.
>
> So, ensure sqlite is up to date. And ensure that you have:
>
>   WSGIApplicationGroup %{GLOBAL}
>
> in configuration to force use of main interpreter.
>
> Graham
>
> On Sunday, January 9, 2011 6:44:14 AM UTC+11, VP wrote:
>
> > We occasionally got an Apache error so the page didn't get displayed.
> > So I decided to stress test using Apache Bench (ab).  It seems the
> > site suffered failure up to 50-100 concurrent connection.
>
> > Apache error log showed this error:
>
> > >>Premature end of script headers: wsgihandler.py
>
> > After digging around, I found similar discussions and change
> > apache2.conf like this:
>
> > # prefork MPM
> > StartServers 5
> > MinSpareServers 5
> > MaxSpareServers 10
> > MaxClients 256
> > MaxRequestsPerChild 500
> > ServerLimit 256
>
> > Didn't seem to help.
>
> > 
>
> > A few notes:
>
> > + It appears when I switched to sqlite instead of posgres, I didn't
> > have the problem.   (Sqlite had other problems, such as occasional
> > database locking, which is more serious)
>
> > + I am on a VPS with 768MB with 1GB burstable.   While I'm doing the
> > stress test with Apache Bench (ab), using free on the server revealed
> > memory usage was about 450MB.  (Which is a lot, but is still under
> > limit).
>
> > =
>
> > In summary, memory was available.   But we got this wsgi error in
> > Apache with multiple requests.
>
> > Any idea please?
>
> > Thanks.
>
>


[web2py] Re: ADVOCACY: "every single other Python program ever written uses imports"?

2011-01-09 Thread pbreit
So I guess the question remains: is Web2py suitable for large, public web 
sites or does it max out as a rapid prototyper and smaller "intranet" type 
sites?

Re: [web2py] Hassle-Free Application Hosting?

2011-01-09 Thread Bruno Rocha
For me, the best Easy, Rapid and Manageable web2py shared host is
webfaction, I have my apps running for U$14 a month.

for VPS solution I am testing this: http://www.nodegrid.com/?cmd=cart , they
have plans that you pay by daily or hourly of use, I can setup my ubuntu
machine, run anything I need and pay $1.3 a day. Or I can pay only for the
'uptime' of the machine.
-- 

Bruno Rocha
http://about.me/rochacbruno/bio


Re: [web2py] Hassle-Free Application Hosting?

2011-01-09 Thread pbreit
If you use Google Chrome, it will prompt to translate the page for you.

The Always Data pages translate fairly well and many on the Always Data 
forums speak English including the very helpful AD rep Cyril.


Re: [web2py] Hassle-Free Application Hosting?

2011-01-09 Thread pbreit
DotCloud looks very promising (Bruno, how'd you get your invite??).

I dabbled with AlwaysData for a bit which is a nice free option.

If you are considering it at all, I would highly suggest running a cloud 
server. It's not as difficult as it may seem and can be quite inexpensive 
($10-12/month). I tried Amazon which is fine and am now using RackSpace 
Cloud. There are scripts and Slices available to get you up and running (I 
prefer Ubuntu 10.04 distro). I was fairly inexperienced when I started and 
have managed to get servers up and running without much difficulty.


Re: [web2py] Hassle-Free Application Hosting?

2011-01-09 Thread Bruno Rocha
This post helps too: http://forum.alwaysdata.com/viewtopic.php?id=1081 (google
translate it)

2011/1/9 Bruno Rocha 

>
>> hello Bruno,
>> do have an easy recipy to setup a web2py site on alwaysdata ?
>> (deploying is one of the scaring tasks for beginners)
>>
>> thanks,
>> Stef
>>
>>
>>
> Its in French ->
> http://wiki.alwaysdata.com/wiki/D%C3%A9ployer_une_application_web2py
>
> a
> little outdated, needs to test if this still works.
>
> --
>
> Bruno Rocha
> http://about.me/rochacbruno/bio
>



-- 

Bruno Rocha
http://about.me/rochacbruno/bio


Re: [web2py] Hassle-Free Application Hosting?

2011-01-09 Thread Bruno Rocha
>
>
> hello Bruno,
> do have an easy recipy to setup a web2py site on alwaysdata ?
> (deploying is one of the scaring tasks for beginners)
>
> thanks,
> Stef
>
>
>
Its in French ->
http://wiki.alwaysdata.com/wiki/D%C3%A9ployer_une_application_web2py

a
little outdated, needs to test if this still works.

-- 

Bruno Rocha
http://about.me/rochacbruno/bio


Re: [web2py] Hassle-Free Application Hosting?

2011-01-09 Thread Stef Mientki
On 09-01-2011 16:21, Bruno Rocha wrote:
> I am playing with free beta on dotcloud (this will be great).
>
> for free that runs web2py I just know one (shared limited plan is free):
>
> http://www.alwaysdata.com/plans/shared/
>
> http://web2py.alwaysdata.net/examples

hello Bruno,
do have an easy recipy to setup a web2py site on alwaysdata ?
(deploying is one of the scaring tasks for beginners)

thanks,
Stef

> BTW, I do not know any other that works like heroku.
>
> 2011/1/9 Syed mailto:syed.f.ka...@gmail.com>>
>
> Are there any application hosting services for web2py that are similar
> to the following (for other frameworks):
>
> Heroku for Ruby on Rails
> Djangy for Django
> Pantheon for Drupal
>
> I know that it's possible to use GAE for hosting, but there are some
> limitations to going that route. I understand that Webfaction offers
> hosting, but it's just normal shared hosting, right? It would be great
> if there was a fire-and-forget application hosting option for web2py
> just like Heroku or Engine Yard.
>
>
>
>
> -- 
>
> Bruno Rocha
> http://about.me/rochacbruno/bio



[web2py] Re: OFF TOPIC: Best way to get the mouse position.

2011-01-09 Thread Massimo Di Pierro
If you use processing.js you can use mouseX and mouseY

On Jan 9, 9:05 am, Jason Brower  wrote:
> I am wanted to create a tool that can map points in an image. (Basically
> pins on a map.)  I thought it best to overly the image with a dive and
> get the position in the div. (Somehow...)
> Any ideas on how to best do that, and are there any examples that I
> could look at?
> Best regards,
> Jason


[web2py] Re: ADVOCACY: "every single other Python program ever written uses imports"?

2011-01-09 Thread Massimo Di Pierro
This is my prospective: Everything has a trade off. We want the
ability to edit files via the web interface and see the effect of the
change immediately, even on a production system using apache. That is
not possible using imports. Django and Flask provide a module reload
mechanism. That works only if/when they use a python based web server
(not  production solution) and it can lead to problems.

If we did not execute models/controllers at every request something
like this:

   db.define_table('table',Field('field',default=request.now))

would not work any more because the define would be executed only once
before the http request exists. request.now would have to a lazy
object (thus introducing complexity) or moved to every action that
needs it (this introducing repetition).

Thanks to your work (Thadeus) about template.py and the new dal, most
of web2py modules can now be used with other frameworks.

If you do not want the web2py way (i.e. models/controllers are not
modules), you can still use all of the web2py helpers, validators,
dal, template language, etc with the dispatcher of any other
frameworks.

The current design is not an accident. It was a choice to
differentiate from what others do.

This forum is about web2py and web2py is defined by its current
design. Changing that design would break backward compatibility and it
would not be web2py any more.

As I said multiple times, there may be a web3py and it may very well
have a different architecture. Although for me the issue is not
whether to use exec or not. The issue is whether to use Python at all
given its scalability problems on multicore and the lack of a proper
garbage collection. I am very much open to a discussion on web3py (it
is inevitable since python 3.x broke backward compatibility anyway)
but I am not sure it belongs to this mailing list.

Massimo





On Jan 9, 4:41 am, Thadeus Burgess  wrote:
> I believe this is why web2py receives much criticism. I speak from
> experience in using (and contributing to) web2py.
>
> web2py cannot share objects in an importable namespace with other python
> applications ecause of its design architecture. This is an absolute
> requirement for most "enterprise" or "real world" applications.
>
> Two examples. (however there are many more than I have time to iterate over)
>
> Exhibit A: Multiple websites that share some or all database models and
> utility functions. A public site may use only some of the models needed for
> say user signup, and a dashboard that may be IP restricted for internal use
> only.
> Exhibit B: Must share database models with stand alone python programs. A
> long running process that sits in the background, but needs access to the
> database.
>
> web2py cannot do either of these, and unless web2py uses import it will
> never be able to. Currently, to accomplish exhibit A or B, code
> spaghetti-fication must occur, and maintainance of model definitions in
> multiple places now becomes a royal pain in the ass. That or you must use
> some of the other many (unprofessional, hard to maintain) hacks just to work
> around this limitation.
>
> With other frameworks, such as flask/sqlalchemy it is a python program like
> anything else. You can do "from dashboard.models import person". You only
> maintain one model, but you can use it in all applications that may need it,
> since you can easy_install your site into a virtualenv.
>
> Another issue that I have ran into more often than not is the limitations in
> the web2py core. Certain things (like SQLForm, auth, sessions, etc) are
> great for rapid prototyping, but when you actually need to do something
> "real" with them, they just get in the way. For example, a form that has a
> subform or a built in subtable (like a form you might build in Access), or
> cookie stored sessions for scalability. Again, these are just simple
> examples when the real world implementation is much more complex.
>
> Another problem that the current design of web2py inherently brings is it
> enforces a functional programming style. You can use classes, but then you
> end up having to throw pointers around of your basic objects (db, session,
> etc). Using classes the way they are designed to be used with a normal
> object lifecycle (imported, instantiated, etc...) is extemely difficult to
> do in web2py. There is nothing wrong with functional programming, but the
> code can easily become a mess even if you are a good programmer.
>
> Just to give an example of how amazing a class based system is, I re-wrote
> appadmin for Flask+SQLAlchemy+WTForms in 80 lines of python code, with
> pagination, searching, creating, updating, and deleting. Think of how
> maintainable that is. I don't even know what is going on inside of web2pys
> appadmin... I try to stay away from it *wink*.
>
> One of the biggest arguments vs other frameworks is the speed of development
> time of a web2py app vs other framework. I disagree with this, I am usually
> able to add new features to my

Re: [web2py] Hassle-Free Application Hosting?

2011-01-09 Thread Bruno Rocha
I am playing with free beta on dotcloud (this will be great).

for free that runs web2py I just know one (shared limited plan is free):

http://www.alwaysdata.com/plans/shared/


http://web2py.alwaysdata.net/examples

BTW, I do not know any other that
works like heroku.

2011/1/9 Syed 

> Are there any application hosting services for web2py that are similar
> to the following (for other frameworks):
>
> Heroku for Ruby on Rails
> Djangy for Django
> Pantheon for Drupal
>
> I know that it's possible to use GAE for hosting, but there are some
> limitations to going that route. I understand that Webfaction offers
> hosting, but it's just normal shared hosting, right? It would be great
> if there was a fire-and-forget application hosting option for web2py
> just like Heroku or Engine Yard.
>
>


-- 

Bruno Rocha
http://about.me/rochacbruno/bio


[web2py] Re: Apache, Wsgi problem

2011-01-09 Thread Massimo Di Pierro
For the record. I do not think I never said my viewpoint is the best.
I do not recall other people of this list doing it either. I just
state my viewpoint. I usually limit myself to one of the follow:

- mention web2py in a thread related to web frameworks
- provide an example of how web2py does things vs how others do things
- defend the web2py way against attacks by "competitors"

Personally, I never find annoying when people talk about their own
work and I do expect people to be enthusiastic and promote their work.
I want to know what other people do because I can learn from it. I
also do not find annoying when other people provide a technical
argument of why something is - in their view - wrong. For example
mitsuhiko showing that exec can lead to a memory leak allows us to
address the issue in a technical. He is not diplomatic (should post
bug reports in the appropriate channels) but I have learned from him
posts in the past. What I do find annoying is people claiming that
program X - open source - if harmful to the python community because
it is different. I guess Python is harmful to the C# community and by
rule of majority we should not use it.

Massimo

On Jan 9, 1:21 am, Graham Dumpleton 
wrote:
> On Sunday, January 9, 2011 6:05:16 PM UTC+11, Massimo Di Pierro wrote:
>
> > Graham. We all appreciate your expertise here and appreciate people
> > who say what they think. Perhaps diplomacy is not our strength. You do
> > not need to justify your tweet. I though it was funny because - in my
> > view - it would apply equally well to some of the other frameworks.
>
> Yes, there is at least one other web framework which I find a bit annoying
> as far as people associated with it pushing that their viewpoint is the
> best. They generally keep to themselves though. And no that other framework
> isn't Django. I have always found people in Django community quite open and
> pleasant to deal with and I wouldn't take the momentary frustrated outbursts
> of one individual as saying too much about the community as a whole.
>
> No matter what the framework, one can always come across specific
> individuals which are quite extreme in their views and try to monopolise a
> situation and so can be difficult to deal with. I am sure you have possibly
> seen that at times on the Python WEB-SIG. I am even guilty of it some times,
> especially when I have got frustrated because of stuff being hijacked all
> the time. :-(
>
> Graham
>
>
>
>
>
>
>
> > On Jan 9, 12:24 am, Graham Dumpleton 
> > wrote:
> > > On Sunday, January 9, 2011 3:54:37 PM UTC+11, Anthony wrote:
>
> > > > Graham, welcome. Careful, though -- we might convert<
> >http://twitter.com/GrahamDumpleton/status/23120780938190848>you. ;-)
>
> > > >http://twitter.com/GrahamDumpleton/status/23120780938190848
>
> > > I have been posting here for quite a long time actually and tried a few
> > > times to get Massimo to temper his ways but even though he is more
> > > restrained now, sorry to say, he does still seem to rub people up the
> > wrong
> > > way as do the reactions of others in the web2py community. 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. Django became popular on technical
> > > merit and because of easily accessible good documentation, not because
> > its
> > > community went around like  knocking on
> > doors
> > > trying to convert people or arguing every little minor technical point to
>
> > > try and win people other. That sort of behaviour really reminds me of
> > some
> > > new age christians I have known in the past who just could not shut up in
>
> > > trying to make you believe what they believed. It gets tiresome and
> > > sometimes one cant take any more and gets angry about having your time
> > > wasted. I can therefore appreciate the reactions of others associated
> > with
> > > other web frameworks, and if you think the latest outburst about imports
> > was
> > > some reaction about web2py getting a tutorial accepted in PyCon as some
> > like
> > > to think, you are very sadly mistaken. They are more likely just a
> > > manifestation of this frustration of having web2py shoved in your face
> > one
> > > too many times especially when muds gets thrown in your direction. So,
> > quiet
> > > it down and you will go a lot further with less angst against you.
>
> > > FWIW, although I find some of the ways web2py does things an interesting
> > > approach and would be appealing to certain classes of users, I do have
> > > concerns about how it does other things, especially in conjunction with
> > how
> > > it tries to label itself an enterprise framework. So, it definitely isn't
> > in
> > > my mind suitable for all situations. As to the 'import' issue, I don't
> > give
> > > a stuff about it either way so please don't drag me into that one.
>
> > > Graham
>
> > > > On Saturday, January 8, 2011 10:59:37 PM UTC-5, Graham Dumpleton wrote:
>
> > > >> Yo

[web2py] OFF TOPIC: Best way to get the mouse position.

2011-01-09 Thread Jason Brower
I am wanted to create a tool that can map points in an image. (Basically 
pins on a map.)  I thought it best to overly the image with a dive and 
get the position in the div. (Somehow...)
Any ideas on how to best do that, and are there any examples that I 
could look at?

Best regards,
Jason


[web2py] Hassle-Free Application Hosting?

2011-01-09 Thread Syed
Are there any application hosting services for web2py that are similar
to the following (for other frameworks):

Heroku for Ruby on Rails
Djangy for Django
Pantheon for Drupal

I know that it's possible to use GAE for hosting, but there are some
limitations to going that route. I understand that Webfaction offers
hosting, but it's just normal shared hosting, right? It would be great
if there was a fire-and-forget application hosting option for web2py
just like Heroku or Engine Yard.



Re: [web2py] Re: iframes and ajax

2011-01-09 Thread Michele Comitini
...without reference... sorry

2011/1/9 Michele Comitini :
> I think you cannot update a target outside of the scope of the page
> (the iframe i this case) with reference to the target window:
>
> http://www.infimum.dk/HTML/JSwindows.html
>
>
> 2011/1/9 weheh 
>>
>> I should also note that the divs I'm trying to update are outside the
>> iframe.
>


Re: [web2py] Re: iframes and ajax

2011-01-09 Thread Michele Comitini
I think you cannot update a target outside of the scope of the page
(the iframe i this case) with reference to the target window:

http://www.infimum.dk/HTML/JSwindows.html


2011/1/9 weheh 
>
> I should also note that the divs I'm trying to update are outside the
> iframe.


Re: [web2py] Re: ADVOCACY: "every single other Python program ever written uses imports"?

2011-01-09 Thread Thadeus Burgess
I believe this is why web2py receives much criticism. I speak from
experience in using (and contributing to) web2py.

web2py cannot share objects in an importable namespace with other python
applications ecause of its design architecture. This is an absolute
requirement for most "enterprise" or "real world" applications.

Two examples. (however there are many more than I have time to iterate over)

Exhibit A: Multiple websites that share some or all database models and
utility functions. A public site may use only some of the models needed for
say user signup, and a dashboard that may be IP restricted for internal use
only.
Exhibit B: Must share database models with stand alone python programs. A
long running process that sits in the background, but needs access to the
database.

web2py cannot do either of these, and unless web2py uses import it will
never be able to. Currently, to accomplish exhibit A or B, code
spaghetti-fication must occur, and maintainance of model definitions in
multiple places now becomes a royal pain in the ass. That or you must use
some of the other many (unprofessional, hard to maintain) hacks just to work
around this limitation.

With other frameworks, such as flask/sqlalchemy it is a python program like
anything else. You can do "from dashboard.models import person". You only
maintain one model, but you can use it in all applications that may need it,
since you can easy_install your site into a virtualenv.

Another issue that I have ran into more often than not is the limitations in
the web2py core. Certain things (like SQLForm, auth, sessions, etc) are
great for rapid prototyping, but when you actually need to do something
"real" with them, they just get in the way. For example, a form that has a
subform or a built in subtable (like a form you might build in Access), or
cookie stored sessions for scalability. Again, these are just simple
examples when the real world implementation is much more complex.

Another problem that the current design of web2py inherently brings is it
enforces a functional programming style. You can use classes, but then you
end up having to throw pointers around of your basic objects (db, session,
etc). Using classes the way they are designed to be used with a normal
object lifecycle (imported, instantiated, etc...) is extemely difficult to
do in web2py. There is nothing wrong with functional programming, but the
code can easily become a mess even if you are a good programmer.

Just to give an example of how amazing a class based system is, I re-wrote
appadmin for Flask+SQLAlchemy+WTForms in 80 lines of python code, with
pagination, searching, creating, updating, and deleting. Think of how
maintainable that is. I don't even know what is going on inside of web2pys
appadmin... I try to stay away from it *wink*.

One of the biggest arguments vs other frameworks is the speed of development
time of a web2py app vs other framework. I disagree with this, I am usually
able to add new features to my flask apps much faster than I can in web2py.
This is probably due to the simplicity of other frameworks and not having to
fight with anything being pre-determined for me (such as database tables
forced to lowercase).

As long as all your doing is building a simple website that will be
completely 100% self contained into web2py and it isn't expected to grow
over 10K lines of python code, web2py is great.

If you are doing something that requires code to be shared, and has lots of
complex models and a large codebase that will need to be maintained by other
people than yourself in the future... I would pick Flask.

I speak most of this from real world experience. I work in both web2py and
flask every single day and know the strengths and weaknesses of both.

I just wanted to take the time to chime in as to why some feel they way they
do with web2py... maybe they just don't know how to explain it, or don't
want to take the time to explain it.

--
Thadeus




On Sat, Jan 8, 2011 at 8:34 AM, Anthony  wrote:

> On Saturday, January 8, 2011 9:12:55 AM UTC-5, Anthony wrote:
>
>> +1
>>
>> On Saturday, January 8, 2011 7:31:38 AM UTC-5, cjrh wrote:
>>
>>> On Jan 7, 11:45 pm, Michele Comitini 
>>> wrote:
>>> > I think the most misunderstood fact with web2py is that web2py
>>> > implementation is improving every day,
>>>
>>> Do you really think the designers of other web frameworks do not
>>> understand how web2py works?  They definitely understand, and they
>>> probably understand better than you or I.   The problem is that web2py
>>> design is different from their own design.  Because we operate in the
>>> same space, they try to show why their decisions are better.  To be
>>> fair, Massimo has been doing exactly the same thing by comparing w2py
>>> versus the others for years.  Quid pro quo.  If we get to say why ours
>>> is better, then they get to do likewise.
>>>
>>
>> Good point, though it's not exactly the same. Massimo may claim that the
>> web2py way is better (actually

[web2py] Re: Getting the field value of a form field

2011-01-09 Thread weheh
You can say: db.t_order[order_id].f_sum
or after submitting
form=SQLFORM(db.t_order,order_id)
look at
form.vars.f_sum

On Jan 9, 2:34 am, Kenneth Lundström 
wrote:
> Hello,
>
> I m creating a form with SQLFORM(db.t_order, order_id)
> so I get a form with values.
>
> As the data has been queried from the database I d like to get a value
> from one of the fields a do some customization based on it. But how do I
> get the value of field f_sum from the form?
>
> Kenneth