Is that an optional download for TG? it doesn't seem to be listed in the TG
1.0.1 install I did originally.

On 3/27/07, Alberto Valverde <[EMAIL PROTECTED]> wrote:
>
>
>
> On Mar 27, 2007, at 2:59 PM, Thomas G. Willis wrote:
>
> >
> > Hi all,(first time poster)
> >
> > I'm probably missing something very fundamental in the widgets
> > framework, but I feel I've exhausted all options thus far and am
> > hoping to get some assistance from the community.
> >
> > Here's the situation. I have a client that wants to have the ability
> > to prompt users to fill in questionnaires periodically. I don't want
> > to have to code tables and such each time they dream up a new batch of
> > questions so I figured I'd make it a little more database driven.
> > However, I can't figure out how to generate forms that would display
> > all the questions in a single form as the client wants.
> >
> >
> > #model classes
> > class Question(SQLObject):
> >    question_text = UnicodeCol()
> >    question_order = IntCol()
> >
> >
> > class QuestionAnswer(SQLObject):
> >    question=ForeignKey("Question")
> >    user = ForeignKey("User")
> >    answer = UnicodeCol()
> >
> >
> > #controller
> > class QuestionField(WidgetsList):
> >    question=Label()
> >    answer = TextArea(cols=25,rows=10)
> >
> >
> > class QuestionController(identity.SecureResource):
> >    @expose("template="project.templates.questions")
> >    def edit_questions(self):
> >       questions = QuestionAnswer.getForUser(identity.current.user)
> >       fields=[]
> >       for q in questions:
> >          fields.append(FieldSet(fields=QuestionField()))
> >
> >       return dict(questions =
> > questions,form=TableForm(fields=fields),action="save_questions")
> >
> >
> > #template
> >
> >
> > ...
> > <body>
> > ${form.display(value=questions)}
> > </body>
> > ...
> >
> > the template renders the number of fields just fine but they seem to
> > not be bound to the objects I pass in to the value parameter. And
> > looking at  the html that's generated I'm assuming there's something I
> > have to do to work the ID into each of the fieldsets so that the post
> > data comes back properly.
> >
> >
> > Any suggestions on what area of the api to look at would be greatly
> > appreciated.
>
> Take a look at the frommaker module in the FastData project.
>
> Alberto
>
> >
>


-- 
Thomas G. Willis

--~--~---------~--~----~------------~-------~--~----~
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