Apologies if this turns out to be some simple thing, but I've spent a
while Googling and asking around to no avail.

I have a "base" template and templates for my content set up as
described on the templetor page. The content area will naturally vary
in size, and this is where the problem comes in. It seems that adding
one line of content can only be done at the cost of losing one
character from the common footer in the "base" template.

I have the to-do list basic program set up as described on the
tutorial page here at http://75.33.96.148/ . I've added delete
functionality so you can watch the footer disappear and reappear. Add
an item and lose a character off the footer. Remove it and get it
back!

Relevant code:

the "base" template (with full footer visible in the HTML):
http://75.33.96.148/templates/base.html

the "index" template (i.e. content pane, almost verbatim from
tutorial): http://75.33.96.148/templates/index.html

View->Source on both of these shows that they work fine individually.

And the code.py behind it all:

=====================================================

import web

render = web.template.render('templates/', cache=False)

urls = (
    '/', 'index',
    '/add', 'add',
    '/delete/(.*)', 'delete')

class index:
    def GET(self):
        todos = web.select('todo')
        print render.base(render.index(todos))

class add:
    def POST(self):
        i = web.input()
        n = web.insert('todo', title = i.title)
        web.seeother('/')

class delete:
    def GET(self, id):
        result = web.delete('todo', where='id = $id', vars = {'id':
id})
        web.seeother('/')

web.webapi.internalerror = web.debugerror
web.config.db_parameters = dict(dbn='mysql', user='tester',
pw='********', db='sandbox')
if __name__ == "__main__": web.run(urls, globals(), web.reloader)

=====================================================

View->Source on the resulting rendered page shows that it just stopped
sending data after this point in the footer (i.e. the </body> and
other tags don't make it through either). I ran into this problem
while designing a production app but built this little sandbox just to
make sure I could recreate it. As far as I can guess, it's either
something in the rendering or possibly some weird server bug (I'm
running Apache 2.2.8 with a standard CGI deployment of web.py).

Also a minor side nuisance: How do I get it to play nice with
mod_rewrite so that web.seeother('/') doesn't reintroduce a "code.py"
in the URL? That's what breaks my stylesheet reference, I believe.

Any help on this weird problem would be appreciated!

- M.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to