I don't have a solution for your situation, but this may help you devise
a mechanism that works:
* circular-references in web2py: http://stackoverflow.com/a/3116032
* 'lazy_tables' :
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Lazy-Tables-a-major-performance-boost
________________________________________
Kiran Subbaraman
http://subbaraman.wordpress.com/about/
On Fri, 03-03-2017 5:40 AM, Jordan Myers wrote:
Thanks for the idea, Stifan! Unfortunately, I have circular
dependencies (two tables reference each other), so this will not work
for all tables. Also, I have over 100 tables and would like to keep
them organized in files.
-Jordan
On Thu, Mar 2, 2017 at 4:26 PM, 黄祥 <[email protected]
<mailto:[email protected]>> wrote:
just an idea why not define table in sequence number?
first analyze the whole system and define table on order (define
table first (low number) for the table with no relation to another
table)
e.g.
*models/db_schema_0_auth.py*
auth.define_tables(username = True, signature = True)
*models/db_schema_1_address.py*
db.define_table('address',
Field('address', 'text'),
format = lambda r: '%s' % (r.address) )
*models/db_schema_2_id_card.py*
db.define_table('id_card',
Field('id_card_number'),
Field('first_name'),
Field('last_name'),
Field('address', 'reference address'),
format = lambda r: '%s - %s %s' % (r.id_card_number, r.first_name,
r.last_name) )
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py
<http://github.com/web2py/web2py> (Source code)
- https://code.google.com/p/web2py/issues/list
<https://code.google.com/p/web2py/issues/list> (Report Issues)
---
You received this message because you are subscribed to a topic in
the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/web2py/vJEvUJ6_e-A/unsubscribe
<https://groups.google.com/d/topic/web2py/vJEvUJ6_e-A/unsubscribe>.
To unsubscribe from this group and all its topics, send an email
to [email protected]
<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout
<https://groups.google.com/d/optout>.
--
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 [email protected]
<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.