if you put define table separtely (into more than 1 file), models file is
load base on file name ordered.
so let say you have
db_wizard_1.py that define table department (generate first)
db_wizard_2.py that define table auth_tables
in case you put all the define tables into 1 file such as db.py
so the define table is order by top down base (the top line 1, is define
first).
best regards,
stifan
On Friday, August 14, 2015 at 5:23:52 PM UTC+7, Paolo Amboni wrote:
>
> It's true!!!
> The table is in another model file.
> I moved before the declaration and all works!!!
> Which is the order web2py use to load models file?
>
>
> Il giorno venerdì 14 agosto 2015 12:12:04 UTC+2, 黄祥 ha scritto:
>>
>> not sure without seeing the full code, but i guess you are not define
>> table department before define auth tables.
>>
>> best regards,
>> stifan
>>
>> On Friday, August 14, 2015 at 4:46:45 PM UTC+7, Paolo Amboni wrote:
>>>
>>> This don't work:
>>> auth.settings.extra_fields['auth_user']= [ Field('id_dep','reference
>>> departement'),] :
>>> Cannot resolve reference departement in auth_user definition
>>> This work:
>>> auth.settings.extra_fields['auth_user']= [ Field('id_dep','integer'),]
>>>
>>> Why?
>>>
>>> Is there a way to make it work?
>>>
>>
--
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.