I am trying to pass request.args(0) to sqlform so it adds an entry when
submitted based on the project_id value any ideas?

my database code

db.define_table('tasks',
    Field('userinfo', db.auth_user, default=auth.user_id, readable=False,
writable=False),
    Field('project_id', db.project, requires = IS_IN_DB(db, db.project.id,
'%(project_title)s'), readable=False, writable=False),
    Field('isFinished', 'boolean', default=False, readable=False,
writable=False),
    Field('task_title', length=256, requires = IS_NOT_EMPTY()),
    Field('task_description', 'text'),
    Field('created_on', 'datetime', default=datetime.datetime.now(),
readable=False, writable=False))



My Link

<a href="{{=URL('tasks', 'add_task', args=row.id)}}"> Add Task </a>


my tasks add_task function

@auth.requires_login()
def add_task():
    form = SQLFORM(db.tasks,)
    if form.accepts(request.vars, session):
        session.flash = 'You successfully added a task'
        return dict(form=form)
    elif form.errors:
        response.flash = 'Please correct highlighted fields'
        return dict(form=form)
    else:
        response.flash = 'Please add images by filling out this form'
        return dict(form=form)


Sorry I am having a hard time explaining it Let me know if you need better
info

Reply via email to