Re: [web2py] Re: web2py ajax function in py4web

2020-11-09 Thread Tom Campbell
Also, Stifan, could you post a few use cases? py4web includes vue.js by
default and I am trying to understand the most common use cases of this for
documentation purposes. I am guessing:

   - Instant form update on client side when a value is changed (for
   example, a star rating or even a complicated dialog)
   - Instant form update on client side when a database value is changed
   (for example, adding a line item to an invoice)

Note to py4web peeps: Stifan is a gifted web2py person and I am
delighted to see him posting here!

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CALXkWBR%3DK6cuqHT-2AZSiEwWGn485Mrt7BVoDtq_TQ%2BS860oZw%40mail.gmail.com.


[web2py] TOMORROW: Talk to py4web's creator! Live Chat with Massimo DiPierro discussing py4web live 7/25/2020 10am PST

2020-07-24 Thread Tom Campbell
The hardest working man in the web framework business will be here for you 
to answer questions via interactive text. There will be a copy of the 
transcript available on FreeNode, plus I'll attempt to put together a 
polished version in article form. So the inevitable mistakes in my 
transcript will be counterbalanced by the actual word from Massimo.

No login or anything needed:
https://webchat.freenode.net/#py4web

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/e7bff8ca-ccdb-4550-8c4f-28b4a1b961b5o%40googlegroups.com.


[web2py] Massimo discussing py4web live 7/11/2020 10am PST on freenode

2020-07-12 Thread Tom Campbell
No login needed. Text-based.
https://webchat.freenode.net/#py4web

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/ed8ac4fd-0fb8-40fa-90a2-506090723634o%40googlegroups.com.


[web2py] Re: Tables in Appadmin/index have disappeared

2019-08-14 Thread Tom Campbell
If you can imagine a version of the old song "Strumming My Pain" but about 
programming ("I felt he'd found my letters and read each one out loud"), 
yeah, you just told the story of my programming life too. I feel for you!
Also you still have hair so that's good

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/b897e055-cece-43e5-bb0c-df402f26121b%40googlegroups.com.


[web2py] Re: Thank you Web2py community - I have completed a live application, ViewBase.com, using Web2py

2019-04-05 Thread Tom Campbell
Amazing piece of work. Congratulations!

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Git: save init application as separate repo from web2py, and exclude the init directory?

2019-03-17 Thread Tom Campbell
My (soon to be production) code is in the application named init.
Obviously init is surrounded by the web2py installation itself.
We will want to preserve the working version of web2py in a git repo since 
it's likely we will update web2py separately from the init app.
I assume the best practice is to save the init application in another repo, 
and exclude the init directory from the web2py repo?
Bonus question: I'm using Python 2.7. Should I upgrade to 3.0?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] .gitignore and just backing up one application

2019-02-18 Thread Tom Campbell
Want to get version control right for this one. It will be just one item in 
the /applications directory, the /applications/init project. Some questions.

   - Is there any reason to backup more than just /applications/init? I 
   assume it is best simply to note the version of /web2py I'm using and back 
   it up separately, correct (in case of the catastrophe 
   that https://github.com/web2py/web2py/releases becames unavailable)
   - Is this a good .gitignore assuming I only need to back up 
   /applications/init?

# .gitignore
sessions/*
errors/*
*.pyc
*.pyo
*~
#*
*.1
*.bak
*.bak2
*.svn
*.w2p
*.class
*.rej
*.orig
Thumbs.db
.DS_Store
.pythonhistory
LICENSE
*.DS_Store
logging.conf
.idea/*

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Is there such a thing as a reliable, managed web2py/PostgreSQL host with good support?

2019-02-16 Thread Tom Campbell
Need managed, reliable hosting for a mission critical app that hits the 
eBay API at specified times. It's a generic CRUD app except that scheduled 
tasks (written in Go) must be run with 1 second accuracy, no more than 
200/second at peak times.

I am a pretty terrible sysadmin so my strong preference is that both the 
Python and PostgreSQL servers be managed. Outages are not welcome because 
our customers depend on us to hit eBay at the specified tie. And because 
I'm terrible, responsive support is a huge plus. Doesn't have to be real 
time, but I'd like 1 business day turnaround.

Considering Pythonanywhere, possible with DigitalOcean using its new 
managed PostgreSQL offering. Or maybe just Pythonanywhere exclusively.

My experience with a paid GAE account was not good service-wise. Has anyone 
experienced semi-decent support for a paid account at Amaazon, Microsoft, 
Heroku, or any other managed host?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Can we commit the codes from web2py to Git

2018-09-03 Thread Tom Campbell
Yes it works fine with Git. In fact... https://github.com/web2py

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Unable to override Bootstrap in layout.html

2018-05-04 Thread Tom Campbell
On Thursday, May 3, 2018 at 9:30:56 PM UTC-7, pbreit wrote:
>
> I think the property you want is background-color
>


Not sure what you mean... the bootstrap source 
at https://github.com/twbs/bootstrap/blob/v4-dev/dist/css/bootstrap.css 
defines attributes like this:
.navbar-dark .navbar-brand {
  color: #fff;
} 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: "Installed applications" list now missing my applications

2018-05-03 Thread Tom Campbell
Thanks for the response! Seemed that way to me too, but that wasn't the 
issue (because the list of applications was unique).
I solved it the old-fashioned way--git pull on web2py itself

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Unable to override Bootstrap in layout.html

2018-05-03 Thread Tom Campbell
Goal is to change the color, size, and eventually default font of Bootstrap 
4 navbar.
The following seemed to have no effect in web2py-bootstrap4.css (not the 
final colors! Just wanted contrasting ugly ones to make sure the experiment 
worked!)

file: web2py-bootstrap4.cs
.navbar-dark { color: rgba(255,0,0,0.5); }
.bg-dark { color: yellow; }


So in desperation I thought I'd just put it right in layout.htmlL

file: web2py-bootstrap4.cs

 /* TC: Experimental */
.navbar-dark { color: rgba(255,0,0,0.5); }
.bg-dark { color: yellow; }
   
  
  
  
{{=response.flash or ''}}






 Still no change to the nav bar. What am I screwing up? TIA

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] SOLVED: Where does configuration.get() look for files? Or does it?

2018-05-03 Thread Tom Campbell
Ah. It's AppConfig (see 
http://web2py.com/books/default/chapter/29/13/deployment-recipes?search=AppConfig#AppConfig-module).
 
The values are stored in .ini format in the /private directory, which is 
not supposed to be part of the Git repo.

On Thursday, May 3, 2018 at 1:40:44 AM UTC-7, Tom Campbell wrote:
>
> Trying to set up the mailer for Gmail. After a spell a way from web2py I 
> see code like this in db.py
> mail.settings.login = configuration.get('smtp.login')
> 1. What is "configuration.get()"? I'm assuming it's a function that reads 
> a file with configuration info? When I searched the web2py source 
> <https://github.com/web2py/web2py/search?p=4=configuration==%E2%9C%93>
>  
> on GitHub I found no function named configuration.get defined anywhere.
> 2. Where does it look for the file, and what format is the file in? I 
> assume the current directory but I don't know what that means. The 
> application's directory, maybe?
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Where does configuration.get() look for files? Or does it?

2018-05-03 Thread Tom Campbell
Trying to set up the mailer for Gmail. After a spell a way from web2py I 
see code like this in db.py
mail.settings.login = configuration.get('smtp.login')
1. What is "configuration.get()"? I'm assuming it's a function that reads a 
file with configuration info? When I searched the web2py source 

 
on GitHub I found no function named configuration.get defined anywhere.
2. Where does it look for the file, and what format is the file in? I 
assume the current directory but I don't know what that means. The 
application's directory, maybe?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] SQLite data file in production-backing up

2018-05-03 Thread Tom Campbell
SQLite is more than enough for my needs, I think. In the best of worlds we 
will have no more than a few thousand customers after we get up and 
running. But I'm not sure what to do about the database file, which is of 
course unencrypted. I will place it in a directory that is not accessible 
to web users and also make it invisible via .htaccess.

What's the best way to manage the SQLite data file? Encrypt, then gzip, 
then ssh it to a remote location once or twice a day using a cron job?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Things to do to secure server running purely web2py?

2017-02-16 Thread Tom Campbell
As usual the web2py  book has tons of great info in the Deployment 
 
chapter. 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Why doesn't web2py create a PostgreSQL database automatically (curiosity, not criticism)

2017-02-16 Thread Tom Campbell
Thanks, Stifan, you rock as always. I thought I had tried & failed with 
this but I trust you on these matters more than myself. Can't wait to get 
to my db machine to re-test

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Why doesn't web2py create a PostgreSQL database automatically (curiosity, not criticism)

2017-02-16 Thread Tom Campbell
As a database admin newb last year I had trouble deploying a PostgreSQL 
site because I forgot that "real" DBMSes require you create a database 
first, unlike SQLite. So I was trying to create tables in a nonexistent 
database. Is there some reason web2py doesn't just create a PostgreSQL 
database with a GUID for a name or something? I'm guessing it's a 
permissions issue.

This is totally asked out of ignorance. It does not pretend to be informed 
criticism.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Probably very naive question from new user

2016-02-10 Thread Tom Campbell
www.pyguy.com has a few beginner-level tutorials that probably answer those 
questions

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] class 'psycopg2.ProgrammingError'> relation "auth_user" already exists

2016-01-29 Thread Tom Campbell
App is on pythonanywhere, using Postgres. Connect string is:

db = 
DAL('postgres://web2pydbadmin:mypassw...@memberable-96.postgres.pythonanywhere-services.com:10096/mydatabase')

Existing topics 
like https://groups.google.com/forum/#!topic/web2py/p740UJkR3Ao do not seem 
to have helpful info.

I admit I lost my temper and deleted everything in /databases out of range 
and frustration (and the same error appears). I figured web2py would just 
rebuild tables if necessary.

I seem to be an absolutely shit database administrator (gave up on GAE 
altogether) and would be happy to hire someone who has experienced this 
problem using postgresql on pythonanywhere.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: SQLFORM.factory() - Display name instead of integer for user_id?

2016-01-13 Thread Tom Campbell


On Wednesday, January 13, 2016 at 3:38:56 PM UTC-8, Tom Campbell wrote:
>
> Creating a custom form that relates first name and last name fields to the 
> db.auth_user's user_id field. In the form below the user ID shows as an 
> integer in the dropdown but I'd like it to show as the user's name. How do 
> I do that?
>
> form = SQLFORM.factory(
> 
> Field('first_name', requires=IS_NOT_EMPTY()),
> Field('last_name', requires=IS_NOT_EMPTY()),
> Field('user_id', 'reference auth_user', requires=IS_IN_DB(db,
> db.auth_user.id)),
> fields=['first_name', 'last_name', 'user_id'],
> )
>
> I also tried this, but it sill displayed as an integer:
Field('user_id', 'reference auth_user', 
widget=SQLFORM.widgets.options.widget, 
requires=IS_IN_DB(db,db.auth_user.id)),
 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] SQLFORM.factory() - Display name instead of integer for user_id?

2016-01-13 Thread Tom Campbell
Creating a custom form that relates first name and last name fields to the 
db.auth_user's user_id field. In the form below the user ID shows as an 
integer in the dropdown but I'd like it to show as the user's name. How do 
I do that?

form = SQLFORM.factory(

Field('first_name', requires=IS_NOT_EMPTY()),
Field('last_name', requires=IS_NOT_EMPTY()),
Field('user_id', 'reference auth_user', 
requires=IS_IN_DB(db,db.auth_user.id)),
fields=['first_name', 'last_name', 'user_id'],
)

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Failing at Google Cloud SQL again: missing MySQLdb import somewhere?

2016-01-05 Thread Tom Campbell
So the problem was that on the latest OS X, libraries are now prohibited 
from using relative pathnames 
.
 
I am testing, re-testing, and re-re-testing the document I'm writing up on 
every machine I can find. I was getting inconsistent results because some 
of my Macs have older OSes.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Failing at Google Cloud SQL again: missing MySQLdb import somewhere?

2016-01-02 Thread Tom Campbell
I think I may have lied. When I asked the question $100 reward to get a 
simple web2py app runnnig on GAE with Google Cloud SQL 
, I was either 
incompetent or dishonest in my answer! Masssimo asked me to document the 
process. I have been attempting to recreate it for 2 days, and have failed 
spectacularly. Here's a complete walkthrough.

Installed mysql on my Mac using installer, not homebrew (since MySQL 5.7 
I'm unable to get it to work).
# Log in for first time using temp password. Create root user and user for 
this experiment.
$ mysql -u root -p
mysql> ALTER USER IF EXISTS 'root'@'localhost' IDENTIFIED BY 'foo';
Query OK, 0 rows affected (0.01 sec)
mysql> CREATE USER 'testuser'@'localhost' IDENTIFIED BY 'foo';
Query OK, 0 rows affected (0.01 sec)
# Create sample database.
mysql> CREATE DATABASE mydatabase;
Query OK, 1 row affected (0.00 sec)
# Give proper privileges to new user.
mysql>  GRANT INSERT ON *.* TO 'testuser'@'localhost' IDENTIFIED BY 'foo';
Query OK, 0 rows affected, 1 warning (0.00 sec)
# Boogie on out
mysql> \Q

Install web2py from source:
$ git clone --recursive https://github.com/web2py/web2py.git
$ cd web2py
# Generate app.yaml and gaehandler.py
$ python web2py.py -G GAE
Your GAE app name: gigcity-1051
# Create the test app
cp -R applications/welcome applications/test
# Add a model that uses Google /cloud SQL
vim applications/test/models/db1.py
# Add this code:
# -*- coding: utf-8 -*-
db = DAL('google:sql://testuser:gigcity-1051/mydatabase')
$  dev_appserver.py ./ --mysql_user=testuser --mysql_password=foo

Open in the browser:
http://localhost:8080/welcome/default/index
>From My Sites, choose the one named test

Result:
Internal error
Ticket issued: 
test/__1.2016-01-02.12-29-59.c707fc5a-2e9c-49fc-afa7-f321cec16352

No ticket available. But error output on the terminal includes:
ERROR:root:The rdbms API (Google Cloud SQL) is not available because the 
MySQLdb library could not be loaded. Please see the SDK documentation for 
installation instructions.

File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/rdbms_mysqldb.py",
 
line 86, in connect
raise NotImplementedError('Unable to find the MySQLdb library')
NotImplementedError: Unable to find the MySQLdb library


I do have the App Engine SDK installed.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Failing at Google Cloud SQL again: missing MySQLdb import somewhere?

2016-01-02 Thread Tom Campbell
Argh, I should have updated this. Thank you for answering! Adding the 
import to dev_appserver.py did not work. But I had to learn about pip 
(ahem) and imported Python-MySQL, which definitely helped (now there's 
another problem I'm tracking down). I am so used to web2py coming with 
everything it took me way too long to figure out there might be something 
I'd have to import.


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] datatables.net fail: "Uncaught SyntaxError: Unexpected token &"

2015-12-26 Thread Tom Campbell
Trying to display rows using the datatables.net DataTable() function by 
converting query results to JSON, but getting error "Uncaught SyntaxError: 
Unexpected token &". Though the raw data displays correctly in the view 
below, when I look at the results in the web console debugger I see that 
the generated program seems to show the JSON converted back to XML:


$(document).ready(function(){
$("#person-table").DataTable({
"aaData":  [{first_name: Super, 
last_name: Man, id: 1}, 
{first_name: Massimo, last_name: 
Di Pierro, id: 2}]) 
 
})
});

in model db.py:
db.define_table('person',Field('last_name'), Field('first_name'))
db.person.update_or_insert(last_name='Man',first_name='Super')
db.person.update_or_insert(last_name='Di Pierro',first_name='Massimo')

in controller default.py:
def index():
import json
people = json.dumps(db(db.person).select().as_list())
return dict(results=people)

In view index.html:
   


ID
First name
Last name



 ...
Raw data

 results: {{=results}}



$(document).ready(function(){
$("#person-table").DataTable({
"aaData":  $.parseJSON({{=results}})   
   
})
});


The view prints out an empty Datatable, followed by correctly formed JSON 
in the "Raw Data" portion:

  ID First name Last name

  Raw data
  results: [{"first_name": "Super", "last_name": "Man", "id": 1}, 
{"first_name": "Massimo", "last_name": "Di Pierro", "id": 2}]



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: datatables.net fail: "Uncaught SyntaxError: Unexpected token &" ANSWERED

2015-12-26 Thread Tom Campbell
After a day of messing this, 

*of course I answered it myself moments after posting!*Answer was to define 
columns used and to use {{=XML}} helper:a


$(document).ready(function(){
$("#person-table").DataTable({
"data":  {{=XML(results)}},
columns: [
{ data: 'first_name' },
{ data: 'last_name' },
{ data: 'id' }
]
})
});


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: datatables.net fail: "Uncaught SyntaxError: Unexpected token &"

2015-12-26 Thread Tom Campbell
Cleaner versions in tutorial style at pyguy 

 
and and web2pyslices 
.
 
Criticism warmly welcomed.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: $100 reward to get a simple web2py app runnnig on GAE with Google Cloud SQL

2015-12-19 Thread Tom Campbell
IT WORKS! Cannot tell you what a relief that was.

I will absolutely write it up in a web2pyslice, a blog post, and a book 
section!

THANK YOU

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: $100 reward to get a simple web2py app runnnig on GAE with Google Cloud SQL

2015-12-18 Thread Tom Campbell
Thank you! Soon as I get back I can't wait!

On Saturday, December 12, 2015 at 7:05:04 PM UTC-8, Tom Campbell wrote:
>
> I want to get a minimal web2py app running on Google Application Engine, 
> using Google Cloud SQL as the backing store. Have not succeeded. Obviously 
> because I have a much bigger app running locally and want to get that up 
> and running.
>
> If anyone can show me how to do this via Skype, a well-written text file, 
> tin can on a string, whatever, I'd happily pay $100 via PayPal, check, or 
> credit card. It will be a tiny web2py app that I write and the catch is 
> you'll have to sit with me online until I repeat the process once. I'm in 
> Seattle time, so GMT-8.
>
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] $100 reward to get a simple web2py app runnnig on GAE with Google Cloud SQL

2015-12-12 Thread Tom Campbell
I want to get a minimal web2py app running on Google Application Engine, 
using Google Cloud SQL as the backing store. Have not succeeded. Obviously 
because I have a much bigger app running locally and want to get that up 
and running.

If anyone can show me how to do this via Skype, a well-written text file, 
tin can on a string, whatever, I'd happily pay $100 via PayPal, check, or 
credit card. It will be a tiny web2py app that I write and the catch is 
you'll have to sit with me online until I repeat the process once. I'm in 
Seattle time, so GMT-8.



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] GAE: "UserWarning: There are too many files in your application..." Which files to hide?

2015-12-11 Thread Tom Campbell
While attempting to another GAE problem 
, 
I'm running into this GAE error:

15: UserWarning: There are too many files in your application for changes 
> in all of them to be monitored. You may have to restart the development 
> server to see some changes to your files.
>

However, skip_files in app.yaml seems to be excluding all the right files, 
and I can't figure out what else to add, except maybe uploads (but my app 
has no files in that directory)

skip_files: |
> ...
> (applications/.*?/(cron|databases|errors|cache|sessions)/.*)|
> ...
>

Anyone have an idea how I can reduce the number of files watched further, 
or is this a spurious error?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] GAE app running locally can't open Google Cloud SQL database: "Failure to connect, tried 5 times"

2015-12-11 Thread Tom Campbell
Can someone tell me what I'm doing wrong in my attempt to use Google Cloud 
SQL?

My GAE app runs successfully on local machine without database support.
Goal is to use Google Cloud SQL database.
Remote Google Cloud SQL database is accessible via mysql on the command 
line.
Google SDK is the latest.

db.py contains this code:
db = DAL('google:sql://gigcity-1951:dbtest/tomsdatabase')

When run, yields this web2py error:


 Failure to connect, tried 5 times: 
> Traceback (most recent call last): File 
> "/Users/tom/Dropbox/work/m/web2py/gluon/dal/base.py", line 410, in __init__ 
> self._adapter = ADAPTERS[self._dbname](**kwargs) File 
> "/Users/tom/Dropbox/work/m/web2py/gluon/dal/adapters/base.py", line 47, in 
> __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File 
> "/Users/tom/Dropbox/work/m/web2py/gluon/dal/adapters/google.py", line 51, 
> in __init__ if do_connect: self.reconnect() File 
> "/Users/tom/Dropbox/work/m/web2py/gluon/dal/connection.py", line 92, in 
> reconnect self.connection = f() File 
> "/Users/tom/Dropbox/work/m/web2py/gluon/dal/adapters/google.py", line 49, 
> in connector return rdbms.connect(**driver_args) AttributeError: 'NoneType' 
> object has no attribute 'connect' 
>

I start it like this:

dev_appserver.py ../web2py --mysql_user=sampleuser --mysql_password=foo
>


Relevant (?) lines of app.yaml:
 

> application: gigcity-1951
> version: 1
> api_version: 1
>
> # use these lines for Python 2.7
> # upload app with: appcfg.py update web2py (where 'web2py' is web2py's 
> root dir
> #
> runtime: python27
> threadsafe: true# true for WSGI & concurrent requests (Python 2.7 only)
>
> default_expiration: "24h"   # for static files
>
> handlers:
>
> # Warning! Static mapping - below - isn't compatible with
> # the parametric router's language logic.
> # You cannot use them together.
>
> - url: /(.+?)/static/_\d.\d.\d\/(.+)
>   static_files: applications/\1/static/\2
>   upload: applications/(.+?)/static/(.+)
>


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] GAE problems cont'd--Library not loaded: libmysqlclient.18.dylib

2015-10-23 Thread Tom Campbell
Have been unable to connect to Cloud SQL so far in Python (I can do it in 
raw Go). Sébastien reminded me 
 about 
installing the Python MySQLdb lib 
. Still no luck, but it 
got me thinking. When I did an >>> import MySQLdb at the Python prompt I 
noticed some errors. Can anyone help discern what it means? I am developing 
under OS X so that part's not wrong. I don't know if libmysqlclient.18.dylib 
is required or what.

 

File "", line 1, in 

  File "build/bdist.macosx-10.11-intel/egg/MySQLdb/__init__.py", line 19, 
in 

  File "build/bdist.macosx-10.11-intel/egg/_mysql.py", line 7, in 

  File "build/bdist.macosx-10.11-intel/egg/_mysql.py", line 6, in 
__bootstrap__

ImportError: 
dlopen(/Users/tom/.python-eggs/MySQL_python-1.2.5-py2.7-macosx-10.11-intel.egg-tmp/_mysql.so,
 
2): Library not loaded: libmysqlclient.18.dylib

  Referenced from: 
/Users/tom/.python-eggs/MySQL_python-1.2.5-py2.7-macosx-10.11-intel.egg-tmp/_mysql.so

  Reason: unsafe use of relative rpath libmysqlclient.18.dylib in 
/Users/tom/.python-eggs/MySQL_python-1.2.5-py2.7-macosx-10.11-intel.egg-tmp/_mysql.so
 
with restricted binary

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Google Cloud SQL: Unable to connect

2015-10-23 Thread Tom Campbell
Thank you, Sébastien. I indeed had not used MySQLdb in app.yam, nor had I 
included credentials on the tried what you suggested and still get an error 
on the dev_appserver.py command line. Log files say this:

ERROR2015-10-23 21:47:10,581 restricted.py:174] Traceback (most recent 
call last):

  File "/usr/local/web2py/gluon/restricted.py", line 227, in restricted

exec ccode in environment

  File "/usr/local/web2py/applications/todo/models/db.py", line 27, in 


db = DAL('google:sql://gigcity-1051:dbtest/tomsdatabase')

  File "/usr/local/web2py/gluon/packages/dal/pydal/base.py", line 174, in 
__call__

obj = super(MetaDAL, cls).__call__(*args, **kwargs)

  File "/usr/local/web2py/gluon/packages/dal/pydal/base.py", line 473, in 
__init__

"Failure to connect, tried %d times:\n%s" % (attempts, tb)

RuntimeError: Failure to connect, tried 5 times:

Traceback (most recent call last):

  File "/usr/local/web2py/gluon/packages/dal/pydal/base.py", line 446, in 
__init__

self._adapter = ADAPTERS[self._dbname](**kwargs)

  File "/usr/local/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
60, in __call__

obj = super(AdapterMeta, cls).__call__(*args, **kwargs)

  File 
"/usr/local/web2py/gluon/packages/dal/pydal/adapters/google_adapters.py", 
line 59, in __init__

if do_connect: self.reconnect()

  File "/usr/local/web2py/gluon/packages/dal/pydal/connection.py", line 
104, in reconnect

self.connection = f()

  File 
"/usr/local/web2py/gluon/packages/dal/pydal/adapters/google_adapters.py", 
line 57, in connector

return rdbms.connect(**driver_args)

TypeError: connect() got an unexpected keyword argument 'charset'



INFO 2015-10-23 21:47:10,581 gaehandler.py:75]  Request: 
5024.00ms/7.39ms (real time/cpu time)

INFO 2015-10-23 21:47:10,586 module.py:812] default: "GET 
/todo/default/index HTTP/1.1" 500 707

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Google Cloud SQL: Unable to connect

2015-10-21 Thread Tom Campbell
My app is named todo.
I want to deploy it to GAE using Google Cloud SQL.
Connection looks like this:

if not request.env.web2py_runtime_gae:
db = DAL(myconf.take('db.uri'), pool_size=myconf.take('db.pool_size', 
cast=int), check_reserved=['all'])
else:
db = DAL('google:sql://gigcity-1951:dbtest/tomsdatabase')
# etc.

When I try to connect I get an "Internal error":
https://gigcity-1951.appspot.com/todo/

If I click the ticket link the ticket's missing.

Clue: It's not asking me for my Google credentials.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Consultant needed for GAE, testing, single page app issues

2015-10-21 Thread Tom Campbell


I'm a novice web2py developer working on a scheduling app using Google App 
Engine and Google Cloud SQL. Am looking for specific help on things that 
are holding me up, notably:


   - 
   
   General deployment issues regarding App Engine and Google SQL
   - 
   
   Testing. At the moment just to ensure database indexes get created but 
   obviously I want the whole app covered
   - 
   
   Single-page app issues: what's involved in loading just part of the HTML 
   page. I thought I had it nailed (see my web2pyslices post 
   
<http://www.web2pyslices.com/slice/show/2030/creating-a-single-page-app-with-web2py>)
 
   but I think I was deluded.
   

Looking for someone who can help me over Skype or whatever. Goal is to help 
me learn it, then endure my emailed questions as I try to understand it and 
re-document it in language even I can understand. If any of these topics 
sounds worth your time I'd love to know your terms and availability. 
Guessing this is a 4-8 hour commitment over a few days.

For what it's worth, I want very much to give back to the web2py community. 
I am documenting this as I go 
<https://www.gitbook.com/book/tomcam/using-google-app-engine-with-google-cloud-sql-and/details>
 
in a free book on deploying web2py apps on GAE with Cloud SQL.

Cheers,

Tom Campbell

tomcampb...@gmail.com. Seattle area. My (already) publicly available phone 
# is (425) 260-5292

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: OS X Permissions question: echo works in ../web2py but not ../web2py/applications?

2015-10-20 Thread Tom Campbell
Ah, relief. You have diagnosed the issue exactly.

Thank you so much.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: OS X Permissions question: echo works in ../web2py but not ../web2py/applications?

2015-10-20 Thread Tom Campbell
Thank you, Dr. Di Pierro! I did reboot, then run Disk Utility, which is now
so user friendly I couldn't see what it found. Didn't solve the problem. I
will indeed use chown. Just wanted to make sure there was no change of
permissions in web2py that I needed to know about.  Thought maybe there was
some kind of security upgrade or something that using chown might break
something else down the line.

On Tue, Oct 20, 2015 at 9:06 AM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> I do not know but you do seem to have permissions to write in that folder.
> You can use chmod and chown to restore those permissions. This could also
> be a problem with the filesystem. Some time permissions go bad in OSX and
> you have to use the Disk Utils to fix permissions and then reboot.
>
>
> On Monday, 19 October 2015 20:53:28 UTC-5, Tom Campbell wrote:
>>
>> In the most recent version of Mac OS X, if I'm in the web2py directory
>> this works fine:
>>
>> echo "# todo" >> README.md
>>
>> Yet if I'm in web2py/applications or any of its subdirectories I get a
>> "Permission denied" error. What incredibly stupid thing am I doing wrong?
>>
>>
>>
>>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/oqYxn3E8xuc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] OS X Permissions question: echo works in ../web2py but not ../web2py/applications?

2015-10-19 Thread Tom Campbell
In the most recent version of Mac OS X, if I'm in the web2py directory this 
works fine:

echo "# todo" >> README.md 

Yet if I'm in web2py/applications or any of its subdirectories I get a 
"Permission denied" error. What incredibly stupid thing am I doing wrong? 




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] GAE app works locally, not deployed to cloud

2015-10-16 Thread Tom Campbell
Plan is to host my app on GAE eventually.

I have a small demo app named todo that works fine this way, deployed using 
the GAE local server:

$ cd /usr/local/web2py
$ python web2py.py -G GAE
$  dev_appserver.py ../web2py

But when I deploy it to the cloud:
$ dev_appserver.py ../web2py

and vist https://myapp.appspot.com,I get a web2py "Internal Error" and 
ticket link. Unfortunately, there's no ticket:

  






*Error ticket for "todo"  Ticket ID  
2601_600_8101_309d_5d06_5f8c_1081_6cc1.2015-10-16.08-59-40.fb686be5-e2ca-4860-a787-e703fc2929c1
  
Version  web2py™Version 2.12.3-stable+timestamp.2015.08.18.19.14.07  
Ticket Missing*
Nothing appears in the error log or the error database.

How can I track down this error?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: 0.db naming convention?

2015-10-15 Thread Tom Campbell
Thank you, Leonel. AppConfig seems to be totally undocumented. Is this my 
cue to contribute to the docs by rooting around in the source 
 and 
asking you folks stupid questions about AppConfig?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] 0.db naming convention?

2015-10-14 Thread Tom Campbell
I notice there seems to be a convention that application-specific models go 
in a file named 0.db. Any particular reason for that or inside info that 
makes it easier to work with later? 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Version control: web2py and my application in separate repos?

2015-10-09 Thread Tom Campbell
Thank you, Leonel and Vincinius. So it seems that the canonical way to do 
this would be as follows?


# Create a git repo of web2y and pydal on your local machine

$ git clone --recursive https://github.com/web2py/web2py.git


# Inside the web2py directory...

$ cd web2py


# ...check out version 2.12.3 of webp2y

$ git checkout -b v2.12.3 R-2.12.3



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Version control: web2py and my application in separate repos?

2015-10-09 Thread Tom Campbell
My app is under version control at Github. It will be deployed on Google 
App Engine.
There's a chance that web2py could be updated and render some of my app's 
behavior unpredictable, or, more likely, GAE could screw something up and 
break web2py.

I think the obvious choice, then, is to have a separate repo for whatever 
version of web2py has been tested with my app. Is it that simple or am I 
missing something?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Version control: web2py and my application in separate repos?

2015-10-09 Thread Tom Campbell
Me too. I have to be honest, the reason I'm using my own web2py repo is 
because I don't understand the WARNING: DO NOT DOWNLOAD RELEASES FROM THIS 
GITHUB PAGE at https://github.com/web2py/web2py/releases thing.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: A helper callback not working as expected

2015-10-07 Thread Tom Campbell
Thank you, Anthony. I was working with a much older version of web2py. I 
updated to 2.12.3-stable and it appears to be working fine. 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] A helper callback not working as expected

2015-10-06 Thread Tom Campbell
I would expect this to link to default/completed. My app is named ajaxtodo. 
I have controller() defined in default.py. However, the A helper below only 
links to http://127.0.0.1:8000/ajaxtodo/default/index#null

 {{=A('Completed', callback=URL(c='default', f='completed'))}}

How can I get that to go to ajaxtodo/default/completed ? Thank you.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: How to demonstrate LOAD() working properly?

2015-10-02 Thread Tom Campbell
Ugh, this is not my week. I'm working on a complete sample app & will post
it ASAP. Thanks, and sorry.

On Fri, Oct 2, 2015 at 4:21 PM, pn <pallav.n...@gmail.com> wrote:

> Hi, the link you posted shows a blank page. I think you may have
> copy-pasted from inside an email that requires you to have been logged in,
> try visiting the link and copy-pasting from the browser URL. Or maybe
> provide the example of your app by uploading it to github/bitbucket.
>
>
> On Friday, October 2, 2015 at 7:05:24 PM UTC-4, Tom Campbell wrote:
>>
>> I am working on a simplified single-page app demo. I think I have it
>> working, but I'm not sure because I need to demonstrate that only part of
>> the page is reloading. Most of the code is shown in this post:
>>
>>
>> https://mail.google.com/_/scs/mail-static/_/js/k=gmail.main.en.Pryf_O7ZHDs.O/m=m_i,t/am=PiM-ZGD_3_uDWGcIoF3ySIW999_vLil2_-Hx_3sQQbJXAP8A-H8A_wEvRF9I/rt=h/d=1/t=zcms/rs=AHGWq9CcTajC8VF4OQk0ZBX1nqhzCmoSzQ
>>
>> Despite using LOAD() and seeing the correct XHR requests being made in
>> the Javascript console, reloads seem to occur exactly as often as if I
>> didn't use LOAD().
>>
>> What is the best way to demonstrate that LOAD() is only loading partial
>> pages on demand, and that the static portion is not being reloaded?
>>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/dRrvLGtjsr0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] How to demonstrate LOAD() working properly?

2015-10-02 Thread Tom Campbell
I am working on a simplified single-page app demo. I think I have it 
working, but I'm not sure because I need to demonstrate that only part of 
the page is reloading. Most of the code is shown in this post:

https://mail.google.com/_/scs/mail-static/_/js/k=gmail.main.en.Pryf_O7ZHDs.O/m=m_i,t/am=PiM-ZGD_3_uDWGcIoF3ySIW999_vLil2_-Hx_3sQQbJXAP8A-H8A_wEvRF9I/rt=h/d=1/t=zcms/rs=AHGWq9CcTajC8VF4OQk0ZBX1nqhzCmoSzQ

Despite using LOAD() and seeing the correct XHR requests being made in the 
Javascript console, reloads seem to occur exactly as often as if I didn't 
use LOAD().

What is the best way to demonstrate that LOAD() is only loading partial 
pages on demand, and that the static portion is not being reloaded?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] console.log on page reload?

2015-10-01 Thread Tom Campbell
Working on a single-page app and trying to ensure that only part of the 
page gets refreshed. Doing some tests using LOAD() that look like this:

*file default/new.html:*

{{extend 'layout.html'}}
{{=LOAD('default', 'new.load',ajax=True)}}

*file default/new.load:*

{{if 'message'in globals():}}
{{=message}}
{{pass}}
{{=form}}

I added this detection code to* web2py_ajax.html*:



But the refresh seems to be called every time I choose the action. However, 
when viewing the console output in Chome I get the hoped-for message 
starting with:

RELOADED Thu Oct 01 2015 15:36:45 GMT-0700 (PDT)

XHR finished loading: GET "http://127.0.0.1:8000/spa1a/default/new.load;
etc.

What am I doing wrong?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: console.log on page reload?

2015-10-01 Thread Tom Campbell
Thank you, Derek, but I'm still flummoxed. I added this new script tag to 
web2py_ajax.html:

console.log('loaded ' + Date.now())

But I'm getting this message even when I use LOAD(). So I'm trying to 
understand whether I am placing this code in the wrong location or what, 
because I think it shouldn't be redrawing the page. The XHR record output 
seems to confirm this.

FWIW the actions are called this way from menu.py:

response.menu = [
('Demo', False, '', [
(T('New task'), False, URL('default', 'new')),
(T('Show all tasks'), False, URL('default', 'all')),
]),
]

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] GAE/Google AppEngine problem with web2py: Deployment successful but GAE does not launch

2015-07-30 Thread Tom Campbell
My AppEngine ID is memberable0.
I copied examples/app.example.yaml to web2py root as app.yaml
Only change I made was:
application: memberable0
Web2py lives in /Users/tom/Dropbox/work/m/web2py and that path shows 
successfully in GoogleAppEngineLauncher, which shows port 8081 for the web 
server (not running web2py's Rocket server).

Nothing happens. GoogleAppEngineLauncher just sits there with the yellow 
wait icon in the leftmost column.
The Log Console for memberable0 shows literally nothing.
In Chrome the Network tab in the dev tools shows nothing was ever loaded.

If I run this from the shell:
$ appcfg.py update .

I get tons of output, with thousand of lines that look like this:

# Tons of the following:
Could not guess mimetype for 
applications/lte/static/css/fontawesome/src/3.2.1/assets/less/bootstrap-2.3.2/responsive.less.
 
Using application/octet-stream.

# Finally ending with:
03:25 PM Cloning 8105 static files.
03:25 PM Cloned 2000 files.
03:25 PM Cloned 4000 files.
03:25 PM Cloned 6000 files.
03:25 PM Cloned 8000 files.
03:25 PM Cloning 1097 application files.
03:25 PM Compilation starting.
03:25 PM Compilation completed.
03:25 PM Starting deployment.
03:25 PM Checking if deployment succeeded.
03:25 PM Deployment successful.
03:25 PM Checking if updated app version is serving.
03:25 PM Completed update of app: memberable0, version: 1

Nonetheless, when I click Run, GoogleAppEngineLauncher is still inert. Out 
of desperation I have tried other ports like 12080 but to no avail.

Can anyone tell me what I'm doing wrong or if there's some other diagnostic 
tool I'm missing?

Version 2.9.12-stable+timestamp.2015.01.17.06.11.03
Running on a high end Mac, OS X Yosemite 10.10.4

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Silly out of band question about deploying web2py

2015-06-01 Thread Tom Campbell
I am building a SaaS business and am not yet able to hire someone to do the 
hard stuff (which is everything but the programming). Is there some kind of 
managed solution I should be looking at, maybe GAE? 

This message by Lewis 
https://groups.google.com/forum/?utm_source=digestutm_medium=email#!topic/web2py/JcYrm3FErb4
 
hit home to me because despite 6 months of trying to learn proper 
deployment I still get these same kinds of mysterious errors from time to 
time and spend way too much time tracking them down. This is not usually 
web2py's fault, it's mine, for having so much difficulty learning the ins 
and outs of system administration. But I dread the day when I accidentally 
do an apt-get upgrade and my site breaks with paying customers waiting for 
me to figure out what went wrong. Or when, like Lewis, I'm not even sure 
where the problem came from.

If I could find the book on what sysadmin tasks I need to deploy a 
production, secure web2py site and keep it safe, I'd be thrilled.

My needs would be to:

   - Be able to upgrade web2py versions easily but roll back if something 
   goes wrong (my app is in git, of course)
   - Not need to worry about Ubuntu (or Debian, CentOS, whatever) upgrades 
   killing my site and leaving paying customers in the lurch for a couple days
   - Support multitenant apps
   - Keep the price of hosting down to, say, no more than 1/3 of a 
   full-time sysadmin

Maybe it's as easy as using Docker? Haven't used it in a real deployment 
situation so I don't know.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Replacing layout.html with an AdminLTE dashboard

2015-05-10 Thread Tom Campbell
AdminLTE is a beautiful dashboard https://www.almsaeedstudio.com/preview 
template. Using it in my current project, and I've posted it to Github at 
AdminLTE-web2py https://github.com/tomcam/AdminLTE-web2py. Let me know 
what egregious mistakes I've made. I did follow along with my tutorial to 
make sure it worked, but deciding what to strip out for the demo and what 
to leave in was nonobvious.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Tutorial: Populating a Handsontable Grid using web2py

2015-05-09 Thread Tom Campbell
Done and done, Ken--another blog post floating in the wind. Fixed the CRUD 
thing and a few other items.

PyGuy web2py Handsontable tutorial #1: Populating a Handsontable grid using 
web2py 
http://www.pyguy.com/web2py/web2py-handsontable-tutorial-1-populating-a-handsontable-grid-using-web2py/


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: LOAD() problem: Yes, I am bungling the world's smallest web2py app.

2015-04-25 Thread Tom Campbell
Thanks, Dmitry--some questions.

   1. What does will take no view mean for the showtasks() method?
   2. Why are .load extensions not recommended? There seems to be some 
   history on the list but I don't understand the issues.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: LOAD() problem: Yes, I am bungling the world's smallest web2py app.

2015-04-25 Thread Tom Campbell
MAGIC! Thank you, Anthony and Dmitry. I misread Dmitry's code for the view 
and retained the dict() when returning a value from showtasks(), and 
removed showtasks.load. That is completely  wild! Thought I had read the 
book thoroughly before bugging you folks. Thank you.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] LOAD() problem: Yes, I am bungling the world's smallest web2py app.

2015-04-23 Thread Tom Campbell
When I run the following no error gets logged but index.html gets the 
message invalid function (default/showtasks) rendered in the view.

Controller in default.py:
def index():
return dict(grid=SQLFORM.grid(db.task,user_signature=False))

index.html:
{{extend 'layout.html'}}
{{=LOAD('default', 'showtasks.load',ajax=True)}}

default/views/showtasks.load:
{{if 'message' in globals():}}
h3{{=message}}/h3
{{pass}}
{{=grid}}


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: LOAD() problem: Yes, I am bungling the world's smallest web2py app.

2015-04-23 Thread Tom Campbell
Anthony, thank you thank you thank you! I made these changes as follows and 
it works like a charm.

In default.py
def index():
return locals()

def showtasks():
return dict(grid=SQLFORM.grid(db.task,user_signature=False))



I never considered for a second I would require a controller. I somehow 
thought it was by definition index() that would be the controller, and that 
its view would call another view.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Best way to display table columns in correct order using a Handsontable

2015-04-08 Thread Tom Campbell
I have a query result named todos I am loading into a Handsontable in the 
view. The code below populates the Handsontable, but columns do not  appear 
in the order they are defined in db.define_table().
In this case, while the database columns are 
'id','title'.'description','priority', and 'completed', but Handsontable 
renders in the order 'description','title','completed', 'priority', and 
'id'.

What is the most idiomatic way to ensure Handsontable populates in the 
right column order? I know todos.colnames does list them as desired.

*CONTROLLER FILE default.py:*
# Fetch all todos completed or now into a query result
def index():
return dict(todos=db(db.todo).select())


*VIEW FILE index.html:*
!-- List all todos --
{{extend 'layout_adminlte.html'}}
script src=http://handsontable.com/dist/handsontable.full.js;/script
link rel=stylesheet media=screen 
href=http://handsontable.com/dist/handsontable.full.css;
div id=todo-table/div
script
var
todoTableData = {{=XML(todos.json())}},
todoTableDiv = document.getElementById('todo-table'),
todoTableSettings = {
data:todoTableData
},
todoTableRef;
todoTableRef = new Handsontable(todoTableDiv, todoTableSettings);

/script

*MODEL FILE db.py:*
db.define_table('todo',
Field('title',notnull=True),
Field('description','text'),
Field('priority','integer',default=3,
requires=IS_IN_SET([1,2,3,4,5],
labels=[T('Very low'), T('Low'), T('Medium'), T('High'), T('Very 
High')], zero=None)),
Field('completed','boolean',default=False),format='%(name)s')

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Difference between response.files.insert() and URL(), and congratulations on v2.10

2015-04-01 Thread Tom Campbell
(First--congrats on v2.10 and thanks to all you contributors for an 
incredible framework.)

What's the difference between these two lines of code?

response.files.insert(1,URL('static','adminlte/bootstrap/css/bootstrap.min.css'))

link href={{=URL('static','adminlte/bootstrap/css/bootstrap.min.css')}} 
rel=stylesheet type=text/css /

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] internal error: [Errno 1] Operation not permitted when attempting Pack All

2015-03-17 Thread Tom Campbell
Attempting to do a Manage  Pack All on a project but I get this message:

messageinternal error: [Errno 1] Operation not permitted: 

I am attempting to save to the Dropbox directory in which web2py lives. 
What should to do to get it to pack correctly?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Creating my own layout.html, but errors not displaying

2015-02-23 Thread Tom Campbell
Ugh, I thought I copyedited. For clarification:

On Monday, February 23, 2015 at 3:58:52 PM UTC-8, the idiot Tom Campbell 
wrote:

 Creating my own layout.html based on the AdminLTE theme 
 https://github.com/almasaeed2010/AdminLTE. It works, but errors are not 
 being displayed. For example, I have a  notnull*=*True validation rule in 
 the 'description' field of the 'todo' model but if a description isn't 
 *entered*, no .error class div appears. What markup do I need to ensure 
 those errors get shown?


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Creating my own layout.html, but errors not displaying

2015-02-23 Thread Tom Campbell
Creating my own layout.html based on the AdminLTE theme 
https://github.com/almasaeed2010/AdminLTE. It works, but errors are not 
being displayed. For example, I have a  notnull*=*True validation rule in 
the 'description' field of the model model but if a description isn't 
displayed, not error appears. What markup am I omitting to ensure those 
errors get shown?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Force authentication to whole app

2015-02-12 Thread Tom Campbell


 To take advantage of the decorators at a file level, you can also do this 
 at the top level of a file:

 auth.requires_login()(lambda: None)()

 The decorators ultimately call auth.requires, which itself returns a 
 decorator. The above passes a dummy function to that decorator and then 
 simply calls it. Note, you don't prepend with @ in this case, as you are 
 not decorating a Python function.

 I think that's brilliant... but I don't quite understand. Without the 
decorators how to the functions in the file get forced to go through 
auth.requires_login()? 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Adding entry to the printed book index

2015-02-12 Thread Tom Campbell
To the printed book index.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Adding entry to the printed book index

2015-02-11 Thread Tom Campbell
I'd like to add terms to the book's index. Looked at the book source 
https://github.com/mdipierro/web2py-book/tree/master/sources on github 
but couldn't figure out where that would happen so I could issue a pull 
request. Can someone give me a brief description of where I'd find it? 
Thanks!

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Is SQLFORM hardcoded to use layout.html?

2015-02-11 Thread Tom Campbell
I'm sure it's not, that title was just click bait :-O

I have created a file called ltelayout.html, based on layout.html.

My new() method in default.py is:

def new():
return dict(form=SQLFORM(db.todo, submit_button='Save'))


My view new.html is:

{{extend 'ltelayout.html'}}
h1NEW!!/h1
{{=form}}


But when I navigate to /default/new the H1 isn't there and it's using 
layout.html, not ltelayout.html. It appears that SQFORM is somehow not 
using the overrident view or something?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Is SQLFORM hardcoded to use layout.html?

2015-02-11 Thread Tom Campbell
Um... I put the view in /views/new.html, not /views/default/new.html. TIME 
TO GET SOME SLEEP

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Adding entry to the printed book index

2015-02-11 Thread Tom Campbell
Stuff like this:

Between Web Services and websockets I'd put web2py_ajax_component

Between load and Lotus Notes I'd put locals()

Between Expression and extent I'd put extend (or insert {{extend}} at
the beginning?)


On Wed, Feb 11, 2015 at 11:30 PM, Niphlod niph...@gmail.com wrote:

 please give an example of what you're trying to add ^_^


 On Wednesday, February 11, 2015 at 11:33:04 PM UTC+1, Tom Campbell wrote:

 I'd like to add terms to the book's index. Looked at the book source
 https://github.com/mdipierro/web2py-book/tree/master/sources on github
 but couldn't figure out where that would happen so I could issue a pull
 request. Can someone give me a brief description of where I'd find it?
 Thanks!

  --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/oCMlpKs5T3c/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Why is the world's smallest web2py app failing?

2015-01-17 Thread Tom Campbell
Took a while to respond because I'm embarrassed. I somehow thought that 
omitting the @auth.requires_login() decorator would eliminate that default 
behavior and did not bother to test my assumption. Thank you.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Why is the world's smallest web2py app failing?

2015-01-17 Thread Tom Campbell
Having problems with grid and smartgrid not showing Add and buttons. So I 
created the smallest possible app and they still don't show up. Here is the 
code.


# append to db.py

db.define_table('supplier', Field('name'))


# file index.html

{{extend 'layout.html'}}

{{if 'message' in globals():}}

h3{{=message}}/h3

{{pass}}

{{=grid}}


# file default.py

# Replace the index() action:

def index():

grid=SQLFORM.smartgrid(db.supplier)

return locals()


Image of smartgrid attached.


What incredibly stupid thing am I doing? Or not doing?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Why can I peek but not edit some existing files?

2015-01-15 Thread Tom Campbell
I created a file called default/view.html using the web interface. It looks 
as expected when I peek at it:

{{extend 'layout.html'}}
h1This is the default/view.html template/h1
{{=BEAUTIFY(response._vars)}}


However, when I choose to edit that file using the web interface I get a 
blank, uneditable page. This happens with several view files I created. 

Browser console shows this error originating from comment-fold.js: 

TypeError: lineText is undefined


Running web2py with this info in the VERSION file: Version 
2.9.5-stable+timestamp.2014.03.16.02.35.39

python.exe is on a local drive, web2py and Application directory are on 
Dropbox drive.

How can I get access to these files?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Smartgrid: Display name as string instead of id?

2014-02-26 Thread Tom Campbell
Thanks, Stifan! Turns out I was working too hard. This is the modern way to 
do it.

model db_pos.py:

db=DAL('sqlite://storage.sqlite')

db.define_table('supplier', Field('name'), format='%(name)s')

db.define_table('item', Field('name'), Field('supplied_by', db.supplier))

controller default.py:

@auth.requires_login()

def items():

   grid=SQLFORM.grid(db.item)

   return locals()

@auth.requires_login()

def suppliers():

   grid=SQLFORM.grid(db.supplier)

   return locals()

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Smartgrid: Display name as string instead of id?

2014-02-25 Thread Tom Campbell
An Item has a supplier as shown in the schema below. I would like smartgrid 
to diplay a supplier as 'Costco' rather than its id, which is 3. What's 
wrong with this picture? 

db_foo.py:
db=DAL('sqlite://storage.sqlite')
db.define_table('supplier',
Field('name', unique=True, requires=IS_NOT_EMPTY()))

db.define_table('item',
Field('name',unique=True, requires=IS_NOT_EMPTY()),
Field('supplied_by','reference supplier'))

db.item.supplied_by.requires = 
IS_IN_DB(db,'supplier.id','%(name)s',zero=T('Choose one'))

controller default.py
@auth.requires_login()
def items():
grid=SQLFORM.smartgrid(db.item)
return locals()


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: web2py on windows 7

2011-11-20 Thread Tom Campbell
I would avoid this by putting Python on the path, then web2py
somewhere outside of Program Files, which I would claim is bad form
anyway. Like a web2py directory off root, maybe? I can post a little
tutorial for a manual Windows install of web2py illustrating this if
you like.


[web2py] Simple query suffers nasty case of user error...

2011-11-03 Thread Tom Campbell
...but I'm too much of a noob to get it.

# file models/db_todo.py
db.define_table('todo',
Field('summary','string',requires=IS_NOT_EMPTY()),
Field('priority',requires=IS_IN_SET([1,2,3,4,5])),
Field('complete','boolean',default=False))

# file views/main/index.html
{{extend 'layout.html'}}
h2Current tasks/h2
{{=grid}}

# file controllers/main.py
@auth.requires_login()
def index():
# Show only remaining tasks
todos = db(db.todo.complete==False).select()
grid=SQLFORM.smartgrid(db.todo,todos)
return dict(grid=grid)

1. The main/index.html view is meant to show only completed tasks
(completed==False). It shows all of them.

2. The dropdowns for Priority start with a blank slot, not 1.


[web2py] Advantage to requires clause in controller vs model?

2011-10-30 Thread Tom Campbell
In the building a minimalist facebook http://vimeo.com/21364178 clone 
video at around 7:30 I see this in default.py:

def search()
 # make a form where to type a name
 form = SQLFORM.factory(Field('name',requires=IS_NOT_EMPTY())) 

Question about the requires. This no difference between putting the 
requires clause there vs. in the define_table() method in the model, 
correct? If not is either way considered to be a better web2py convention? 
Generally I think I'd like it in the model, and put it in the controller 
only where it does something contrary to expected behavior, but I'm a noob.


[web2py] Where's the applications directory on OSX filesystem?

2010-11-04 Thread Tom Campbell
I'm changing to OSX from Windows and can't browse to the applications
directory.  If I search for the view file customer.html from the
command line I see it easily:


$ find . -name customer.html
./osx/1.88.2/web2py/web2py.app/Contents/Resources/applications/
scheduler/views/customer.html

However I can't see my Web2py applications folder in the Finder. (And
therefore can't copy my old Windows project there.) web2py.app seems
to be the application that launches web2py, and it's not clear to me
how it's a containing directory as well.


[web2py] Re: Where's the applications directory on OSX filesystem?

2010-11-04 Thread Tom Campbell
Of course I figured this out moments after I posted, even though I'd
pondered it for some time before. Sorry for wasting your intellectual
bandwidth.


[web2py] Newb question: How to handle multiple controller levels?

2010-10-30 Thread Tom Campbell
I have an app that supports multiple organizations.
Each organization has many customers.
Each customer has many appointments.

I think that means organizations, while controllers, employ a customer
controller, which employes an appointment controller.

In my head the URL for editing an appointment should therefore look
like this:

 /hostname/organization/5/customer/2/appointment/edit/9

This kind of organization also lets one bookmark an action or record
easily.

I am doing multiple things wrong, of course, but I don’t know exactly
what. Can someone explain at a high level what I should correct,
ideally some documentation somewhere? I have been reading the 3rd
edition section 4.2 but am stuck. Thanks!


[web2py] Re: Newb question: How to handle multiple controller levels?

2010-10-30 Thread Tom Campbell
Never mind. Crushingly brilliant chap that I am, immediately after
posting that I realized I have the luxury of constructions like:

  _href=URL('appointment','edit',args=[customer,appointment]))


[web2py] Best way to update schedule with multiple users/locations?

2010-10-26 Thread Tom Campbell
I'm writing a scheduling system in web2py. It can be used by multiple
users in multiple locations. If one user adds an appointment, I'd like
other users to see it within 10 seconds or so. What is the preferred
mechanism for this? My poorly educated guess is:

1. An updater runs as a single background process as in section 4.19,
checking the database for new or changed appointments at all locations
and enqueues them
2. Each client schedule running in browser runs a cron job to check
the queue for matching appointments
3. If any appointments in the queue satisfy the search criteria (i.e.
appointments at that location), the calendar gets redrawn

Any feedback would be greatly appreciated.


[web2py] Confirm deletion of record

2010-10-01 Thread Tom Campbell
I have a 'Delete' link in my edit view. The controller looks like
this:

def delete():
task=db.tasks[request.args[0]]
form = crud.delete(db.tasks, task.id,
next=URL(r=request,f='index'), message=T('Deleted'),deletable=True)
return dict(form = form)

what I want is before the crud.delete to ask whether the user really
wanted to delete. Is there some way to put up a confirmation dialog in
the delete action? The framework puts the logic for it in the view of
course, but I'd like to avoid the 2-step process of checkbox, then
submit. Instead I'd like a Delete button, then a confirmation.


[web2py] Re: Why the pattern return dict(form=form)?

2010-09-17 Thread Tom Campbell
Wow, huge help. Thanks a TON, Bruno and Jonathan. You're both awesome
members of the community. I hope to be the same one day.
Cheers,
TC


[web2py] Why the pattern return dict(form=form)?

2010-09-16 Thread Tom Campbell
New to Python  web2py. Searched for but could not find an explanation
of why so much code looks like:

  return(form=form)

What makes the assignment necessary?


[web2py] web2py_vs_others missing T() section!

2010-09-08 Thread Tom Campbell
I just learned about  http://www.web2py.com/examples/static/web2py_vs_others.pdf
on StackOverflow a few minutes ago so maybe this is old news, but the
Internationalization section doesn't talk about web2py's elegant T()
object. That section doesn't mention web2py at all!

Just discovered web2py Friday  am totally blown away.