Why 1? .table is there exactly to allow you to do what you are trying to
do. I would do:
pth = "test.db"exists = os.path.exists(pth)
# migrate_enabled false prevent to create a .tablesdb =
dal.DAL("sqlite://{}".format(pth)) # 1
db.define_table("dynamic_fields", Field("f_name")) # 2, 4if *exists*:
db.dynamic_fields.insert(f_name="dynamic")
base_fields = [Field("attr0")]
other_fields = [Field(r.f_name) for r in
db(db.dynamic_fields).select()]db.define_table("foo",
*(base_fields+other_fields))
On Monday, 15 July 2013 19:18:19 UTC-5, Juan BC wrote:
>
> actually im working on kdd/dataminning science proyect, and i try to port
> the connection code from Peewee-orm to dal.
>
> the requirements of my project are this:
>
> 1 - i need to create a db without a .tables file2 - some variables fields are
> added dynamically and stored in a diferent table3 - My example table is: foo4
> - My table for dynamic fields is: dynamic_field5 - you can "load" an existing
> databases and reload all the dynamic fields
>
>
> The minimun example is here: http://dpaste.com/hold/1303925/
>
> and the "real" code is here:
> https://bitbucket.org/leliel12/yatel/src/tip/yatel/db2.py (the _init
> method is where the load lives)
>
> The question is simple... because this not work: what can i do to make
> this code work?
>
> thanks in advance
>
>
>
>
>
>
>
>
--
---
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/groups/opt_out.