[web2py] Does "return" have to be the last statement in a function?

2011-05-02 Thread Michael McGinnis
While a visitor is reading a page/looking at the view, I'd like to be
doing something in the background in preparation for his or her next
action, or to finish processing his previous action. Right now all my
functions end with "return" statements that display a view. Do they
have to end with return statements, or can I put a crud.update
statement or something at the end? I could put database functions in
the view, as I did with PHP, but that would violate M-V-C best
practices, of course.


[web2py] Re: web2py on Quora

2011-03-01 Thread Michael McGinnis
On Mar 1, 8:34 pm, Massimo Di Pierro 
wrote:
>
> That is a difference. They follow "explicit is better than implicit"
> and that cause verbosity. We choose to follow "do not repeat yourself"
> and "everything should have a default" so web2py's code is more
> compact. If you like this you use.
>
>
Everything has a default... maybe that's why web2py "just works." As
long as newbies are afraid to use Linux and Python because they think
these tools are too complex, we don't have the luxury of standing on
purity - to say, "It's more important for you to follow our technical
rules than to get your work done." If we do, nobody will dare to try
anything beyond Windows and PHP.


[web2py] Re: web2py Debian packages available for testing

2011-02-28 Thread Michael McGinnis
Impressive! It installed easily, using Ubuntu Software Manager
(10.10). It said License: Unknown,  Updates: Unknown, with no
screenshot.

However, I did get an error on the examples app - maybe this is a
known issue.

ERROR TICKET FOR "EXAMPLES"
TICKET ID
127.0.0.1.2011-02-28.21-12-16.61f00a22-ef12-405f-85f1-92c286cae4b9

VERSION
web2py™ Version 1.92.1 (2011-02-16 15:04:40)
Python  Python 2.6.6: /usr/bin/python
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/gluon/restricted.py", line 188,
in restricted
exec ccode in environment
  File "/home/michael/web2py/applications/examples/controllers/
default.py", line 69, in 
  File "/usr/lib/pymodules/python2.6/gluon/globals.py", line 95, in

self._caller = lambda f: f()
  File "/usr/lib/pymodules/python2.6/gluon/cache.py", line 412, in

return lambda: cache_model(key, func, time_expire)
  File "/usr/lib/pymodules/python2.6/gluon/cache.py", line 184, in
__call__
value = f()
  File "/home/michael/web2py/applications/examples/controllers/
default.py", line 11, in index
return response.render()
  File "/usr/lib/pymodules/python2.6/gluon/globals.py", line 130, in
render
run_view_in(self._view_environment)
  File "/usr/lib/pymodules/python2.6/gluon/compileapp.py", line 471,
in run_view_in
restricted(ccode, environment, layer)
  File "/usr/lib/pymodules/python2.6/gluon/restricted.py", line 196,
in restricted
raise RestrictedError(layer, code, '', environment)
RestrictedError
ERROR SNAPSHOT
()



On Feb 28, 2:26 pm, José L.  wrote:
> Hello,
> I've prepared the packages to install web2py in Debian or other Linux Debian
> derivatives (as Knoppix, Ubuntu, Linex, etc.)
>
> The packages are available 
> at:http://people.debian.org/~jredrejo/web2py/lenny/for old releases with
> python 2.5 as default python version.
>
> http://people.debian.org/~jredrejo/web2py/squeeze/for new releases with
> python 2.6 or 2.7
>
> Two packages are available:
> python-gluon: with web2py libraries, needed to server web2py applications
> using Apache or other web werver
> python-web2py (depending on python-gluon) : with web2py rocket server and
> admin, welcome and example applications.
>
> After installed, if a desktop environment (like KDE or Gnome) is used,
> web2py can be run from the menu->development branch.
> This will launch a gui to start the server, and the applications will be
> stored in $HOME/web2py
>
> If web2py is launched from a terminal, the application will be stored in the
> directory where it's launched from (whenever write permissions are allowed,
> if not it will be done again at $HOME/web2py)
>
> A README.Debian is also installed at /usr/share/doc/web2py-gluon/ with more
> details on running or installing web2py applications in Debian based
> distributions, including documentation and an example configuration file to
> use Apache.
>
> My plan is uploading these packages to Debian at the end of this week if
> nobody complains with bugs, so I ask help to  all the Debian/Ubuntu users in
> this group to test it and tell me their opinion.
>
> Regards
> José L.


[web2py] Re: Sharing knowledge in this group. What is the point ?

2011-02-21 Thread Michael McGinnis
That's great. I like the idea of having two or three layers of
documentation, which would allow "Here is a basic overview of this
feature, but click here to read all the details." I agree that people
shouldn't have to Google to learn about older features, but only to
learn about new features that haven't been formally documented in the
book or in web2pyslices.

Michael

On Feb 21, 5:05 pm, Anthony  wrote:
> Bruno and Martin are working on a complete revamp ofwww.web2pyslices.com,
> and they've got a lot of good 
> ideas:https://groups.google.com/d/topic/web2py/HkkZ_-kMUYE/discussion. If 
> you've
> got ideas, let them know. I don't think we'll want a wiki in addition to the
> new slices site -- the new site should accommodate everything.
>
> On Monday, February 21, 2011 5:53:04 PM UTC-5, pbreit wrote:
> > I think it's gotta be a wiki. Slices is too structured. Here are models:
> >http://code.djangoproject.com/wiki
>
> The Django wiki does not appear to be about users contributing
> documentation.
>
> >http://wiki.rubyonrails.org/
>
> Can't access the rails wiki right now.


[web2py] Re: GSoC

2011-02-17 Thread Michael McGinnis
Yes, a blog for GAE could be a killer app - a free blogging platform,
particularly attractive to people in China who are blocked from using
Wordpress.com. Our killer blog app would be based on InstantPress, of
course, but its admin interface would have to work like Wordpress,
just as OpenOffice has to work like Microsoft Office. Whatever people
are used to becomes the standard, and departing from that hurts
usability.

On Feb 17, 2:10 pm, pbreit  wrote:
> I'd love to see 1) WordPress copy and 2) Vbulletin/FluxBB/etc copy. No fancy
> UIs. Keep it simple.


[web2py] Re: Spam control? and word filtering?

2011-02-16 Thread Michael McGinnis
For spam control, the best is Akismet, but Spam Assassin is also an
industry standard, I believe.

Other English word filtering resources:
http://urbanoalvarez.es/blog/2008/04/04/bad-words-list/
http://www.bannedwordlist.com/

And from http://www.noswearing.com/about.php:
"The API is currently open on a limited person basis. It currently
supports 4 operations: List dirty words, Censor dirty words, Replace
dirty words, and Define Dirty words. If you're interested in testing
it for us, please send an email to ryan at noslang.com."

Michael McGinnis

On Feb 16, 9:18 am, Jonathan Lundell  wrote:
> On Feb 16, 2011, at 5:10 AM, Massimo Di Pierro wrote:
>
>
>
> > I am not an expert on bad words in english, I could do a better job in
> > Italian. ;-)
>
> No doubt...
>
> It's a tough problem, regardless, and it's awfully easy to get false 
> positives. Better not misspell shiitake mushrooms.
>
>
>
>
>
>
>
>
>
> > On Feb 15, 11:20 pm, Jonathan Lundell  wrote:
> >> On Feb 15, 2011, at 11:21 AM, Massimo Di Pierro wrote:
>
> >>> import base64, re
> >>> BADWORDS=re.compile(base64.b64decode("""KGFob2xlfGFudXN8YXNoMGxlfGFzaDBsZXN
> >>>  8YXNob2xlc3xhc3N8YXNzfGFzc2ZhY2V8YXNzaDBs
>
> >> There are some very peculiar choices (and omissions) in that list.
>
> >> rautenberg? job?
>
> >> honkey, but not honky (or its orginal, bohunk).
>
> >> Aside from the word choice, if you're going to use it, change match to 
> >> search, bracket the pattern with \b's, and make it case-insensitive.


[web2py] Re: How to create a parallel mobile site

2011-02-14 Thread Michael McGinnis
Also, you might want to look at what Ethan Marcotte has done with
media queries using CSS, which he calls "responsive web design":
http://www.alistapart.com/articles/responsive-web-design/

Michael McGinnis

On Feb 14, 2:47 pm, Chris  wrote:
> Hi all,
>
> I'm making a site on web2py that has a mobile counterpart.
>
> I'd like to be able to, once I've detected that a browser is mobile,
> use a different set of views but share the same controller logic. I
> saw that in an earlier post (http://groups.google.com/group/web2py/
> browse_thread/thread/7277e92b03450784/9dd641c956bd6bc3?
> lnk=gst&q=mobile#9dd641c956bd6bc3) we covered the browser sniffing,
> and got that working, but how would I be able to, for example, use
> index.mobile.html instead of index.html if I detect the user is coming
> from a mobile device?
>
> Thanks
> Chris


[web2py] Re: Application logging

2011-02-13 Thread Michael McGinnis
I can't find documentation in the book for this, either by searching
for logging.conf, logger.app or web2py.app. Maybe I'm lazy or
ignorant. But I love the usability consulting part of my job: anytime
something isn't extremely easy for me to find on a website, I can
claim that it's not my fault, that the site should be made more usable
for lazy, ignorant people.

On Feb 13, 12:03 am, Jonathan Lundell  wrote:
> On Feb 12, 2011, at 9:44 PM, pbreit wrote:
>
> > What is current recommendation for app logging?
>
> You can start by copying logging.example.conf to logging.conf, and then 
> editing it to suit your requirements.
>
> Either log with web2py.app (logger_app) or create a new logger specific to 
> your own application.


[web2py] Re: Can't generate index.yaml

2011-01-27 Thread Michael McGinnis
I had a similar experience. My app ran fine on web2py and on the GAE
SDK, but when I deployed it, the indexes (which surely were created
while running it on the SDK), never arrived.

On Jan 27, 8:49 am, devGS  wrote:
> Hello,
> I'm can't make my GAE Launcher to generate the indexes file. I tried
> to clean the datastore locally, tried to play with  models/0.py file,
> to place my own index.yaml in web2py folder with "# AUTOGENERATED",
> but so far nothing have worked. I use Janrain for logging in, and the
> only table at db.py is 'auth_user', please help.
> Thanks.


[web2py] Re: experts

2011-01-12 Thread Michael McGinnis
But the home page also says, "...or contact us and we will assemble
for you a well-balanced and cost-effective international team to work
on your project." Should we use the 
http://experts4solutions.com/e4s/default/contact
to start that process, or should the home page be changed to de-
emphasize that option?

I could use help with the procedure anyway. I did use the contact page
in an attempt to reach an expert, but I don't know if I asked the
right questions or gave the right information.

Michael

On Jan 12, 7:09 am, Kenneth Lundström 
wrote:
> Look at the list onwww.experts4solutions.com), select an expert and
> contact directly.
>
> Kenneth
>
>
>
>
>
>
>
> > To Massimo:
>
> > what is the procedure to utilise the experts, please layout the
> > procedure. I will have a task in shortly.Debebe


[web2py] Re: The stability of web2py releases

2010-12-22 Thread Michael McGinnis
I'd like to help fix those typos. Let me know how I can get started.

Michael McGinnis
michael.d.mcgin...@gmail.com

On Dec 22, 4:01 pm, Stefaan Himpe  wrote:
> > Is there a typo on this planet that can evade Anthony? :D
>
> While we're on the subject... *cough*experts4solutions.com*cough*
> Its typos still make my eyes bleed :p


[web2py] Re: it case you missed it...

2010-12-16 Thread Michael McGinnis
No opposition here. Like others, I was originally confused whether
using the web2py framework would force my web app to be open source.
I would welcome a change in license.

On Dec 16, 4:33 pm, mdipierro  wrote:
> GPL2 creates the loophole. The AGPL closes the loophole. The GPL3 was
> supposed to incorporate language from AGPL and close the loophole but
> did not. It is not clear to me whether GPL3 closes the loophole or
> not. If it does not (like GPL2 does not).
>
> I have no objection to move to GPL3.
>
> Yet that does not help in clarifying the web2py license.
>
> As a hypothetical question. Who here would oppose to moving to BSD or
> MIT or other more permissive license?
>
> Massimo
>
> On Dec 16, 2:54 pm, "Branko Vukelic"  wrote:
>
>
>
>
>
>
>
> > > - Original Message -
> > > From: mdipierro
> > > Sent: 12/16/10 07:56 PM
> > > To: web2py-users
> > > Subject: [web2py] Re: it case you missed it...
> > > If we were to move from GPL2 to GPL3 people would not be allowed to
> > > modify web2py running on their servers without making available the
> > > source code of their changes. I do not see any reason for requiring
> > > this.
>
> > What's AGPL for then? Wasn't _AGPL_ supposed to prevent that? Anyway, I 
> > think GPLv3 makes i possible to use code licensed under licenses like MIT 
> > and BSD in a GPLv3 project, which is otherwise a bit incompatible. Or did I 
> > miss something?
>
> > --
> > Branko Vukelic
>
> > branko.vuke...@gmx.com
>
> >http://www.brankovukelic.com/http://flickr.com/photos/foxbunny


[web2py] Re: SEO Tips & How this can be applied in web2py apps?

2010-12-12 Thread Michael McGinnis
Those are good ideas. Automatically appending the site name at the end
of each title might be helpful. Or copying the first paragraph as a
fall-back meta-description (not so sure about that one). Or inserting
dynamic keywords for each page into the meta keywords. But we also
have to avoid duplicate content, so we don't want to make things too
automated. For example, we don't want to make it easy to use the same
meta description or meta keywords on each page - that sometimes make
Google think that each page has the same content.

On Dec 12, 11:31 am, Bruno Rocha  wrote:
> OK, I like every comments about 301 redirect, and this is a good tip.
>
> But, I started this post with this subject in mind:
>
> I am thinking on how we can have some helpers, functions, directives or just
>
> > improvements in 'welcome' app to help us follow this SEO tips?
>
> So, how can we develop some helpers to that? is there any chance to have a
> helper or pre-defined configuration is scaffold app?
>
> what about other things like Sitemap.xml, robots.txt, keywords, page titles
> etc.. How can we make it easy to config, how can web2py scafoold help us
> when starting a new project.
>
> I used wordpress for a long time, and there is 'ALL IN ONE SEO TOOLS'
> plugin, this is great, just installs it and nevermind about SEO again.
>
> I want to have such thing in web2py. how?
> --
>
> Bruno Rochahttp://about.me/rochacbruno/bio


[web2py] Re: SEO Tips & How this can be applied in web2py apps?

2010-12-12 Thread Michael McGinnis
Yes, we ought to standardize on www or non-www, but as GoldenTiger
implied earlier, the Google Page Rank displayed in toolbars and tools
has little relationship to the numbers that Google actually uses to
rank pages. Seomoz is a great resource.

On Dec 11, 8:41 am, GoldenTiger  wrote:
> Yes, there are a few links like that. In fact, the links with higher
> PR.
>
> Check all internal pagerank onhttp://www.internalrank.com
>
> http://www.web2py.com/examples/default/download  is PR= 
> 5http://web2py.com/examples/default/download    is PR= 5
>
> Two links above should be one, so PR could be higher
>
> On 11 dic, 12:42, "Martin.Mulone"  wrote:
>
>
>
>
>
>
>
> > There are some links in menu, that point to ex: web2py.com/book, in
> > web2py mainsite. Perhaps we need to change towww.web2py.com.


[web2py] Re: needs more new dal testers

2010-12-09 Thread Michael McGinnis
I could run 1.89.5 (2010-11-21 22:12:54)
with ./jython web2py/web2py.py (no cron because no file locking,
though) just fine on http://127.0.0.1:8000/admin/default/site
though I got errors on several other apps including
http://127.0.0.1:8000/welcome/default/index:
(global name 'sqlite3' is not defined
(tried 5 times))

For what it's worth, this is what I get when I try to run the old dal
as a standalone file:
mich...@doulos:~/jython2.5.2rc2$ ./jython dal.py
Traceback (most recent call last):
  File "dal.py", line 51, in 
from utils import md5_hash, web2py_uuid
ImportError: No module named utils


On Dec 9, 11:25 pm, mdipierro  wrote:
> I think the problem is that it not finding any driver. It is not even
> defining db.
> Did the old dal worked with jython.
>
> good pypy works for you. It crashes with "segmentation fault" on me.
>
> On Dec 9, 11:17 pm, Michael McGinnis  wrote:
>
>
>
>
>
>
>
> > I've never used either one before. But no errors on pypy-1.4.
> > For jython-2.5.2rc2, here is a typical message, apparently one of 77:
> > **
> > File "dal.py", line 4874, in __main__.test_all
> > Failed example:
> >     db.paper.drop()
> > Exception raised:
> >     Traceback (most recent call last):
> >       File "/home/michael/jython2.5.2rc2/Lib/doctest.py", line 1235,
> > in _DocTestRunner__run
> >         exec compile(example.source, filename, "single",
> >       File "", line 1, in 
> >         db.paper.drop()
> >     NameError: name 'db' is not defined
> > **
> > 2 items had failures:
> >   15 of  15 in __main__
> >   62 of  64 in __main__.test_all
> > ***Test Failed*** 77 failures.
>
> > On Dec 8, 9:28 pm, mdipierro  wrote:
>
> > > Can you try jython and pypy and do
>
> > > jython dal.py
> > > pypy dal.py
>
> > > Please report any error.
>
> > > Massimo


[web2py] Re: needs more new dal testers

2010-12-09 Thread Michael McGinnis
I've never used either one before. But no errors on pypy-1.4.
For jython-2.5.2rc2, here is a typical message, apparently one of 77:
**
File "dal.py", line 4874, in __main__.test_all
Failed example:
db.paper.drop()
Exception raised:
Traceback (most recent call last):
  File "/home/michael/jython2.5.2rc2/Lib/doctest.py", line 1235,
in _DocTestRunner__run
exec compile(example.source, filename, "single",
  File "", line 1, in 
db.paper.drop()
NameError: name 'db' is not defined
**
2 items had failures:
  15 of  15 in __main__
  62 of  64 in __main__.test_all
***Test Failed*** 77 failures.

On Dec 8, 9:28 pm, mdipierro  wrote:
> Can you try jython and pypy and do
>
> jython dal.py
> pypy dal.py
>
> Please report any error.
>
> Massimo


[web2py] Re: Anyone willing to help out with Paypal

2010-12-02 Thread Michael McGinnis
That's great. I will be running on GAE, so I guess it wouldn't work
for me.

I expect that all I would need is a notification that the payment has
been credited to my Paypal account, and how much, so the amount can be
credited to the user's account in my system. I would also like to
transfer amounts from my system to the the user's Paypal account (in
payment for services that users provide to other users).

Michael

On Dec 2, 4:21 pm, howesc  wrote:
> Hi all,
>
> sorry for the delay.  my paypal integration code can be viewed 
> here:http://web2pyslices.com/main/slices/take_slice/106
>
> please let me know if you have problems with it.
>
> thanks,
>
> christian
>
> On Nov 26, 8:23 am, Andrew Evans  wrote:
>
>
>
>
>
>
>
> > hello
>
> > I am interested in your code :D
>
> > Let me know when you are able to pull it out :D