HELP! Formless and default values of a widgets

How can i set default value to a widget, if it must be looked up from a database? --- class ISomething(annotate.TypedInterface): def doSomething( self, ctx = annotate.Context(), foo = annotate.String(*default="this string must be taked from a database at render time"*), ): """Do Something Really Exciting ---

Sorry, i got an answer in webform.renderForms doc-string :) Nevov is da best :) On 5/29/05, Little <mordaha@gmail.com> wrote:
How can i set default value to a widget, if it must be looked up from a database?
--- class ISomething(annotate.TypedInterface):
def doSomething( self, ctx = annotate.Context(), foo = annotate.String(*default="this string must be taked from a database at render time" *), ): """Do Something Really Exciting ---

On 5/29/05, Little <mordaha@gmail.com> wrote:
Sorry, i got an answer in webform.renderForms doc-string :) Nevov is da best :)
What was the answer? I use something like this: def setDefaults(self, ctx, data): formDefaults = ctx.locate(iformless.IFormDefaults) defaults = formDefaults.getAllDefaults(myFormName) for key, value in data: # my data is a sequence of tuples defaults[key] = value Which seems pretty clunky. What happened to MVC? Dave Cook
participants (2)
-
Dave Cook
-
Little