Hi I am having problems integrating this plugin
http://dev.s-cubism.com/plugin_uploadify_widget in to my form.
In my Models.py I have
from plugin_uploadify_widget import (
uploadify_widget, IS_UPLOADIFY_IMAGE, IS_UPLOADIFY_FILENAME,
IS_UPLOADIFY_LENGTH
)
db.define_table('video',
Field('userinfo', db.auth_user, default=auth.user_id, readable=False,
writable=False),
Field('title', length=64, requires = IS_NOT_EMPTY()),
Field('trailer', 'upload', IS_LENGTH(550*1024*1024,
error_message='filesize exceeds 550 megabytes'), autodelete=True),
Field('video', 'upload', IS_LENGTH(550*1024*1024,
error_message='filesize exceeds 550 megabytes'), autodelete=True),
Field('created_on','datetime',default=datetime.datetime.today(),
writable=False,readable=False))
################################ The core
######################################
# Inject the uploadify widget
# The "requires" needs custom validators.
db.video.trailer.widget = uploadify_widget
db.video.trailer.requires = IS_EMPTY_OR(IS_UPLOADIFY_LENGTH(3012024))
# Inject the another uploadify widget with different requires
db.video.video.widget = uploadify_widget
db.video.video.requires = IS_UPLOADIFY_LENGTH(3012240, 1)
But I am not sure what to do from here. How do I get the plugin to replace
the regular form area for uploads. My controller consists of this
@auth.requires_membership('admin')
def video():
videos = db(db.video.id>0).select()
form = SQLFORM(db.video)
if form.accepts(request,session):
response.flash = 'You have successfully created a new video'
return dict(form=form,videos=videos)
elif form.errors:
response.flash = 'Please correct the highlighted fields'
return dict(form=form,videos=videos)
#form = LOAD('plugin_uploadify_widget', args='ajax', ajax=True)
return dict(form=form,videos=videos)
Any ideas?
*cheers
and thank you for any help
--