On 1/2/07, Jorge Godoy <[EMAIL PROTECTED]> wrote:


"Ivo Looser" <[EMAIL PROTECTED]> writes:

> I whould like to check if a type of FormField contained in TableForm
> widget. How i can check to a type?

I didn't understand what you want.  Is it validating the input type from
some
field?  If so, you'd use validators for that.


Sorry about the lazy description. But i dont have the Working Code here on
hand.

Here are some sample code(just writed from mind).

10 class MyFormFields(widgets.WidgetsList):
12     name = widgets.TextField(validator=validators.String())
13     age = widgets.TextField(validator=validators.Int(), default=0)

17 testfields = MyFormFields()
18 ff = FileField("test")#Later here should assignet my widget
UploadFormField maybe assign directly in my Edit Method

....
25 def add(self): # Here i dont know the id of the Database Record, because
of that upload should be only possible in Edit mode
        # here should be checked a FileField is already in dict. If it
exists then Remove it.
26      myform = widgets.TableForm(fields=testfields)
27      dict(myform=myform)

30 def edit(self, id, *args, **kwargs):# Here i Know there is an Record
in the Database i can use Upload.
31      testfields.append(ff) # it whould be nicer to display a list of all
uploadet files in Table Style at this place of widget together with
uploadfield. The filenames are Stored in a seperated Table called Uploads 1
to many. The Files himiself are saved on Disk.
...      #Load data from Table and set the content for Edit
35      myform = widgets.TableForm(fields=testfields)
36      dict(myform=myform, data=data)

I hope this discripe it more.

I whould like to extent the FormField, i call it UploadFormField, that in
> a Edit page it displays all Uploadet Files in Table. I tryed to make a
> normal widget but it needs a Validator.

And what is the problem with that?


This Widget designet had no Validator attribute.:-(

Thanks for your Help.

Best Regards Ivo

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