Hi there, I am building an accounting system. When I create a quotation, if the item is in 'subscription' category, i want to use SQLFORM.factory(db.item, db.subscription_item) to generate a create form for submitting the necessary values. Now i want to edit these 2 tables(item and subscription_item have 1-1 relationship), does SQLFORM.factory() takes any constraint or query to specify which item I want to edit? If not, what's the best way to do it? Thanks in advance!
Below is the simplified database tables: db.define_table('company', Field('company_name', requires=IS_NOT_EMPTY()), # unique=True format='%(company_name)s') db.define_table('quotation', Field('company', 'reference company'), Field('project_name', requires=IS_NOT_EMPTY()), Field('quote_amount', 'double', default=0, writable=False), auth.signature) db.define_table('category', Field('category_name', ondelete='NO ACTION'), # eg. project or subscription format='%(category_name)s') db.define_table('item', Field('quotation', 'reference quotation', writable=False, label='Quote Id'), Field('category', 'reference category', requires=IS_IN_DB(db, 'category.id', '%(category_name)s')), Field('description'), Field('amount', 'double', default=0), auth.signature) db.define_table('subscription_item', Field('item', 'reference item', writable=False, label='Item Id'), Field('start_date', 'date'), Field('end_date', 'date'), auth.signature) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.