[xiph-commits] r13238 - in trunk/icebreaker/Icebreaker: .
icebreaker icebreaker/templates
nickmudd at svn.xiph.org
nickmudd at svn.xiph.org
Tue Jul 10 00:44:02 PDT 2007
Author: nickmudd
Date: 2007-07-10 00:44:01 -0700 (Tue, 10 Jul 2007)
New Revision: 13238
Modified:
trunk/icebreaker/Icebreaker/devdata.sqlite
trunk/icebreaker/Icebreaker/icebreaker/controllers.py
trunk/icebreaker/Icebreaker/icebreaker/controllers.pyc
trunk/icebreaker/Icebreaker/icebreaker/templates/create.kid
trunk/icebreaker/Icebreaker/icebreaker/templates/create.pyc
Log:
edited create.kid and controllers.py to put it back to the correct way
of doing things, also broke create view.
Modified: trunk/icebreaker/Icebreaker/devdata.sqlite
===================================================================
(Binary files differ)
Modified: trunk/icebreaker/Icebreaker/icebreaker/controllers.py
===================================================================
--- trunk/icebreaker/Icebreaker/icebreaker/controllers.py 2007-07-09 22:45:07 UTC (rev 13237)
+++ trunk/icebreaker/Icebreaker/icebreaker/controllers.py 2007-07-10 07:44:01 UTC (rev 13238)
@@ -1,4 +1,4 @@
-from turbogears import controllers, expose, flash
+from turbogears import controllers, expose, flash, validate
# from model import *
from turbogears import identity, redirect
from cherrypy import request, response
@@ -54,17 +54,23 @@
def create(self):
from model import data
from selectshuttle.widgets import SelectShuttle
+ from turbogears.widgets import TableForm
return dict(data=data.select())
form_name="foo"
+ validating_form = widgets.Form(fields=[create])
+ full_class_name = "selectshuttle.SelectShuttle"
create = SelectShuttle(
name="select_shuttle_demo",
label = "The shuttle",
title_available = "Available options",
title_selected = "Selected options",
- form_reference = "document.forms['%s']" % form_name,
# All data should be provided as a list of tuples, in the form of
# ("id", "value"). ATM, id should be an int
available_options = [(i, "Option %d"%i) for i in xrange(5)],
default = dict(selected=[(i, "Option %d"%i) for i in xrange(3)])
)
+ @expose()
+ def post_data(self, **kw):
+ kw = self.validating_form.validate(kw)
+ return "<b>Coerced data:</b><br />%s<br /><br /> " % kw
Modified: trunk/icebreaker/Icebreaker/icebreaker/controllers.pyc
===================================================================
(Binary files differ)
Modified: trunk/icebreaker/Icebreaker/icebreaker/templates/create.kid
===================================================================
--- trunk/icebreaker/Icebreaker/icebreaker/templates/create.kid 2007-07-09 22:45:07 UTC (rev 13237)
+++ trunk/icebreaker/Icebreaker/icebreaker/templates/create.kid 2007-07-10 07:44:01 UTC (rev 13238)
@@ -5,23 +5,9 @@
<title>Welcome to TurboGears</title>
</head>
<body>
-<?python
-from selectshuttle.widgets import SelectShuttle
-form_name="foo"
-create = SelectShuttle(
-name="select_shuttle_demo",
-label = "The shuttle",
-title_available = "Available options",
-title_selected = "Selected options",
-form_reference = "document.forms['%s']" % form_name,
-# All data should be provided as a list of tuples, in the form of
-# ("id", "value"). ATM, id should be an int
-available_options = [(i, "Option %d"%i) for i in xrange(5)],
-default = dict(selected=[(i, "Option %d"%i) for i in xrange(3)])
-)
-?>
+
<div>
- <form action="%s/post_data" name="%s" method="POST">
+ <form action="${full_class_name}/post_data" name="${form_name}" method="POST">
${create.display()}
<br />
<input type="submit" value="Submit" />
Modified: trunk/icebreaker/Icebreaker/icebreaker/templates/create.pyc
===================================================================
(Binary files differ)
More information about the commits
mailing list