[web2py] Re: import error debian package

2011-06-09 Thread Jeff Elkner
We copy the math_quiz directory and all its contents from a source install 
of web2py, where it works, to the application directory of a user created by 
the debian package, where it gives the error above.

Three of us have confirmed this on three separate installations.  We are 
pretty confident it is an error with the way the package works.



[web2py] Help needed adding rows to a database table...

2010-06-14 Thread Jeff Elkner
It is the end of the school year and my students and I are trying to
create simple projects using web2py.

Can you point me to a simple example of web2py creating and
accessing a database?  By simple I mean from the teaching
perspective.  I wanted to create a little application that stored
quotes in a database.  Here is what I have so far:

The Controller (default.py):

def index():
   return dict()

def addquote():
   form = SQLFORM(db.quotes)
   return dict()


The Views (index.html):

?xml version=1.0 encoding=UTF-8?
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN
http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd;
html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en
head
titleQuotable Quotes/title
link rel=stylesheet type=text/css href=../static/style.css /
/head
body
h1Quotable Quotes/h1

h2Choose:/h2
ul
 lia href=addquoteAdd a quote to the database./a/li
/ul

/body
/html

and addquote.html:


?xml version=1.0 encoding=UTF-8?
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN
http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd;
html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en
head
titleQuotable Quotes/title
link rel=stylesheet type=text/css href=../static/style.css /
/head
body
h1Quotable Quotes/h1

form
fieldset
 legendQuote:/legend
 textarea name=quote rows=5 cols=100/textarea
/fieldset
fieldset
 legendAuthor:/legend
 input type=text name=author /
/fieldset
button type=submitSubmit/button
input type=hidden name=_formname value=addquote /
/form

/body
/html

and finally the db.py file:

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

db.define_table('quotes', Field('quote'), Field('author'))

++

The database gets created, and when I visit the addquote.html view, I
can fill in the forms and click the submit button without error, but
no rows are added to the table.

How can I get that to work?  The database chapter in the book is not
very helpful to a database beginner such as myself, since all the
examples are from a shell, and it doesn't show how to connect the
pieces together inside an application.

Thanks!

jeff elkner


[web2py] Setting up a web2py server...

2010-06-14 Thread Jeff Elkner
Hi Massimo,

I'm still working on a recipe for setting up a web2py server on Ubuntu
10.04.  I've asked the help of a friend, Douglas Cerna, who does not
know web2py, but who is a Zope 3 developer on the SchoolTool project.
We are interested in using web2py to create websites for some schools
with which we are working in El Salvador.  To limit the expense at
this early stage in the process, I plan to setup two instances of
web2py -- one for my personal website and one for the Salvadoran
project.

Here is what we have so far:

http://docs.google.com/View?id=dgv2st82_287c4t9chdt

We are trying to work out a few issues with the base href of the site.
 Using apache rewrite rules, the default directory gets taken out of
the path, so applications that work on the development server on my
desktop break on the web site.

I'll post updates, but any guidance which would save us time would be
most appreciated!

Thanks.

jeff elkner