0.db naming convention?

62 views
Skip to first unread message

Tom Campbell

unread,
Oct 14, 2015, 9:54:38 PM10/14/15
to web2py-users
I notice there seems to be a convention that application-specific models go in a file named 0.db. Any particular reason for that or inside info that makes it easier to work with later? 

Leonel Câmara

unread,
Oct 15, 2015, 3:09:48 AM10/15/15
to web2py-users
Models are executed alphabetically so it was just a convenient way to define some stuff that you wanted to have available in all your models. Nowadays you have AppConfig so usually that's what you should use.

Tom Campbell

unread,
Oct 15, 2015, 12:07:55 PM10/15/15
to web2py-users
Thank you, Leonel. AppConfig seems to be totally undocumented. Is this my cue to contribute to the docs by rooting around in the source and asking you folks stupid questions about AppConfig?

Leonel Câmara

unread,
Oct 15, 2015, 4:15:55 PM10/15/15
to web2py-users
Eheheh go ahead!

Vinicius Assef

unread,
Oct 15, 2015, 5:58:55 PM10/15/15
to web2py
Appconfig is somewhat documented in the github repo.

Fill the search box and see the result.


--
Vinicius Assef

On 15 October 2015 at 13:07, Tom Campbell <tomca...@gmail.com> wrote:
Thank you, Leonel. AppConfig seems to be totally undocumented. Is this my cue to contribute to the docs by rooting around in the source and asking you folks stupid questions about AppConfig?

--
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+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Egor Sledov

unread,
Oct 15, 2015, 11:29:58 PM10/15/15
to web2py-users
I believe files from models folder are loaded in alphabetical sequence. So, say, customers.py will be read before db.py file , where connection (and other application level things are defined). 

If you have file 0.db.py, it will be loaded before customers.py and likely before any other file you may create in models folder.
Reply all
Reply to author
Forward
0 new messages