[web2py] Typo in trunk version of gae.py

2011-03-16 Thread Dave Warnock
Hi,

In the trunk version of applications/admin/controllers/gae.py

line 35
Field('appcfg',default=GAE_APPCFG,label='Path to appcgf.py',

should be (notice appcgf.py instead of appcfg.py)
Field('appcfg',default=GAE_APPCFG,label='Path to appcfg.py',

I had noticed the problem with requiring the password to be an email
address, glad to see that is fixed in trunk.

Thanks

Dave

-- 
Dave Warnock: http://42.blogs.warnock.me.uk
Cycling Blog: http://42bikes.warnock.me.uk


Re: [web2py] Re: gae RFC

2011-03-16 Thread Dave Warnock
Hi,

I am new to web2py and have chosen it for the gae support. Obviously for
someone like me building in the sdk would be very handy.

However, there are obvious disadvantages too (size and release cycles are
2):

Just wondering if instead of bundling the whole sdk into web2py the admin
controller could download the sdk if needed and unpack into the right place.
Then it only happens if needed and the script can download the correct
version.

Might be an easier option to sell.

Of course it might not be possible legally.

Dave


-- 
Dave Warnock: http://42.blogs.warnock.me.uk


[web2py] Best practice

2011-03-17 Thread Dave Warnock
Hi,

I am new to web2py and am developing a GPL application which I plan to
deploy in Google App Engine.

>From my reading there appear to be at least 4 ways of building the web pages
to maintain the application data:

- writing individual controllers and views
- using the CRUD tools
- using the Wiki plugin
- using the new Restful stuff

I think these are listed oldest first.

What I lack is an understanding of what is considered the current best way
to use web2py (especially with a focus on GAE for deployment).

If you were starting a clean empty project which style of web2py would you
choose and why?

Thanks

Dave


-- 
Dave Warnock: http://42.blogs.warnock.me.uk


[web2py] web2py applications and version control systems

2011-03-17 Thread Dave Warnock
Hi,

Do people generally start version control at web2py/applications/myapp or at
web2py?

If an application is to be deployed on gae then shouldn't some files in
web2py be considered part of the project (index.yaml, app.yaml) and
therefore under version control?

Yet I would prefer not to have the whole of web2py under version control so
that I can more quickly move between web2py versions for testing &
upgrading.

Just wondering what you do?

Dave

-- 
Dave Warnock: http://42.blogs.warnock.me.uk


Re: [web2py] Re: question from stackoverflow - DB transactions

2011-03-28 Thread Dave Warnock
Adam,

I am quite surprised that the database administrator was happy with you
using a transaction in that way.

It goes against the normal practice that a database should never be stalled
mid transaction while waiting for user input.

If you have a table locking database this will mean the database becomes
essentially single-user while this business function is being used.

Even with row locking there is a significant possibility of being unable to
commit the tranbsaction due to locking conflicts.

It might be ok with a versioning database but even then there are plenty of
potential solutions that neither lock the database while waiting for a user
nor use sessions.

I suggest you look for a book on SQL database design rather than expect
Web2py to support this design.

If Web2py were to support persistant transactions as you request then I
suggest it would make it a much harder sell into large dbms environments as
any dba will have huge objections.


> a) There were an analytical application that had to display a table data
(a few hundreds of rows, 8 columns).
> Application user had a number of fields that he could change its values -
and after submitting - he could see changed database data.
> However the changes must not be committed until the results was approved
by user - he could play with it number of times until the results were ok,
than finally - submit it (commit data). In other words - it's kind of "live
spreadsheet" based on database.

Some options:
i) create the data in a separate table. Commit copies the data from the
"uncommitted" table to the "committed" table.

ii) have a flag column "committed" which is set to false while they are
experimenting. The commit simply changes the flag.

iii) add a transaction number column, in a transaction table keep track of
the transaction status

> b) There were a simple application for a very small factory that was
assisting in scheduling of production.
> It was really simple however there were a thousands possible product
components, one schedule had to contain a few products to be produced.
> It would be really painful and basically it would make no sense to solve
it with session - it would be close to storing a database in session. Even
if DB small it's still better that session for storage ;)

Model the schedule in the dbms, give the schedule a status.

> Of course both cases could be done with different approach - that our job
to find a solution even if its seems there is a dead end :)

I am not sure our job is to give the dba a heart attack :-)

> But the easiest one for me is just using database without commiting
transaction (to make sure the data integrity is not broken).
> Using database for some intermediate storage is just a "design pattern" -
it can be done in other ways but this is also a good solution.

Waiting for user input in a database transaction is not a good idea, check
any dbms tutorial.

> Please don't underestimate the issue: even in very simple scenario it can
be useful:
> - lest say we have application with tasks and for every task user can add
comments
> - user create task and then create comment
> - comment is on new page
> - before he submits comment he decides to CANCEL the whole operation..
>
> I would just rollback data, but without such possibility you need to
delete the task.. :) Sometimes leaving task without comment is not so nice -
it was created by mistake for wrong project for example... Stupid example
but very real use case for 'rollback'.

Sorry but this is not a need for a persistant transaction. Don't put the
task into the dbms until it is ready.

> But I really believe that even if Web2py does not support it - it should
be quite easy to make such improvement. But its just intuition - maybe I
cannot see some issue...

My 2cents. Please do not add this to Web2py.

Dave