[web2py:10769] Re: back to web2py

2008-10-28 Thread billf
Massimo I think there are a few issues raised by your suggestion - excuse my ramblings: 1) If I knew as much about web2py as you I would have thought of your solution and not dug around as much :-) 2) I'm not sure adding html to the model satisfies everyone. 3) Dealing with fields that have opti

[web2py:10768] Re: web2py book finally online in PDF

2008-10-28 Thread mdipierro
The same company is offering me a pdf solution but there still are a lot of restrictions about what you can do with it. I am trying to find out what these restrictions are and what software is required for download. I cannot say yet it is any better then the current system. Also I have no control

[web2py:10767] Re: web2py book finally online in PDF

2008-10-28 Thread Baron
any progress? Will the pdf cost the same as vitalsource ($30.72)? On Oct 15, 1:12 am, mdipierro <[EMAIL PROTECTED]> wrote: > Not yet > > On Oct 14, 12:23 am, vihang <[EMAIL PROTECTED]> wrote: > > > any update on thepdfversion for the book? > > > On Oct 12, 8:43 pm, mdipierro <[EMAIL PROTECTED]>

[web2py:10766] Re: Can SQLFORM accept TABLE() as its first parameter?

2008-10-28 Thread mdipierro
Here is how you do it (this is explaned in the book in some detail): For example: #in model db.define_table('dog',SQLField('name',default='')) def custom(table): import uuid formkey=session['_formkey[%s]' % table]=str(uuid.uuid4()) return DIV(INPUT(_name='_formn

[web2py:10765] Google checkout appliance

2008-10-28 Thread mdipierro
Now you can use Google Checkout Level 1 and Level 2 with web2py. Works great on the google app engine! Download from: http://mdp.cti.depaul.edu/appliances/default/show/43 Working demo at: http://web2py.appspot.com/plugin_checkout Massimo --~--~-~--~~~---

[web2py:10764] Re: Can SQLFORM accept TABLE() as its first parameter?

2008-10-28 Thread Iceberg
Hi Massimo, Thanks for the quick response, but the point is about customizing the layout. For example, I want the "customer information" and "agent information" are displayed in separated row, it looks better. I did it by this: def add(): form=FORM(TABLE( TR("Customer Name:", INPUT(...), "

[web2py:10763] Re: web2py cookbook anyone?

2008-10-28 Thread Steve Shepherd
Great Do you have a draft for us to have a noesy at then we can work out if we have content worth contributing Steve On Wed, Oct 29, 2008 at 12:54 PM, Pystar <[EMAIL PROTECTED]> wrote: > > The proposed "web2py cookbook" is still alive and going on fine, > although i have not gotten any help fro

[web2py:10762] Re: web2py cookbook anyone?

2008-10-28 Thread Pystar
The proposed "web2py cookbook" is still alive and going on fine, although i have not gotten any help from members of this group, all is going on well. pystar yarko wrote: > I'd like to see some coding suggestions to deal with this: > > - Somebody suggest revised data table design for AlterEgo,

[web2py:10761] Re: The Book

2008-10-28 Thread mdipierro
Thank you. Many people have helped as mentioned in the acknowledgements. The format is not quite what I wanted. They printed it too big I think. Anyway, Yes please send me feedback. Massimo On Oct 28, 7:30 pm, Keith Edmunds <[EMAIL PROTECTED]> wrote: > Received the web2py book yesterday (I'm in

[web2py:10760] The Book

2008-10-28 Thread Keith Edmunds
Received the web2py book yesterday (I'm in the UK and I had to buy it from Amazon in the US, and it took a while to ship). Good job, Massimo: I'm up to page 66 and it reads very well. Much better than the earlier versions posted on the website, although they were helpful too. I do have a couple o

[web2py:10759] Re: back to web2py

2008-10-28 Thread mdipierro
I am not sure why you say there is any need to change T2 to use custom forms with T2. For example: #in model db.define_table('dog',SQLField('name',default='')) def custom(table): import uuid formkey=session['_formkey[%s]' % table]=str(uuid.uuid4()) return DIV(IN

[web2py:10758] Re: back to web2py

2008-10-28 Thread carlo
much clearer now thank you. Definitely T2 methods like create() and update() can become interesting to me only if your efforts to code a html-less version of them will get to success. carlo On 28 Ott, 18:42, billf <[EMAIL PROTECTED]> wrote: > Carlo > > The T2 methods like create() and update()

[web2py:10757] Re: web2rokee! web2py + Cherokee Howto!

2008-10-28 Thread mdipierro
BTW... They have pages like this: http://www.cherokee-project.com/doc/cookbook_django.html perhaps you should send them an email so that can also have http://www.cherokee-project.com/doc/cookbook_web2py.html Massimo On Oct 27, 4:23 pm, "Phyo Arkar" <[EMAIL PROTECTED]> wrote: > Now Cherokee is

[web2py:10756] Re: URL validation problem (RFC?)

2008-10-28 Thread mdipierro
web2py routes is excuted BEFORE validation of urls, perhaps there should be a way to do this in web2py. I just have not thought about it but I will think about it. Perhaps we can make is such as routes_in and routes_out rules optionally include GET variables. Massimo On Oct 28, 3:55 pm, Timothy

[web2py:10755] Re: web2rokee! web2py + Cherokee Howto!

2008-10-28 Thread Tito Garrido
Thanks Phyo! I would like to learn it :) On Tue, Oct 28, 2008 at 4:19 PM, Phyo Arkar <[EMAIL PROTECTED]>wrote: > Tito > > I will document and write a tutorial while i am building Virtual Appliance > for Web2py . > > > > On Tue, Oct 28, 2008 at 6:43 PM, Tito Garrido <[EMAIL PROTECTED]>wrote: > >>

[web2py:10754] Re: URL validation problem (RFC?)

2008-10-28 Thread Timothy Farrell
Yes, that will work. I hadn't thought about Apache. I'm not new to using it but I am new to mod_rewrite. There are some political reasons around here that say I have to tread lightly when changing apache. I'll keep you posted. mdipierro wrote: > What about using mod_rewrite to map the old ur

[web2py:10753] Re: Web2py Appliance and OS Thread!

2008-10-28 Thread mdipierro
Can they be the same thing? A Lice CD that can also be used as VMWare appliance, or perhaps the appliance be built using the live cd? On Oct 28, 3:28 pm, Timothy Farrell <[EMAIL PROTECTED]> wrote: > I just said live CD because that's what came to mind, go OS first. > =) > > Phyo Arkar wrote: >

[web2py:10752] Re: URL validation problem (RFC?)

2008-10-28 Thread mdipierro
What about using mod_rewrite to map the old url into a GET variable? On Oct 28, 3:19 pm, Timothy Farrell <[EMAIL PROTECTED]> wrote: > Here's the deal. Currently apache does serve these files directly, but > that is part of the problem (security). > We have some old PDF code that generates report

[web2py:10751] Re: Web2py Appliance and OS Thread!

2008-10-28 Thread Timothy Farrell
I just said live CD because that's what came to mind, go OS first. =) Phyo Arkar wrote: > AH! Uncyclopedia! Entertains me.! > > So which first? Live CD or OS ? > > On Tue, Oct 28, 2008 at 8:21 PM, Timothy Farrell <[EMAIL PROTECTED] > > wrote: > > That's the funniest

[web2py:10750] Re: Web2py Appliance and OS Thread!

2008-10-28 Thread Phyo Arkar
AH! Uncyclopedia! Entertains me.! So which first? Live CD or OS ? On Tue, Oct 28, 2008 at 8:21 PM, Timothy Farrell <[EMAIL PROTECTED]> wrote: > That's the funniest thing I've read in a long time. > > I accept your bi-partisan offer and fully endorse both VIM (and emacs) for > the said live cd.

[web2py:10749] Re: Web2py Appliance and OS Thread!

2008-10-28 Thread Timothy Farrell
That's the funniest thing I've read in a long time. I accept your bi-partisan offer and fully endorse both VIM (and emacs) for the said live cd. mdipierro wrote: > http://uncyclopedia.wikia.com/wiki/Emacs#Emacs_Vs._VI > > In the spirit of a new era of bi-partisan politics I accept a friendly >

[web2py:10748] Re: URL validation problem (RFC?)

2008-10-28 Thread Timothy Farrell
Here's the deal. Currently apache does serve these files directly, but that is part of the problem (security). We have some old PDF code that generates reports and slaps them in a network folder. Due to several design flaws, this old PDF-generation system must go the way of the Dodo. Before I

[web2py:10745] Re: Web2py Appliance and OS Thread!

2008-10-28 Thread mdipierro
I would like to have the following packages installed: mc, g++, emacs, ssh, zip, unzip, tar, gzip, gunzip, openssh-server python2.5 ipython python-dev postgresql python2.5-psycopg2 postfix samba smbfs and optionally, from source cx_oracle, mysqldb, pyodbc, kinterbasdb thanks for doing this! M

[web2py:10747] Re: Web2py Appliance and OS Thread!

2008-10-28 Thread mdipierro
http://uncyclopedia.wikia.com/wiki/Emacs#Emacs_Vs._VI In the spirit of a new era of bi-partisan politics I accept a friendly amendment to have vi (as well as emacs) installed on the machine. Massimo On Oct 28, 3:07 pm, Timothy Farrell <[EMAIL PROTECTED]> wrote: > EMACS??!?!?! nooononononono V

[web2py:10746] Re: Web2py Appliance and OS Thread!

2008-10-28 Thread Timothy Farrell
EMACS??!?!?! nooononononono VI(m) is what you want! =) mdipierro wrote: > I would like to have the following packages installed: > > mc, g++, emacs, ssh, zip, unzip, tar, gzip, gunzip, openssh-server > python2.5 ipython python-dev postgresql python2.5-psycopg2 postfix > samba smbfs > > and optio

[web2py:10744] Re: URL validation problem (RFC?)

2008-10-28 Thread mdipierro
Is this because of static files for a specific app? why not have apache serve them directly? I cannot imagine any other case when this is relevant. Can you give us an example? Massimo On Oct 28, 2:40 pm, Timothy Farrell <[EMAIL PROTECTED]> wrote: > I understand your position. Under normal ci

[web2py:10743] Web2py Appliance and OS Thread!

2008-10-28 Thread Phyo Arkar
So all web2pycitizes (or web2pycitizens?) Lets start making our own OS/Virtual Appliance for web2py ! Which is full stack webapp development OS based on web2py. How about 2 versions? 1 is for "web2py server appliance" , no GUI (Cherokee , Postgresql/Mysql , Postfix , Python with necessary module

[web2py:10742] Re: URL validation problem (RFC?)

2008-10-28 Thread Timothy Farrell
I understand your position. Under normal circumstances, I would agree with you. But, I just have a situation where I can't control exactly what's coming in and so I need web2py be more lenient. I'll (have to) run a custom version of web2py until I no longer need to interface with this older

[web2py:10741] Re: URL validation problem (RFC?)

2008-10-28 Thread mdipierro
I disagree. The web2py url is only used inside web2py and I think web2py should enforce good practice even if it is more strict than actual specs. We can disagree on what is good practice. For me is when the url only includes alphanumeric characters, _ , /, and non consecutive dots. This avoid pot

[web2py:10740] Re: web2rokee! web2py + Cherokee Howto!

2008-10-28 Thread Phyo Arkar
Sure , yes , from what i have learn from other Appliance type OSes , CLI is necessary. Via CLI : 1.Modification of Network Parameters 2.Start , Stop Services 3.Reboot ,Resume system 4.Setup Root Pwd , Create User , 5.Login to Shell. and many others On Tue, Oct 28, 2008 at 7:18 PM, mdipierro <[

[web2py:10739] Re: web2rokee! web2py + Cherokee Howto!

2008-10-28 Thread Phyo Arkar
Tito I will document and write a tutorial while i am building Virtual Appliance for Web2py . On Tue, Oct 28, 2008 at 6:43 PM, Tito Garrido <[EMAIL PROTECTED]> wrote: > Very Cool! What do you use to customize os? Do you have a tutorial? > > Congratulations! > > > On Tue, Oct 28, 2008 at 2:57 PM

[web2py:10738] Re: web2rokee! web2py + Cherokee Howto!

2008-10-28 Thread mdipierro
It would be great is this too were in the appliance and be web based. On Oct 28, 2:13 pm, "Phyo Arkar" <[EMAIL PROTECTED]> wrote: > >2. CLI Configuration for system and network parameters [ what you want > > to have?] > > When OS is just booted up there are needs to make changes before it can

[web2py:10737] Re: web2rokee! web2py + Cherokee Howto!

2008-10-28 Thread Phyo Arkar
at my web hosting i use Xen + Debian Minimal OS. So Yes , but not LiveAVS (for LiveAVS it is a live CD which act as Live SPam and Anti-Virus filtering Mail Gateway) On Tue, Oct 28, 2008 at 7:14 PM, mdipierro <[EMAIL PROTECTED]> wrote: > > do you use this for the virtual machines at your web hos

[web2py:10736] Re: web2rokee! web2py + Cherokee Howto!

2008-10-28 Thread mdipierro
do you use this for the virtual machines at your web hosting site? Massimo On Oct 28, 2:09 pm, "Phyo Arkar" <[EMAIL PROTECTED]> wrote: > Tito , it is based on debian-lenny Minimal > > i used basic building tools , - mount, squashfs-tools , chroot , mkisofs . > There is no other tools used excep

[web2py:10735] Re: URL validation problem (RFC?)

2008-10-28 Thread Timothy Farrell
Thanks Kyle. What I have to say below may be heresy... In light of the silence on this subject, I've decided that web2py's URL validation (for the purposes of mapping URLs to applications/controllers/functions) oversteps its bounds and over-zealously restricts (at least for my own purposes).

[web2py:10734] Re: web2rokee! web2py + Cherokee Howto!

2008-10-28 Thread Phyo Arkar
>2. CLI Configuration for system and network parameters [ what you want to have?] When OS is just booted up there are needs to make changes before it can be accessed via web interface. SO CLI or GUI is necessary. Attached is my LIveAVS CLI that i made in Python . I think we better start a ne

[web2py:10733] Re: web2rokee! web2py + Cherokee Howto!

2008-10-28 Thread Phyo Arkar
Tito , it is based on debian-lenny Minimal i used basic building tools , - mount, squashfs-tools , chroot , mkisofs . There is no other tools used except the script that i have written to automate the process #. So it is actually pretty much customized linux OS from scratch. On Tue, Oct 28, 2

[web2py:10731] Re: web2rokee! web2py + Cherokee Howto!

2008-10-28 Thread Tito Garrido
Very Cool! What do you use to customize os? Do you have a tutorial? Congratulations! On Tue, Oct 28, 2008 at 2:57 PM, Phyo Arkar <[EMAIL PROTECTED]>wrote: > Thanks a lot all! > > Yeah , Cherokee simplifies the need of SSH and Webmin. I do not setup > webmin due to history of multiple security vu

[web2py:10732] Re: web2rokee! web2py + Cherokee Howto!

2008-10-28 Thread mdipierro
>1. Autoboot DHCP yes >2. CLI Configuration for system and network parameters [ what you want to > have?] do not know >3. Web-based configuration for system and network parameters [tell me > your ideas too] yes, in particular we need to be able to restart services, edit network

[web2py:10729] Re: Can SQLFORM accept TABLE() as its first parameter?

2008-10-28 Thread mdipierro
SQLFORM make a FORM from a database table. you can make a form manually: form=FORM(TABLE(TR(TD(... or you can use a factory (to pretend you have a database table from gluon.sqlhtml import form_factory form=form_factory(SQLField('name','string',requires=IS_NOT_EMPTY(),label='Your Name'),SQLF

[web2py:10728] Re: back to web2py

2008-10-28 Thread mdipierro
keep us posted On Oct 28, 12:42 pm, billf <[EMAIL PROTECTED]> wrote: > Carlo > > The T2 methods like create() and update() bundle the SQLFORM and > accepts() and add some nice things like automatically updating stamp > columns, e.g. created_by, modified_on, making nice short controller > actions.

[web2py:10727] Re: Persistent Object In Memory

2008-10-28 Thread mdipierro
My bad but there is no need to modify cache.py or you will run into trouble. It is just that ser = cache.ram("ser+, serial.Serial(0,9600), indefinite) should be ser = cache.ram("ser+, lambda: serial.Serial(0,9600), indefinite) On Oct 28, 12:39 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:

[web2py:10726] Can SQLFORM accept TABLE() as its first parameter?

2008-10-28 Thread Iceberg
Hi, Massimo, I start learning web2py for a week and it is already addictive. :-) Thank you very much. Now I encounter a tricky problem: Can SQLFORM accept TABLE(...) as its first parameter? The problem description might be clear, but not its background. So I gonna explain some more. My applica

[web2py:10725] Re: back to web2py

2008-10-28 Thread billf
Carlo The T2 methods like create() and update() bundle the SQLFORM and accepts() and add some nice things like automatically updating stamp columns, e.g. created_by, modified_on, making nice short controller actions. However, on the downside, html related code is now in the T2 methods as well as

[web2py:10724] Re: Persistent Object In Memory

2008-10-28 Thread [EMAIL PROTECTED]
Just to report back, I got this working. I did however hit an error in cache.py: Traceback (most recent call last): File "Z:\winWeb2Py\web2py\gluon\restricted.py", line 62, in restricted exec ccode in environment File "Z:\winWeb2Py\web2py\applications\hpv/controllers/inout.py", line 11,

[web2py:10723] Re: web2rokee! web2py + Cherokee Howto!

2008-10-28 Thread Phyo Arkar
Dear Massimo; I like debian more , but i can make ubuntu server if you prefer. If you use vmware-server , starting from vmware server 1.04 there is : vmware-vdiskmanager /usr/bin/vmware-vdiskmanager >From vmware-vdiskmanager help : to extend vmware disk to 36 GB vmware-vdiskmanager -x

[web2py:10722] Re: Persistent Object In Memory

2008-10-28 Thread [EMAIL PROTECTED]
Yes, actually there is only one user at a time. This will install on workstations and only run localhost. I'll give this a whirl, thanks so much. On Oct 28, 11:59 am, mdipierro <[EMAIL PROTECTED]> wrote: > I am assuming there is a single ser object for ALL users. > > indefinite=10*10 > ser = ca

[web2py:10721] Re: Persistent Object In Memory

2008-10-28 Thread mdipierro
I am assuming there is a single ser object for ALL users. indefinite=10*10 ser = cache.ram("ser+, serial.Serial(0,9600), indefinite) def index(): ## open COM port on initial page load return dict() ## each ajax request polls until is reads, returns read ## another poll request is immediatel

[web2py:10720] Re: Persistent Object In Memory

2008-10-28 Thread [EMAIL PROTECTED]
Thanks Massimo. If I use cache.ram how can different functions in a controller access the cached object? Also, is there anyway to specify what happens to an object with it "expires". In my case it'll be best to close the connection before it is destroyed. for example: def index(): ## open C

[web2py:10719] Re: back to web2py

2008-10-28 Thread carlo
Just to say I tried your code and It worked fine. I also tried passing some data from controller and using html helpers (that I find handy) in view like: # in controller rows_clients=db().select(db.clients.ALL) return dict(rows_clients=rows_clients) # in view ... {{ t=TABLE(TR('

[web2py:10718] Re: web2rokee! web2py + Cherokee Howto!

2008-10-28 Thread mdipierro
BTW I use VMWare a lot. How does one resize the virtual HD size? Massimo On Oct 28, 10:24 am, "Phyo Arkar" <[EMAIL PROTECTED]> wrote: > Dear Massimo; > > Hardware Appliance / Virtual Appliance development is my speciality! I can > start making one. > > I have made my own live OS for spam + a

[web2py:10717] Re: web2rokee! web2py + Cherokee Howto!

2008-10-28 Thread mdipierro
That would be great could you make a vmware one and use the latest ubuntu server instead of debian barebone? Massimo On Oct 28, 10:24 am, "Phyo Arkar" <[EMAIL PROTECTED]> wrote: > Dear Massimo; > > Hardware Appliance / Virtual Appliance development is my speciality! I can > start making one.

[web2py:10716] Re: Can I run code at start of server or application?

2008-10-28 Thread mdipierro
The fact is there is no equivalent of "loading an application" because Java is a compiled language, python is an interpreted language. This does not mean that your problem does not exist of that there is no solution for it. The easiest way is to create a startup script appilcations/yourapp/p

[web2py:10715] Re: web2rokee! web2py + Cherokee Howto!

2008-10-28 Thread Phyo Arkar
Dear Massimo; Hardware Appliance / Virtual Appliance development is my speciality! I can start making one. I have made my own live OS for spam + antivirus mail gateway, just 170 MB live OS , based on debian barebone (debian minimal). And another custom OS is for Wireless hotspot control system,

[web2py:10714] Re: Persistent Object In Memory

2008-10-28 Thread mdipierro
Thank you for your comments. There are 4 mechanisms for pesistance: 1) database 2) cache (ram, disk, memcache) 3) session 4) cookies If you want to store in server ram memeory you should use cache.ram. cache.ram cache the output of a function and the object cached needs to a name (key). For exam

[web2py:10713] Re: web2py version for FreeBSD?

2008-10-28 Thread Jose
On 27 oct, 15:11, "Yarko T" <[EMAIL PROTECTED]> wrote: > you'll see warnings about database backends that you might not have > installed, but you can ignore those for testing - as it will work out of box > w/  SQLite, which should be part of your Python install. > I use web2py on freebsd and it

[web2py:10712] Re: Cron jobs revisited

2008-10-28 Thread mdipierro
You are reinventing the wheel here python web2py.py -S appname -M >>> for table in db.tables: print table, db[table].fields Similary python web2py.py -S appname -M -R myscript.py will run the script myscript.py as if it were inside appname and will have access to all models of the app. --~--~

[web2py:10711] Re: Existing Database Schema

2008-10-28 Thread mdipierro
Yes. db.define_table('tablename',...fields,migrate=False) as long as 1) tablename exists 2) fields is a subset of the actual fields (you do not need to list all fields, only those you need to access) 3) tablename has a field called "id" which is an int autoincrement primary key you can acce

[web2py:10710] Re: Can I run code at start of server or application?

2008-10-28 Thread billf
In defence of Java, which I think is a great language/environment, my requests aren't over any particular sluggishness or dropped connections. It is just that I have an application that when started creates a cache derived from the database and uses this to speed up selection and searching on dat

[web2py:10709] Persistent Object In Memory

2008-10-28 Thread [EMAIL PROTECTED]
What's the best way for me to have a custom object that persists between page requests? I'm using a web2py as a client app that reads barcodes off a RS232. To do this I'd like to use server-push with long-polling AJAX. It seems wasteful, though, to reconnect to the COM port after each AJAX reque

[web2py:10708] Re: back to web2py

2008-10-28 Thread Timothy Farrell
You're welcome. I am still using it, though it hasn't gone into production use yet. It has worked normally however throughout the development phase. I don't foresee any issues with it. I'll let you know if I come up with anything. carlo wrote: > Thank you Tim, > > are you still using your pr

[web2py:10707] Re: back to web2py

2008-10-28 Thread carlo
Thank you Tim, are you still using your previously posted trick to have forms mostly in the view? Any problem with that? carlo On 28 Ott, 15:16, Timothy Farrell <[EMAIL PROTECTED]> wrote: > Carlo, > > I haven't eaten the T2 candy yet either. > > Been there, done that.  I'd encourage you not to

[web2py:10706] Re: back to web2py

2008-10-28 Thread Timothy Farrell
Carlo, I haven't eaten the T2 candy yet either. Been there, done that. I'd encourage you not to submit to a different function. It's tempting for me because it makes for smaller functions, but I learned the hard way that this is not the way to go. I started out with my login form that submi

[web2py:10705] Re: back to web2py

2008-10-28 Thread carlo
dear billf and Tim, you look advanced about tackling this issue and I call for your support. As I do not have yet much confidence with T2 plugin I am not sure I grasped what billf suggested. Billf, do you mind posting an example form with your method? My intention was always to have my forms de

[web2py:10704] Re: Cron jobs revisited

2008-10-28 Thread Timothy Farrell
instead of importing them, try executing them: from glob import glob for model in glob('applications/test/models/*.py'): exec(open(model, 'rb').read()) voltron wrote: > Is there anybody that has coded a script that access a web2py > application and uses the form from the commandline? I just

[web2py:10703] Re: Can I run code at start of server or application?

2008-10-28 Thread Timothy Farrell
To attempt to answer your original questions: 1) There is no such thing. 2) There is no such thing. But to be more helpful...Java, in general, has a very sluggish startup time. It is famous for it. In web2py, the Python interpreter is already started so there is no need to "Preload" a web2py

[web2py:10702] Re: T2/python question: type(vars)==type(lambda:0): vars(form)

2008-10-28 Thread mdipierro
Never in t2 but the user may want to do it. For example db.define_table('person', SQLField('birthdate','date'), SQLField('age','integer')) def compute_age(form): form.vars.age=(datetime.date.today()-form.vars.birthdate).years t2.create(db.person,vars=compute_age) On Oct 28, 7:47 am, bill

[web2py:10701] Re: back to web2py

2008-10-28 Thread Timothy Farrell
carlo wrote: >> Did you look into gluon.sqlhtml.form_factory() which is described in >> the book? >> > > mmh..which book please? > > THE web2py book: http://www.amazon.com/Web2Py-Manual-DiPierro/dp/0470432322 even though you can get a DRMed eBook of it here: http://store.vitalsource.com

[web2py:10700] Re: Existing Database Schema

2008-10-28 Thread Stan
So you are saying that web2py will 'attach' to views in the same way as tables(migrate=false), as long as the fields in the views match the table criteria? That sounds very promising to enable connection to complex preexisting schemas. On Oct 22, 10:38 am, "Yarko T" <[EMAIL PROTECTED]> wrote: >

[web2py:10699] Re: Existing Database Schema

2008-10-28 Thread Stan
So you are saying that web2py will 'attach' to views in the same way as tables(migrate=false), as long as the fields in the views match the table criteria? That sounds very promising to enable connection to complex preexisting schemas. On Oct 22, 10:38 am, "Yarko T" <[EMAIL PROTECTED]> wrote: >

[web2py:10698] T2/python question: type(vars)==type(lambda:0): vars(form)

2008-10-28 Thread billf
The python code in the subject appears in both T2.create() and t2.update(). Actually, the full code is: if type(vars)==type(lambda:0): vars(form) else: form.vars.update(vars) If I understand it correctly, its equivalent in pseudo code is: if vars is a function then call the fun

[web2py:10697] Re: back to web2py

2008-10-28 Thread carlo
> a plugin comprise of a set of components (modules, models, views, > controllers and static files) that may be used by more than one app > and act on the global variables (request, response, db, etc.) of the > app that uses the plugin. Examples are CRUD and authentication. thank you. > > Readi

[web2py:10696] Re: Cron jobs revisited

2008-10-28 Thread voltron
Actually, inserts and row deltes, here is an example. Users get congratulations, A check is made everyday at 08:00 in the morn :-) for user_profile in profiles: born = user_profile.birth_date if born.day == today.day and born.month == today.month: message_values = {

[web2py:10695] Re: Cron jobs revisited

2008-10-28 Thread billf
When you say "uses the DAL from the commandline" can you give an example of something you are trying to achieve in terms of "what you type" and "what you get back"? On Oct 28, 11:24 am, voltron <[EMAIL PROTECTED]> wrote: > Opps that should have read "uses the DAL from the commandline" > > On 28 O

[web2py:10694] Re: Cron jobs revisited

2008-10-28 Thread voltron
Opps that should have read "uses the DAL from the commandline" On 28 Okt., 12:23, voltron <[EMAIL PROTECTED]> wrote: > Is there anybody that has coded a script that access a web2py > application and uses the form from the commandline? I just cant get it > right without hacking or trial and error,

[web2py:10693] Cron jobs revisited

2008-10-28 Thread voltron
Is there anybody that has coded a script that access a web2py application and uses the form from the commandline? I just cant get it right without hacking or trial and error,and it feels as if the code would break in some places: 1. To get to the models folder I had to make it a python package. 2

[web2py:10692] Re: Can I run code at start of server or application?

2008-10-28 Thread billf
I may be going down totally the wrong road but I think I am looking for something that is initiated by the fact the server has started as opposed to the server receiving a request. Does the patch address that? and if not, where should I be looking? in web2py or cherrypy? On Oct 28, 10:54 am, ach

[web2py:10691] Re: Can I run code at start of server or application?

2008-10-28 Thread achipa
The Pre/PostConnectionTask patch can do both outlined things, just have a little patience while Massimo reviews it (wink). On Oct 28, 9:00 am, billf <[EMAIL PROTECTED]> wrote: > Voltron > > Thanks for that - some facts for the cookbook there I think :-) > > I'll investigate and report back. > > O

[web2py:10690] Re: Can I run code at start of server or application?

2008-10-28 Thread billf
Voltron Thanks for that - some facts for the cookbook there I think :-) I'll investigate and report back. On Oct 28, 7:16 am, voltron <[EMAIL PROTECTED]> wrote: > Hi Billf, Ill try to have a go at answering :-) > > 1. Functions in controller are called in order in the web2py > controllers, so d

[web2py:10689] Re: Can I run code at start of server or application?

2008-10-28 Thread voltron
Hi Billf, Ill try to have a go at answering :-) 1. Functions in controller are called in order in the web2py controllers, so defining and calling , for example, a function called def foo() before your index() action would be executed first 2. I think an appliance called "init" is alwas executed