Thanks Lee, I will try this next.
In the meantime I have created a small test-case that reproduces the
problem for me, here it is. Just click around 10-20 times and you can
see the values changing, then try refreshing...
Note that dev.cfg declares sqlobject.dburi="notrans_sqlite:///..."
file: model.py
======================================================
from sqlobject import *
from turbogears.database import PackageHub
hub = PackageHub("bug")
__connection__ = hub
class Item(SQLObject):
data = UnicodeCol(length=40)
def loaddb():
hub.begin()
Item.dropTable(ifExists=True, cascade=True)
hub.commit()
Item.createTable(ifNotExists=True)
for i in range(20):
Item(data = str(i))
hub.commit()
loaddb()
import turbogears
from turbogears.controllers import RootController, expose
from model import Item
file: controllers.py
======================================================
class Root(RootController):
@expose(template="bug.templates.index")
def index(self):
items = Item.select()
return dict(items = items)
@expose(template="bug.templates.index")
def change(self, id):
item = Item.get(id)
item.data += str(id)
items = Item.select()
return dict(items = items)
file: index.kid
======================================================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://purl.org/kid/ns#"
py:extends="'master.kid'">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type"
py:replace="''"/>
<title>Items</title>
</head>
<body>
<ul py:for="i in items">
<li>${i.data} <a href="/change/${i.id}">[edit]</a></li>
</ul>
</body>
</html>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---