[web2py] Re: How many error tickets does a typical newbie handle?

2012-11-13 Thread Niphlod
because your update can be something like db((db.testtable.id>50) & (db.testtable.articles.contains(['a','b'])) --

[web2py] Re: how to hide the [wiki] menu option in auth.wiki

2012-11-13 Thread Andrew W
Works great, thanks. I've also sent Massimo a patch for tools.py to fix it in trunk. I hope to deploy a website soon using auth.wiki and this was one of my last hurdles. On Wednesday, November 7, 2012 12:25:44 AM UTC+13, villas wrote: > > I do not want the wiki menu to be displayed to anyone e

[web2py] Cannot import module 'lpod'

2012-11-13 Thread omicron
With web2py 1.99.7 this import was Ok : import lpod.document as oodoc But with version 2.2.1, I have this error : File "/home/myhome/Applications/web2py/gluon/custom_import.py", line 77, in custom_importer raise ImportError, 'Cannot import module %s' % str(e) ImportError: Cannot impor

Re: [web2py] -N option

2012-11-13 Thread Nico Zanferrari
looking inside the Book app on github, the related commit "more about cron" is dated almost one month ago: https://github.com/mdipierro/web2py-book/commit/703ae1c98c20d735ce9564d95fa0380eb0ee76d4#sources/29-web2py-english/04.markmin But you're right: there are still lot of updates to do ;-( Nic

[web2py] Re: How many error tickets does a typical newbie handle?

2012-11-13 Thread Bill Thayer
Do I then need to use an iterator for my update function? This is related to my other post where I am getting key errors https://groups.google.com/d/msg/web2py/3dgZiuDAZDc/DZnJYgaifjIJ --

Re: [web2py] SQLFORM.smartgrid. This is a bug?

2012-11-13 Thread Jose
El martes, 13 de noviembre de 2012 02:10:03 UTC-3, marco mansilla escribió: > > aren't you missing the db. before table? > No, the way I define the table is not necessary table_1 = db.define_table('table1', Field('name'), ) *table_1 *is equals to* db.table1* Jose --

[web2py] Re: web2py appliance not working

2012-11-13 Thread dhmorgan
Like many of the older example appliances, this does not function properly as it is. I personally was not able to get manage.py to work, but the database can accessed via admin console *IF* you replace controllers/appadmin.py with the one from the welcome app. (You could alternately search and

[web2py] REF: Programmatically assign args to LOAD

2012-11-13 Thread Teddy Nyambe
Hi, I am trying to find out if its possible using javascript assigning args to the LOAD when button is clicked as follow: View: my button jQuery('#55').onclick(function(){ web_component(...) update args.. }; {{=LOAD('mycontroller','myaction',args=55, ajax=True}}} I h

[web2py] Virtual Field and the grid

2012-11-13 Thread Johann Spies
How do I use a Virtual Field in a grid? I am getting the error: Query Not Supported: 'Row' object has no attribute 'ut when I use the following code: def art_skrywers(ut): return '\n'.join([x.au for x in db(db.rauthors.rart_id == ut).select(db. rauthors.au)]) @auth.re

[web2py] Bug? Invalid url puts python into a tight loop - 100% CPU

2012-11-13 Thread jc
Hi, I have a simple system running ok except when google's web crawlers start trying to find some old, long url's which used to be on the site. I have just migrated an old basically static website to web2py, to provide a base for some more interesting features in the future. However google know

[web2py] Re: How many error tickets does a typical newbie handle?

2012-11-13 Thread Niphlod
Given the DAL syntax (and usual database triggers), saying that after_update(s,f) is called with s as the set of the updated values and f as the dict passed to the update seems not hard to grasp... given db((db.testtable.id>50) & (db.testtable.articles.contains(['a','b'])).update(somefield='aa

[web2py] Pyrtf colour style problem

2012-11-13 Thread piero crisci
I am using pytrf for create a document. I want to make the Heading font with a particular kind of colour, but i cannot manage to change the color of the font. I manage to use only the standard colour in the StyleSheet. Here is the code implemented: def render_doc(): import gluon.contrib.pyrtf

Re: [web2py] Re: Multi-language website with GAE + parameter-based system

2012-11-13 Thread David Sorrentino
Hi howesc, Thanks for your reply! I tried to set the regex for my needs, but I guess that I am wrong in something. I edited the regex in this way: > - url: /(?P.+?)/static/\w\{2}?/(?P.+) > static_files: applications/\1/static/\2 > upload: applications/(.+?)/static/(.+) > secure: optional >

[web2py] Validator on a db subset -- how to?

2012-11-13 Thread dederocks
Say I have the following tables: db.define_table('person', Field('name', unique=True)) db.define_table('dog', Field('name'), Field('owner', db.person) Now on the dog table, I want to add a validator to ensure that all the dogs that belong to one person have a unique name. In other words, if Bill

[web2py] Re: Bug? Invalid url puts python into a tight loop - 100% CPU

2012-11-13 Thread jc
I can confirm this is a bug. Steps to recreate: 1) Unzip a copy of web2py_src_2.2.1.zip into a fresh directory 2) Start web2py e.g. cd web2py; python web2py.py -a test 3) Use the appadmin interface to create a new simple app e.g. myapp 4) Create a routes.py file containing routers = dict(

[web2py] Re: Changing a uploaded filename

2012-11-13 Thread Christian Espinoza
Well, thanks anyway, its was resolved using the base code from http://stackoverflow.com/questions/8008213/web2py-upload-with-original-filename Using for model: Field("file", "upload", custom_store=store_file, custom_retrieve= retrieve_file) and implementing these functions on this way: import

[web2py] Returning an array in a SOAP result

2012-11-13 Thread Calycé
Hi all, Can somebody tells me how I can return an array in a SOAP result ? It's not clear to me from reading the pysimplesoap documentation and the web2py book is a little light on the subject. I must admin I'm not (yet?) a SOAP specialist... Many thanks. --

[web2py] Re: Bug? Invalid url puts python into a tight loop - 100% CPU

2012-11-13 Thread Niphlod
seems a problem with the default regex checking for args Let's wait for Jonathan >>> import re >>> mymatch = re.compile(r'([\w@ -]+[=.]?)*$') >>> mymatch.match('a') <_sre.SRE_Match object at 0x02A61020> >>> mymatch.match('A Lccc - Pddd GA Dee ( A).pdf') endless loop

[web2py] Re: Salting tables with legacy data, when to turn on record versioning?

2012-11-13 Thread Cliff Kachinske
It was a dumb question. Archiving does not create an archive copy when you first create a record. It waits until you edit the record, then archives the old version before it commits the updates. That way, the history consists of the current record in the table plus all the referencing records

Re: [web2py] Re: Bug? Invalid url puts python into a tight loop - 100% CPU

2012-11-13 Thread Jonathan Lundell
On 13 Nov 2012, at 9:04 AM, Niphlod wrote: > seems a problem with the default regex checking for args Let's wait for > Jonathan > > >>> import re > >>> mymatch = re.compile(r'([\w@ -]+[=.]?)*$') > >>> mymatch.match('a') > <_sre.SRE_Match object at 0x02A61020> > >>> mymatch.match('A L

[web2py] auth.signature - how to set is_active back to true?

2012-11-13 Thread Cliff Kachinske
Version 2.0.9 Using auth.signature, how can I resent is_active back to true? In appadmin I can see the records where is_active is set to False, and even edit them. But if I check is_active and submit the record, the value does not change. Similarly, using ignore_common_filters, I can create a

[web2py] Re: Validator on a db subset -- how to?

2012-11-13 Thread Paolo Caruccio
Considering that (http://web2py.com/book/default/chapter/07#Validators) - a w2p validator acts at form level - we can get the value of another field on the form through "request.vars" - in IS_NOT_IN_DB validator, first parameter can be a set of records a possible answer to your question is db.dog

[web2py] EXPORT result to csv file

2012-11-13 Thread dantuluri jaganadha raju
Hi., I want the result of query to be exported to csv file. or .doc file(if possible). In a function I had a result suppose result=db().select(db.table.ALL) then how to convert this to csv. Tell me what code has to inserted to where Thanks

[web2py] Trouble with JQuery UI - use 1.8.24 not what ships

2012-11-13 Thread Luca
I had trouble using the native autocomplete provided in JQuery UI: the autocomplete list would not attach to the element where the entry occurred, but rather, it would attach to the "window" in general. Closer inspection revealed errors in the execution of JQuery UI. I solved the errors by i

Re: [web2py] Trouble with JQuery UI - use 1.8.24 not what ships

2012-11-13 Thread Richard Vézina
jQuery UI 1.9.1 is the last stable... I use it with web2py without trouble. I had experiment little glitch with 1.8.24 Also, I usually download jQuery build and use it instead of using googleapis... Richard On Tue, Nov 13, 2012 at 1:34 PM, Luca wrote: > I had trouble using the native autocomp

[web2py] Re: Placing the database of a web2py app on the cloud

2012-11-13 Thread VP
Thanks guy. --

Re: [web2py] Re: Bug? Invalid url puts python into a tight loop - 100% CPU

2012-11-13 Thread Niphlod
I'm definitely not a regex master, but what's the *[=.]?* part required for ? On Tuesday, November 13, 2012 7:00:32 PM UTC+1, Jonathan Lundell wrote: > > On 13 Nov 2012, at 9:04 AM, Niphlod > > wrote: > > seems a problem with the default regex checking for args Let's wait > for Jonathan > >

Re: [web2py] Re: Bug? Invalid url puts python into a tight loop - 100% CPU

2012-11-13 Thread Jonathan Lundell
On 13 Nov 2012, at 11:20 AM, Niphlod wrote: > I'm definitely not a regex master, but what's the [=.]? part required for ? The idea (not mine, fwiw) is that you can have multiple strings of [\w@ -]+ separated or ended (but not begun) with a single . or = (but not multiple ones). My workaround wo

Re: [web2py] OperationalError: database is locked

2012-11-13 Thread Mike Anson
Hi Vasile, Where would I put this in my script to run it once? Within the script itself say near the db.commit()? Cheers, -Mike On Friday, 9 November 2012 10:33:01 UTC-5, Vasile Ermicioi wrote: > > PS: > it is enough to execute that only once > db.executesql('PRAGMA journal_mode=WAL') > > th

[web2py] Re: Changing a uploaded filename

2012-11-13 Thread Derek
Wouldn't that also leave the uploaded file in the uploads folder? On Tuesday, November 13, 2012 10:00:24 AM UTC-7, Christian Espinoza wrote: > > Well, thanks anyway, its was resolved using the base code from > http://stackoverflow.com/questions/8008213/web2py-upload-with-original-filename > > Usi

[web2py] delete button + confirm instead of "check to delete" + confirm + submit

2012-11-13 Thread Richard
Hello, I would like to replace the way web2py allow the deletion of a record. Instead of the check to delete then confirm then submit... I would add a delete buttton on which is attached a confirmation message onclick then when the confirmation is confirmed the record is deleted. Actually I ha

Re: [web2py] Re: Bug? Invalid url puts python into a tight loop - 100% CPU

2012-11-13 Thread Niphlod
got that. Here's the problem though is that '(' and ')' are not included in [\w@ -], so the regex goes into backtrack mode.. ([\w@ -\(\)]+[=.]?)*$ seems to solve the particular issue jc is facing. are we missing any other fancy characters ? On Tuesday, November 13, 2012 8:33:26 PM UTC+

[web2py] Re: SQLFORM.smartgrid. This is a bug?

2012-11-13 Thread Jose
Here I'm wrong when I posted the question: def something(): > grilla = SQLFORM.smartgrid(table_1, orderby= table_1) > must be well: def something(): grilla = SQLFORM.smartgrid(table_1, orderby=table_1.name) Jose --

Re: [web2py] Re: Changing a uploaded filename

2012-11-13 Thread Christian Espinoza
No really, I need only that the app admin can change the logo in the webapp, and for this only is needed upload the file to applications/myapp/static/**images Christian 2012/11/13 Derek > Wouldn't that also leave the uploaded file in the uploads folder? > > On Tuesday, November 13, 2012 10:00:

[web2py] Re: EXPORT result to csv file

2012-11-13 Thread Paolo
something like that should work: open(request.folder+'/bk.csv', 'w').write(str(db(db.table.id).select(db.table.ALL))) have a look at http://web2py.com/book/default/chapter/06#CSV-%28one-Table-at-a-time%29 for more details Paolo On Tuesday, November 13, 2012 7:24:38 PM UTC+1, dantuluri jagan

Re: [web2py] delete button + confirm instead of "check to delete" + confirm + submit

2012-11-13 Thread Paolo Caruccio
a possible solution # controller def update_record(): form = crud.update(db.table, request.args(0)) delete_confirmation = T('Are you sure you want to delete this record?') delBtn = A('Delete', _href=URL('delete_record', args=['table', request.arg

[web2py] Re: How to know if you're getting a Set when you're expecting a dict?

2012-11-13 Thread Bill Thayer
Looks like I worked most of the bugs out of this. Hope it saves someone a lot of time. If you know of a more *obvious or elegant* solution please post it. Also, my slug field is returning a tuple now. Still works as a slug but I wish I didn't have the |slug|None| format. def insert_wiki_if_n

Re: [web2py] delete button + confirm instead of "check to delete" + confirm + submit

2012-11-13 Thread Richard Vézina
Hello Paolo, So far I have this: form.add_button(T('Delete'), '#', _class='btn-small btn-danger') delete_confirmation = T('Are you sure you want to delete this record?') form.element('input[value='+T('Delete')+']')['_onclick'] = "if (confirm('%s')) { jQuery('input[type=che

[web2py] Git Push ignores .gitignore

2012-11-13 Thread dhmorgan
I don't know if this is a bug or not: I added an application to my site using the admin console's 'upload from git repository' function. The repository I added was one I had previously created and pushed to Github. Its ".gitignore" file prevents the usual files and directories from being upload

Re: [web2py] delete button + confirm instead of "check to delete" + confirm + submit

2012-11-13 Thread Paolo Caruccio
Please try with: delChkbx = form.element('tr', _id='delete_record__row') delChkbx['_style'] = "position:absolute;left:-9px;" In my previous solution please set deletable=False in the form declaration. Il giorno martedì 13 novembre 2012 23:11:48 UTC+1, Richard ha scritto: > > Hell

Re: [web2py] delete button + confirm instead of "check to delete" + confirm + submit

2012-11-13 Thread Richard Vézina
I thought about something similar... I could set the check to delete to hidden and revert back to unhidden just before submit. Richard On Tue, Nov 13, 2012 at 5:32 PM, Paolo Caruccio wrote: > Please try with: > > delChkbx = form.element('tr', _id='delete_record__row') > delChkbx['_styl

Re: [web2py] delete button + confirm instead of "check to delete" + confirm + submit

2012-11-13 Thread Derek
I'd use a before_delete function to check if the checkbox 'yes im sure - delete' was checked. if not checked, don't delete. don't enable the delete button until that box is checked is another option On Tuesday, November 13, 2012 1:26:08 PM UTC-7, Richard wrote: > > Hello, > > I would like to rep

[web2py] Re: web2py as Windows service

2012-11-13 Thread Derek
Check your log files. Are you getting any errors? On Monday, November 12, 2012 3:32:07 AM UTC-7, David Sorrentino wrote: > > Hello folks! :) > > I am trying to run web2py as Windows service, but no positive results. > Following the recipe on the online book, I edited the file "options.py". > The f

Re: [web2py] delete button + confirm instead of "check to delete" + confirm + submit

2012-11-13 Thread Richard Vézina
# Basic idea from : https://mail.google.com/mail/?shva=1#search/delete+button/139d8ffdbb78d345 form.element(_id='delete_record__row')['_class']='hidden' form.add_button(T('Delete'), '#', _class='btn-small btn-danger') delete_confirmation = T('Are you sure you wan

Re: [web2py] delete button + confirm instead of "check to delete" + confirm + submit

2012-11-13 Thread Richard Vézina
Thanks for the idea Dereck Appreciate your help too Paolo! Richard On Tue, Nov 13, 2012 at 6:48 PM, Derek wrote: > I'd use a before_delete function to check if the checkbox 'yes im sure - > delete' was checked. if not checked, don't delete. don't enable the delete > button until that box is ch

Re: [web2py] delete button + confirm instead of "check to delete" + confirm + submit

2012-11-13 Thread Richard Vézina
I improve it a bit by making sure the only form that get submit is the desired form : form.element(_id='delete_record__row')['_class']='hidden' # To hide the "check to delete boolean" form.add_button(T('Delete'), '#', _class='btn-small btn-danger') # Add delete button

[web2py] Re: Git Push ignores .gitignore

2012-11-13 Thread dhmorgan
on a related note, I am now noticing that if I re-install using the same name and checking the 'overwrite existing app' option, the flash message is that the url is invalid; uninstalling the first app (or using a different app name) and using the same url successfully installs the app On Tuesda

[web2py] Re: web2py as Windows service

2012-11-13 Thread Tim Richardson
what kind of Windows is it? How did you install Python, and which distribution is it? Is your Web2py a source code install, or the .exe install? --

Re: [web2py] OperationalError: database is locked

2012-11-13 Thread Vasile Ermicioi
first be sure you have sqlite >=3.7: 1) open python 2)>import sqlite3 3)>print sqlite3.sqlite_version if you don't have sqlite >=3.7 you can't use wal put the code in models/db.py after database connection db = DAL('sqlite://storage.sqlite') db.executesql('PRAGMA journal_mode=WAL') but you can

[web2py] Re: Placing the database of a web2py app on the cloud

2012-11-13 Thread pbreit
You could also set up an ssh tunnel. Might be a touch more secure. On Monday, November 12, 2012 1:59:32 PM UTC-8, howesc wrote: > > if you are using a SQL instance (mysql, postgres etc), you'll just have to > use a fully qualified connection string rather than localhost. all the > rest should

[web2py] areyouahuman.com CAPTCHA

2012-11-13 Thread Auden RovelleQuartz
has anyone tried to integrate the CAPTCHA application at http://www.areyouahuman.com in the web2py framework? if so, how did you get it to work? --

[web2py] SQLTABLE(query) produces different SQL than SQLFORM.grid(query)

2012-11-13 Thread Johann Spies
The following code: fields = [db.rjoernaal.so, db.rpublisher.pu, db.rpublisher.pi] query = ((db.rjoernaal.uuid == db.rpub_rj.rj_id) & (db.rpub_rj.rpub_id == db.rpublisher.id)) data = SQLTABLE(db(query).select(db.rjoernaal.so, db.rpublisher.pu, db. rpublisher.pi,

Re: [web2py] Re: web2py as Windows service

2012-11-13 Thread David Sorrentino
Hello Derek and Tim, First of all thanks for your reply. :) @Derek: I do not see any log in the logs folder, but logging is not enabled. This morning I will enable it and tell you the results. @Tim: I am testing my app on Windows 7. I did not install any Python distribution on Windows, since I h

Re: [web2py] Re: Bug? Invalid url puts python into a tight loop - 100% CPU

2012-11-13 Thread jc
Thanks for the suggestion. I have made the Niphlod's change to the regex without really understanding the implications. It seems to have fixed my immediate problem, so at least I am back up. I will try to understand what it is all about later on. --