Hi Anthony,
how can I link a virtual tables from a factory?
Regards,
--Constantine
Not sure what you mean.
On Tuesday, November 29, 2011 12:06:16 PM UTC-5, Constantine Vasil wrote:
Hi Anthony,
how can I link a virtual tables from a factory?
Regards,
--Constantine
I am using SQLFORM.factory not a read database for different reasons.
The question is can I link two SQLFORM.factory tables (virtual tables so to
say) to achieve the same effect?
What do you mean by linking factory tables? Is it one factory or two? What
would the linking do? Can you detail an example?
On Tuesday, November 29, 2011 12:48:15 PM UTC-5, Constantine Vasil wrote:
I am using SQLFORM.factory not a read database for different reasons.
The question is can I
=
Instead, though, you might want to explicitly link the two tables:
db.define_table('t_ab_distribution',
Field('f_distributionname'),
format='%(f_distributionname)')
db.define_table('t_ab_recipient',
Field('f_distribution',
I'm not sure, but what's the use case? SQLFORM.factory is for creating
forms, not database tables. What would be the result of any linking?
On Tuesday, November 29, 2011 1:14:18 PM UTC-5, Constantine Vasil wrote:
=
Instead, though, you
Thanks again Anthony,
Your help has been clear and concise. I have what I need now.
About the error thing. Just to be clear where I am working from. I
am using the online editor at:
http://127.0.0.1:8000/admin/default/edit/XxXxxx/models/db_wizard.py
And for a test I just removed one of
Well I may have spoke too soon...
I have another table...this one:
db.define_table('t_ab_team',
[snip]
Field('f_distribuionname', type='string',
label=T('Distribuionname')),
And I want to link the above field so that it show a drop down list
also using the contents of the
On Sunday, November 20, 2011 4:47:16 AM UTC-5, EdgarAllenPoe wrote:
About the error thing. Just to be clear where I am working from. I
am using the online editor at:
http://127.0.0.1:8000/admin/default/edit/XxXxxx/models/db_wizard.py
And for a test I just removed one of the commas at
You should be able to reference the t_ab_distribution table from multiple
tables. Can you show the full models for these tables? What exactly broke
(i.e., what do you see, and what do you expect)?
Anthony
On Sunday, November 20, 2011 7:32:31 AM UTC-5, EdgarAllenPoe wrote:
Well I may have
You could do:
db.t_ab_recipient.f_distribution_name.requires = IS_IN_DB(db,
't_ab_distribution.f_distributionname')
See http://web2py.com/book/default/chapter/07#Database-Validators.
Instead, though, you might want to explicitly link the two tables:
db.define_table('t_ab_distribution',
Thanks Anthony,
I want to explicitly link the tables as you described above. Do I put
this code in in the DB_WIZARD.PY file?
If so how would I modify it. Everything I try produces an error on
save. Here are the two tables in question.
db.define_table('t_ab_distribution',
db.define_table('t_ab_recipient',
[snip]
change:
Field('f_distribution_name', type='string',
label=T('Distribution Name')),
to:
Field('f_distribution', db.t_ab_distribution,
label=T('Distribution Name')),
Note, your code wouldn't be producing any
13 matches
Mail list logo