I've used FileField and ImageField from file_fields quite a few
times, they are very handy. I setup the form like the following
below, then just insert the form object like I would any form, and
use the normal @validate and @error_handler decorators.
from file_fields.widgets.file_field import FileField, FileValidator
class EditProjectVideoFields(widgets.WidgetsList):
video = FileField('video',
label=_(u"Default video"),
)
id = widgets.HiddenField('id')
class EditProjectVideoSchema(validators.Schema):
video = FileValidator(not_empty=True)
id = validators.Number(not_empty=True)
edit_project_video_form = widgets.TableForm
( fields=EditProjectVideoFields(), validator=EditProjectVideoSchema() )
If it doesn't work for you, you might like to paste the relevant
sections of code.
Cheers,
Chris
On 31 May 2007, at 09:42, ldng wrote:
>
>
>
> On 31 mai, 07:15, asm <[EMAIL PROTECTED]> wrote:
>> Have recently spent a while grappling with file uploads and
>> eventually
>> succeeded.
>
> I didn't :)
>
>> Have you made the necessary changes to your dev.cfg (and others) to
>> enable sessions and the file_field_server?
>
> It's actually turbogears.widget.FileField I'm using, not
> File_field.widgets.FileField
> as I gave up on it for not really being documented.
>
> But if you're willing to share you experience, you're very welvome as
> I would
> like to use ImageField as well but can't get it working. And yes the
> file_field_server was setted (correctly ? that's another matter :) )
>
> Thanks.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---