Re: [web2py] Re: Domain model and web2py DAL

2015-01-06 Thread Alan Evangelista
> In DAL it can be done like one single command: > db.define_table('my_items', > Field('name', 'string', length=100), > Field('description', 'string', length=400), > Field('priority', 'integer'), > Field('creator_id', 'reference user'), > Field('dept_i

Re: [web2py] Re: Domain model and web2py DAL

2014-12-24 Thread Alan Evangelista
On Tuesday, December 23, 2014 1:16:52 PM UTC-2, Alan Evangelista wrote: > > > It might be easier if you provide a concrete example of what you are >> trying to achieve (perhaps using the syntax of an existing ORM or using >> pseudo-code) and explain how the DAL fall

Re: [web2py] Re: Domain model and web2py DAL

2014-12-23 Thread Alan Evangelista
> It might be easier if you provide a concrete example of what you are > trying to achieve (perhaps using the syntax of an existing ORM or using > pseudo-code) and explain how the DAL falls short. > Using SQLAlchemy as data mapper below. MyItem class (models.myitem): class MyItem(object):

Re: [web2py] Re: Domain model and web2py DAL

2014-12-14 Thread Alan Evangelista
Simple is a relative term, I should not have associated it with web2py DAL. What I meant is that I want to make my application logic completely independent from persistent data storage. The only method I know to implement this is using the data mapper design pattern (http://en.wikipedia.org/wik

[web2py] web2py and pylint

2014-12-03 Thread Alan Evangelista
pylint checks fail on web2py controllers and models because web2py automatically imports several modules/classes/variables at runtime. I assume this is a known issue and there is no workaround? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py

[web2py] Modules and controllers running in processes - global variables

2014-12-03 Thread Alan Evangelista
Most of my application code is running in Python modules in the modules directory. In the modules directory, I have a few singletons which are implemented as variables defined in the main body of a globals module. However, it seems that web2py runs my modules and the controller in different pro

[web2py] Code that must run only once

2014-12-03 Thread Alan Evangelista
Where should I put code that should run only once at web server startup (not once per http request) (eg application initialization) ? Thanks in advance! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.goog

[web2py] Domain model and web2py DAL

2014-11-28 Thread Alan Evangelista
Hi. I'd like to use the domain model pattern and keep database access code outside models. It seems to me that using a simple database abstraction layer such as web2py DAL better fits to transaction script (no domain models or anemic domain model - models reflect tables) or active records (mod