Well, to be honest, I didn't realize that you *could* pass a model
object.

I just created this simple project and it works.

Perhaps you will see something in this that will help:


Model.py:
============================
from turbogears.database import PackageHub
from sqlobject import *

hub = PackageHub("testproj")
__connection__ = hub

class pobj(SQLObject):
   field1 = StringCol()


(Don't forget to add a record or two with CatWalk.)


controllers.py
================
from turbogears import controllers, expose
from turbogears.widgets import TextField, TableForm, WidgetsList
from model import pobj

class TestFormFields(WidgetsList):
   field1 = TextField(label="TestField1:")

testform = TableForm(fields=TestFormFields())

class Root(controllers.RootController):
   @expose(template="testproj.templates.welcome")
   def index(self):
       p = pobj.get(1)
       return dict(form=testform, values = p)



welcome.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>Welcome to TurboGears</title>
</head>
<body>
${form(value=values)}
</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
-~----------~----~----~----~------~----~------~--~---

Reply via email to