Re: [web2py] Re: Automatic delete of a record after x days

2010-10-07 Thread Kenneth Lundström
> first question: > what is this?? */30 * * * * That */30 * * * * is ordinary linux crontab syntax, look at http://adminschoice.com/crontab-quick-reference and the fist picture when you scroll down. It should tell you what those * are. Basically you define when the cron is runned, first * t

[web2py] Re: Automatic delete of a record after x days

2010-10-07 Thread ceriox
thanks bruno, i read your link but i don't understand very well... first question: what is this?? */30* * * * if i wanna execute every day the function "daytask" in my controller "automatictask" i neet to do: 1) edit web2py 1.84.4\applications\xxx\cron\crontab 2) add a row (my crontab is e

[web2py] Re: Session data lose...

2010-10-07 Thread ron_m
Jason, I wrote a little test program and it looks like a file object is cleaned up by the library when it is unbound so based on what I see running this code there is no need to unlock or close as long as the file object loses scope. Test program produces no open files looking in /proc/pid_of_py

Re: [web2py] Re: Passing args to static CSS files

2010-10-07 Thread Bruno Rocha
I am trying many ways, does not works here Calling directly in browser : http://127.0.0.1:8000/examples/static/css/menu.css?version=1234 (Thats works) But when in layout.html: {{response.files.append(URL(request.application,'static','css/menu.css',vars={'version':'1234'}))}} or {{response.files.a

Re: [web2py] Re: tip of the day: how to make a ON/OFF toggle button to represent a boolean field

2010-10-07 Thread Thadeus Burgess
How about this... It allows to use it in any normal form, you still have to press the submit button, but it means no security issues. It also downgrades gracefully if the client does not have javascript $(document).ready(function() { $('.boolean').each(function() { var on_off; if($(t

[web2py] Re: f.y.i. pypy 1.3

2010-10-07 Thread mdipierro
this is based on a post by a previous user. I did not check. I believe only CPython closes files automatically when they go out of scope. Web2py should close all of them explicitly but it is possible that something is missing. If you get a chance to try PyPy in more depth, let us know. On Oct 7, 4

[web2py] Re: SyntaxError at line 2 on version 1.86.3

2010-10-07 Thread mdipierro
Can you check if it is fixed in trunk? On Oct 7, 1:25 pm, Jonathan Lundell wrote: > On Oct 7, 2010, at 11:04 AM, mdipierro wrote: > > > > > I am away from my computer but I suspect the > > > text=text.replace('\r\n','\n').strip()+'\n' > > > is missing before exec-uting (text) > > If I understand

[web2py] Re: tip of the day: how to make a ON/OFF toggle button to represent a boolean field

2010-10-07 Thread mdipierro
Point taken. How about Say you have a table db.define_table('item',Field('name'),Field('check','boolean',default=False)) you can have two controllers like def items(): rows=db(db.item.owner==auth.user_id).select() return dict(rows=rows) def check(): # this is a callback! i

[web2py] Re: tip of the day: how to make a ON/OFF toggle button to represent a boolean field

2010-10-07 Thread guruyaya
> No the check action never creates any record. it just allows you to > edit if you have access... OK, Imagine that. Say I have a "show my email to the world" boolean on my blog. Say I'm allowing pictures in my comments, for registered users. Now the attacker, puts this tag: http://www.mysite.com/

[web2py] Re: Form validation service in web2py

2010-10-07 Thread Magnitus
The concept of "static" pages where you can submit data to the server seems a bit weird (means you can submit info to the server, but then you never see the result of that info... unless you access the info via Ajax requests I guess). Anyways, concerning the centralized Ajax requests, its definite

[web2py] Re: db.mytable(myid) syntax throws exception for GAE in 1.86.2

2010-10-07 Thread mdipierro
oops. will try fix this later tonight. On Oct 7, 7:17 pm, "robe...@captivation.com" wrote: > It boils down to this: > >     record = self._db(self._id == id).select(limitby=(0,1)).first() >   File \"/Users/robertm/backbeat/backbeat/3rd/web2py/gluon/sql.py\", > line 1683, in __getattr__ >     retu

[web2py] Re: SyntaxError at line 2 on version 1.86.3

2010-10-07 Thread mdipierro
If somebody figures out how to change the install to script to avoid the quirk would be great. On Oct 7, 6:15 pm, Jon Rosen wrote: > Interesting thread.  I noticed the "can't save" problem yesterday > myself on 1.86.2 which I downloaded on Tuesday (I guess there was a > new version out since then

[web2py] db.mytable(myid) syntax throws exception for GAE in 1.86.2

2010-10-07 Thread robe...@captivation.com
It boils down to this: record = self._db(self._id == id).select(limitby=(0,1)).first() File \"/Users/robertm/backbeat/backbeat/3rd/web2py/gluon/sql.py\", line 1683, in __getattr__ return dict.__getitem__(self,key) KeyError: '_id' I think the issue is that gql.py Table.__init__ does not

[web2py] Re: Strange request.vars behaviour

2010-10-07 Thread mdipierro
because keyword appears both in get and in post. You can try: form=SQLFORM.factory( Field('keyword', default=keyword, ) _method="GET") or form=SQLFORM.factory( Field('keyword',

[web2py] Re: Troubleticketing application?

2010-10-07 Thread Jon Rosen
I am implementing a QA test planning tool, and I would like something that is integrated like Bugzilla/Testopia (which is written in ugh Perl :-). I have been considering two options: (1) building my own tracking system from scratch (not a small task) or (2) using the Bugzilla API to piggyback on

[web2py] Strange request.vars behaviour

2010-10-07 Thread iiijjjiii
I am trying to provide a default value for an input textbox using request.vars but am seeing some unusual behaviour. Here is my controller: def search(): keyword = '' if 'keyword' in request.vars: keyword = request.vars.keyword form=SQLFORM.factory(

[web2py] Re: spree clone

2010-10-07 Thread Richard
yeah more payment options is definitely a must. I listed a few ideas here: http://code.google.com/p/web2py-estore/wiki/WishList > Is any objection on removing the eStore from appliances and link yours? sure, link that version. If anyone is interested in developing it let me know and I can give

Re: [web2py] Re: Unsupported referential constraint in extract_pgsql_models.py

2010-10-07 Thread Mariano Reingart
Thanks for sending this issue and the sql schema, I will look at it ASAP This should be a warning as it doesn't change web2py behavior. Regards Mariano Reingart http://www.sistemasagiles.com.ar http://reingart.blogspot.com On Thu, Oct 7, 2010 at 10:34 AM, jm wrote: > hello, > > here is the tab

[web2py] Re: SyntaxError at line 2 on version 1.86.3

2010-10-07 Thread Jon Rosen
Interesting thread. I noticed the "can't save" problem yesterday myself on 1.86.2 which I downloaded on Tuesday (I guess there was a new version out since then) but figured it was "just one of those quirky things" that I had to live with. Web2Py is so cool and easy to build with (compared to Rail

[web2py] Re: Google groups posts and Google code changes gadgets?

2010-10-07 Thread Bruno Rocha
{{=SOLVED}} HOW TO: http://web2pyslices.com/main/slices/take_slice/100 using gluon.feedparser 2010/9/28 Bruno Rocha > > Hi, > > I am developing a webpage where I need to include 2 gadgets. > > Inside . > > I need to list 5 last entries from this page: > http://code.google.com/p/web2py/so

Re: [web2py] f.y.i. pypy 1.3

2010-10-07 Thread Michele Comitini
interesting 2010/10/7 cjrh : > web2py on pypy 1.3 appears to work: > > 1. http://pypy.org/download/pypy-1.3-linux.tar.bz2 > > 2. In a terminal, extract & run "bin/pypy web2py" > > It seems to take a long time to start up, and it seems to take a while > to load up the welcome page for the first tim

[web2py] Re: SyntaxError at line 2 on version 1.86.3

2010-10-07 Thread slestak
Does this have an implication for the Hg integration, if it ends up detecting EOL changes as the only mod?

[web2py] Re: Content seen only by logged in users

2010-10-07 Thread iu_long
Thank you ! :) On Oct 3, 6:46 am, mdipierro wrote: > Yes in two ways. > > You can set permission on a controller function with > > @auth.requires_login() > def index(): >     ... >     return dict() > > OR in the view you can do > > {{if auth.user:}} > this content is only visible to logged in us

[web2py] Re: f.y.i. pypy 1.3

2010-10-07 Thread mdipierro
yes but it has a memory leak because some files are not closed by default. It can be fixed. On Oct 7, 3:11 pm, cjrh wrote: > web2py on pypy 1.3 appears to work: > > 1.http://pypy.org/download/pypy-1.3-linux.tar.bz2 > > 2. In a terminal, extract & run "bin/pypy web2py" > > It seems to take a long

[web2py] Re: gae strangeness with & symbol

2010-10-07 Thread mattynoce
i wasn't able to get back to this for a while, but the new list:integer parts did it. to answer cfh's question, i was only seeing it on development. i hadn't deployed to try it on production. and yes, i was using sqlite for gae's dev. i didn't have to use the patch, but thanks for the heads-up. it

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-10-07 Thread ron_m
I have it working here and worked on it to improve the dictionary. It needs more work in the id field area because they are converted to an integer, also boolean fields which get represented as char(1) would become string. My testing has been to take the database produced by my model files and run

Re: [web2py] Re: tip of the day: how to make a ON/OFF toggle button to represent a boolean field

2010-10-07 Thread Thadeus Burgess
You should modify this a little bit to turn any boolean checkbox into this. The javascript will hide the checkbox and replace it with this custom widget, but since the checkbox still exists on the DOM it works on any form. -- Thadeus On Thu, Oct 7, 2010 at 2:14 PM, mdipierro wrote: > No the

[web2py] f.y.i. pypy 1.3

2010-10-07 Thread cjrh
web2py on pypy 1.3 appears to work: 1. http://pypy.org/download/pypy-1.3-linux.tar.bz2 2. In a terminal, extract & run "bin/pypy web2py" It seems to take a long time to start up, and it seems to take a while to load up the welcome page for the first time too; these are probably signs of the JIT

Re: [web2py] Re: Session data lose...

2010-10-07 Thread Jason Brower
I will try it and report back your morning. - Original message - > Do you run on Linux? If so it is very easy to see which files are open > to a process. If you start web2py with python web2py.py and use the > built in Rocket web server you should be able to find the pid of the > python pr

[web2py] Re: tip of the day: how to make a ON/OFF toggle button to represent a boolean field

2010-10-07 Thread mdipierro
No the check action never creates any record. it just allows you to edit if you have access... # optional check if auth.user is allowed to edit record On Oct 7, 1:30 pm, guruyaya wrote: > I'm not sure, but isn't this method open to Cross site scripting? I > can create an image tag with t

[web2py] Re: Any possible problems if I do this? Any possible improvement?

2010-10-07 Thread Magnitus
Something just occured to me. The admin app is probably a good template to look at for what I want to do (I practically never use it prefering to interact directly with my app's file structure so I didn't think about it). If I'm feeling really paranoid about question 2, I guess I can always imple

Re: [web2py] Automatic delete of a record after x days

2010-10-07 Thread Bruno Rocha
Cron -> http://web2py.com/book/default/chapter/04?search=cron#Cron 2010/10/7 ceriox > Hi all, > > it is possible delete a record if it is older than 5 days (without > user operation)? > > i have a table with a data field if this field is older than 5 days i > wanna delete it and do other stuff w

[web2py] Re: tip of the day: how to make a ON/OFF toggle button to represent a boolean field

2010-10-07 Thread guruyaya
I'm not sure, but isn't this method open to Cross site scripting? I can create an image tag with the http://.../check with ease! On Oct 6, 8:26 pm, mdipierro wrote: > Say you have a table > > db.define_table('item',Field('name'),Field('check','boolean',default=False)) > > you can have two control

[web2py] Automatic delete of a record after x days

2010-10-07 Thread ceriox
Hi all, it is possible delete a record if it is older than 5 days (without user operation)? i have a table with a data field if this field is older than 5 days i wanna delete it and do other stuff without any "manual" operation

Re: [web2py] Re: SyntaxError at line 2 on version 1.86.3

2010-10-07 Thread Jonathan Lundell
On Oct 7, 2010, at 11:04 AM, mdipierro wrote: > > I am away from my computer but I suspect the > > text=text.replace('\r\n','\n').strip()+'\n' > > is missing before exec-uting (text) If I understand correctly, Mariano is concerned that any compile-error diagnostics match the character (vs line

[web2py] Re: SyntaxError at line 2 on version 1.86.3

2010-10-07 Thread mdipierro
I am away from my computer but I suspect the text=text.replace('\r\n','\n').strip()+'\n' is missing before exec-uting (text) On Oct 7, 11:20 am, Mariano Reingart wrote: > On Thu, Oct 7, 2010 at 12:36 PM, Jonathan Lundell wrote: > > On Oct 7, 2010, at 8:05 AM, Jonathan Lundell wrote: > > >> On

[web2py] Re: Free hosting? Ohloh.net broken web2py link

2010-10-07 Thread Mirek Zvolský
I wasn't successfull. That's because I am beginner, beginner in Web2py, in Python, in web at all. I think, that if somebody better will try it, he will have success. Key points are: - in Your Account, Web Servers is python support OFF as default, switch this to ON - one russian runs there Django (

[web2py] Re: SyntaxError at line 2 on version 1.86.3

2010-10-07 Thread Chuck Paulson
I am using Windows VIsta Home Premium Service Pack 2 with Internet Explorer 8. The editor is just the standard editor that comes with web2py. However since I can't edit with that now, I am moving over to Eclipse with PyDev which doesn't have this problem. On Oct 7, 12:59 pm, Jonathan Lundell wrot

Re: [web2py] Re: SyntaxError at line 2 on version 1.86.3

2010-10-07 Thread Jonathan Lundell
On Oct 7, 2010, at 9:20 AM, Mariano Reingart wrote: > > On Thu, Oct 7, 2010 at 12:36 PM, Jonathan Lundell wrote: >> On Oct 7, 2010, at 8:05 AM, Jonathan Lundell wrote: >>> >>> On Oct 7, 2010, at 7:32 AM, Jonathan Lundell wrote: On Oct 7, 2010, at 7:09 AM, mdipierro wrote: > >

Re: [web2py] Re: SyntaxError at line 2 on version 1.86.3

2010-10-07 Thread Mariano Reingart
On Thu, Oct 7, 2010 at 12:36 PM, Jonathan Lundell wrote: > On Oct 7, 2010, at 8:05 AM, Jonathan Lundell wrote: >> >> On Oct 7, 2010, at 7:32 AM, Jonathan Lundell wrote: >>> >>> On Oct 7, 2010, at 7:09 AM, mdipierro wrote: For now I reverted to 1.86.2 hoping the problem is not there. >>>

Re: [web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-10-07 Thread Ivan Matveev
>2010/10/7 DJ : > The legacy database to Web2py conversion would be a great add-on. I > get the following errors when I tried this script on a database with > tables having primary key 'id' set to autoincrement. > > C:\Program Files (x86)\web2py\scripts>extract_mysql_models.py > bio:b...@nrcf > Tra

[web2py] Re: new cool jQuery plugins

2010-10-07 Thread Jose Hurtado
Nice. Thanks for sharing. On 7 oct, 07:55, mdipierro wrote: > http://speckyboy.com/2010/03/01/25-amazing-and-fresh-jquery-plugins/

Re: [web2py] Re: SyntaxError at line 2 on version 1.86.3

2010-10-07 Thread Jonathan Lundell
On Oct 7, 2010, at 8:05 AM, Jonathan Lundell wrote: > > On Oct 7, 2010, at 7:32 AM, Jonathan Lundell wrote: >> >> On Oct 7, 2010, at 7:09 AM, mdipierro wrote: >>> >>> For now I reverted to 1.86.2 hoping the problem is not there. >> >> A hunch: the new syntax-checking code in admin/default/edit

Re: [web2py] Re: SyntaxError at line 2 on version 1.86.3

2010-10-07 Thread Jonathan Lundell
On Oct 7, 2010, at 7:32 AM, Jonathan Lundell wrote: > > On Oct 7, 2010, at 7:09 AM, mdipierro wrote: >> >> For now I reverted to 1.86.2 hoping the problem is not there. > > A hunch: the new syntax-checking code in admin/default/edit needs to convert > Windows line endings before calling compile

[web2py] Re: SyntaxError at line 2 on version 1.86.3

2010-10-07 Thread Chuck Paulson
That makes sense. I am using Windows Vista and on db.py the error said line 2 char position -1 which could be a line ending problem. On Oct 7, 10:32 am, Jonathan Lundell wrote: > On Oct 7, 2010, at 7:09 AM, mdipierro wrote: > > > > > For now I reverted to 1.86.2 hoping the problem is not there. >

Re: [web2py] Re: SyntaxError at line 2 on version 1.86.3

2010-10-07 Thread Jonathan Lundell
On Oct 7, 2010, at 7:09 AM, mdipierro wrote: > > For now I reverted to 1.86.2 hoping the problem is not there. A hunch: the new syntax-checking code in admin/default/edit needs to convert Windows line endings before calling compile. > > On Oct 7, 8:39 am, Chuck Paulson wrote: >> I just upgrad

[web2py] Re: SyntaxError at line 2 on version 1.86.3

2010-10-07 Thread Chuck Paulson
version 1.86.2 worked fine for me, except that once you save an edited file in the web2py interface, the save button becomes disabled and you have to exit out and re-edit in order to save again. On the 1.86.3 problem, the file did not matter, I always got a syntax error on line 2. For example, the

[web2py] Re: SyntaxError at line 2 on version 1.86.3

2010-10-07 Thread mdipierro
For now I reverted to 1.86.2 hoping the problem is not there. On Oct 7, 8:39 am, Chuck Paulson wrote: > I just upgraded to version 1.86.3 and whenever I try to edit a file > using the web2py interface I get a "failed to compile file because: > SyntaxError on line 2..." error. This happens on file

[web2py] Re: SyntaxError at line 2 on version 1.86.3

2010-10-07 Thread mdipierro
Can you post the first five lines (as an attachment) of a file that gives you problems? Is this on windows? Source or binary web2py? On Oct 7, 8:39 am, Chuck Paulson wrote: > I just upgraded to version 1.86.3 and whenever I try to edit a file > using the web2py interface I get a "failed to compil

[web2py] SyntaxError at line 2 on version 1.86.3

2010-10-07 Thread Chuck Paulson
I just upgraded to version 1.86.3 and whenever I try to edit a file using the web2py interface I get a "failed to compile file because: SyntaxError on line 2..." error. This happens on files that I have not even changed, such as db.py as well as on files that I have created. Help, I can't edit anyt

[web2py] Re: Unsupported referential constraint in extract_pgsql_models.py

2010-10-07 Thread jm
hello, here is the table definition witch lead to the trouble : CREATE TABLE aqu_gfcategcultureprec ( idculture integer NOT NULL, idcategorieculture integer NOT NULL, libelle_categorie character varying, code_libre character varying, CONSTRAINT aqu_gfcategcultureprec_pkey PRIMARY KEY (i

[web2py] Form validation service in web2py

2010-10-07 Thread guandalino
Hello, I need your opinion. I have decided that simple web sites for my customers will be done in plain static HTML served directly by Apache, without any web framework. To handle the situation when forms are required (e.g. contact pages), I'd like to have a service running server side that validat

[web2py] Unsupported referential constraint in extract_pgsql_models.py

2010-10-07 Thread jm
Traceback (most recent call last): File "D:\Dev\web2py\scripts\extract_pgsql_models.py", line 282, in define_db(cnn, db, host, port, user, passwd) File "D:\Dev\web2py\scripts\extract_pgsql_models.py", line 266, in define_db define_table(conn, table) File "D:\Dev\web2py\scripts\extrac

[web2py] Re: dynamic notifications

2010-10-07 Thread Martin.Mulone
great!. Multiple notification are awesome. On 6 oct, 23:18, mdipierro wrote: > You may want to change web2py_ajax.html and replace > > if(jQuery('.flash').html()!='') jQuery('.flash').slideDown('slow'); > ... > if(flash) jQuery('.flash').html(flash).slideDown(); > > with > > if(jQuery('.flash').h

[web2py] Re: My web2py project GeBi (ita only)

2010-10-07 Thread ceriox
GeBi (GEstione BIblioteca = library management) project is born for learning web2py with a real example, but now it become a real project with the collaboration of another person. when i complete all the function, i start to rewrite the code correctly because there is many imprecise or unusefull p

[web2py] Any possible problems if I do this? Any possible improvement?

2010-10-07 Thread Magnitus
I am in the process of securing the help of an artist for my project, but he's a casual computer user (doesn't know ssh/scp) and I'm trying very hard to make everything as painless and pleasant as possible for him to secure his help. In order to do that, I decided to create a view that will allow

[web2py] Re: Session data lose...

2010-10-07 Thread ron_m
Do you run on Linux? If so it is very easy to see which files are open to a process. If you start web2py with python web2py.py and use the built in Rocket web server you should be able to find the pid of the python process with $ ps -ef | grep python Once you have the pid you can cd /proc/pid and