[web2py] Re: upload widgets problem with nullable compound validators

2011-01-16 Thread kenji4569
I ended up with making a custom validator "IS_ALL" for the problem: "IS_NULL_OR(IS_ALL([IS_XXX(..), IS_YYY(..), ..])" and it works. The alternatives could be to permit the follwoing interfaces, which need patches though: "IS_NULL_OR([IS_XXX(..), IS_YYY(..), ..])" or "[IS_NULL_OR(IS_XXX(..)),

[web2py] Re: looking for advice on validation

2011-01-16 Thread Massimo Di Pierro
You can do db.mytable.myfield.requires='...' form=SQLFORM(db.mytable) On Jan 16, 9:44 pm, tomt wrote: > Hi, > > I have learned to use SQLFORM to generate forms.  The validation > defined in the db model works as expected, but there are times when I > want to write a controller that uses a differ

[web2py] looking for advice on validation

2011-01-16 Thread tomt
Hi, I have learned to use SQLFORM to generate forms. The validation defined in the db model works as expected, but there are times when I want to write a controller that uses a different validation than what is defined in the model. (Specifically, I want to force a different date validation) >F

[web2py] Re: sqlform.factory, inserting variable number of records in an other table

2011-01-16 Thread mart
You know, I discovered a week or 2 ago a way to make a form appear to have sub-forms (or sub-templates). Massimo's 'Audit Trail' (i think I saw it on web2pyslices) serves this purpose extremely well. To that, it becomes very easy to write scripts to generate all sorts of combinations of tables that

[web2py] Trying to pivot some date, need to add nulls for missing rows

2011-01-16 Thread Lorin Rivers
I have a list of distinct values for a column "StringID": 'S', 'S0001', S0002'. A FreezeTime value can have 1 to 3 rows (one row for each StringID) like this: FreezeTime, StringID, Po_avg_sum 12/13/2010 22:00:00, S, 76 12/13/2010 22:00:00, S0001

[web2py] Re: Testing the new router

2011-01-16 Thread Matt
Hi Jonathan, Thanks for your quick response. Yes the application is 'app'. Sure, that would be great. Cheers, Matt On Jan 17, 2:19 pm, Jonathan Lundell wrote: > Thanks for the report, Matt. > > On Jan 16, 2011, at 5:11 PM, Matt wrote: > > > > > > > > > > > > > Hi Jonathan, > > > I'm also tryi

Re: [web2py] error in web2py book

2011-01-16 Thread KK
Richard, Can you elaborate? What exactly do I do with the shell? Do I use it to debug? To edit sources? I really don't know what went wrong. It could be the session. The application source was the problem, not the other stuff. So maybe the session was corrupted. I guess I was running deb

Re: [web2py] Testing the new router

2011-01-16 Thread Jonathan Lundell
On Jan 16, 2011, at 5:27 PM, Kenneth Lundström wrote: > > > So far so good. You need to copy your router file to routes.py, though. > >> If you cp router.example.py to routes.py and then replace the routers dict >> with yours, that should be a good start. > > I copied the file, changed ownershi

Re: [web2py] Testing the new router

2011-01-16 Thread Kenneth Lundström
> So far so good. You need to copy your router file to routes.py, though. If you cp router.example.py to routes.py and then replace the routers dict with yours, that should be a good start. I copied the file, changed ownership, permissions, but nothing. Not until I restarted Apache was the

Re: [web2py] Re: Testing the new router

2011-01-16 Thread Jonathan Lundell
Thanks for the report, Matt. On Jan 16, 2011, at 5:11 PM, Matt wrote: > > Hi Jonathan, > > I'm also trying to use the new routing approach and I'm having a > little trouble with static files. > > In my app's static directory I have sub folders (containing files) > like this: > > /static/css/

Re: [web2py] Testing the new router

2011-01-16 Thread Jonathan Lundell
On Jan 16, 2011, at 5:08 PM, Kenneth Lundström wrote: > > > The nightly is pretty old. > > Where can you see if my upgrading to a trunk version worked? I did a hg clone > https://web. and then copied everything to my web2py folder. > > Earlier I edited the routes file, now I noticed a new f

[web2py] Re: Testing the new router

2011-01-16 Thread Matt
Hi Jonathan, I'm also trying to use the new routing approach and I'm having a little trouble with static files. In my app's static directory I have sub folders (containing files) like this: /static/css/base.css /static/images/logo.png /static/js/jquery.js I'm using the most minimal routin

Re: [web2py] Testing the new router

2011-01-16 Thread Kenneth Lundström
> The nightly is pretty old. Where can you see if my upgrading to a trunk version worked? I did a hg clone https://web. and then copied everything to my web2py folder. Earlier I edited the routes file, now I noticed a new file named router.examples.py. I added those lines to it. But can´t

Re: [web2py] Testing the new router

2011-01-16 Thread Jonathan Lundell
On Jan 16, 2011, at 4:39 PM, Kenneth Lundström wrote: > > > I'm not sure what's in the nightly build. The abc= line should tell us > > something, and I can give you a little more debugging depending on what it > > says. The nightly is pretty old. Massimo?

Re: [web2py] Testing the new router

2011-01-16 Thread Jonathan Lundell
On Jan 16, 2011, at 4:39 PM, Kenneth Lundström wrote: > > > I'm not sure what's in the nightly build. The abc= line should tell us > > something, and I can give you a little more debugging depending on what it > > says. > > abc gave nothing, it loaded welcome without any errors, or were should

Re: [web2py] Testing the new router

2011-01-16 Thread Kenneth Lundström
> I'm not sure what's in the nightly build. The abc= line should tell us something, and I can give you a little more debugging depending on what it says. abc gave nothing, it loaded welcome without any errors, or were should I see any complaints about an unknown key? I´m running on linux, Ce

[web2py] plugin_wiki using wiki and html mode

2011-01-16 Thread blackthorne
Consider a control for the page mode and that info would be stored with the page so that plugin_wiki would know how to render it. When editing it would be up to you, for each post to decide how do you want to do it.. Someone already tried to make the two of them to work simultaneously? Thanks Fra

Re: [web2py] Testing the new router

2011-01-16 Thread Jonathan Lundell
On Jan 16, 2011, at 3:26 PM, Kenneth Lundström wrote: > > > Are you running the current trunk? There hasn't been a release with the new > > router yet. Try adding the abc line below (note the comma); you should get > > a complaint about an unknown key. > > I´m running the newest Nightly Built?

[web2py] Re: ajax upload for components

2011-01-16 Thread weheh
Michele, I'm so sorry for flip flopping. This thing is proving quite hard to debug. As a matter of fact, the ajax Form was never working correctly. On submission, it reloads the entire page instead of just the target div and divs touched by the success callback. I didn't notice at first because th

Re: [web2py] error in web2py book

2011-01-16 Thread Richard Vézina
I got no error with the exact code you sent above Try to clean you app, may be related to old session? Richard On Sun, Jan 16, 2011 at 6:51 PM, KK wrote: > It was a strange error, now after copying a newly extracted source over my > web2py directory it is working again. > > Thanks again. >

Re: [web2py] error in web2py book

2011-01-16 Thread KK
It was a strange error, now after copying a newly extracted source over my web2py directory it is working again. Thanks again.

Re: [web2py] error in web2py book

2011-01-16 Thread Richard Vézina
You can use the shell... Richard On Sun, Jan 16, 2011 at 5:58 PM, KK wrote: > 1.91.6 is the reported version. > > I have web2py extracted from source into my python25's site-packages and > debugging it from pycharm (and also running it from the command line). > > Oh very interesting. If I run

Re: [web2py] Testing the new router

2011-01-16 Thread Kenneth Lundström
> Are you running the current trunk? There hasn't been a release with the new router yet. Try adding the abc line below (note the comma); you should get a complaint about an unknown key. I´m running the newest Nightly Built? > One more question: does this work OK with the old routing logic? I

[web2py] Re: issue with TAG and unicode

2011-01-16 Thread carlo
I am with you and I think would be useful, TAG would be so useful with XML. Actually skimming the code I could not find where the quirk is. Additionally I see that unicode TAG names are indeed supported some way: >>> name=u'là' >>> value='plain' >>> TAG[name](value).xml() u'plain' Even value can

Re: [web2py] Testing the new router

2011-01-16 Thread Jonathan Lundell
On Jan 16, 2011, at 2:42 PM, Kenneth Lundström wrote: > > > Start with router.example.py instead. The key to using the new router is to > > define a dict named 'routers'. There's more documentation in the file, and > > I'll repost some examples below. > > > Post your routes.py here, along with

Re: [web2py] Testing the new router

2011-01-16 Thread Jonathan Lundell
On Jan 16, 2011, at 2:42 PM, Kenneth Lundström wrote: > > I just added: > > routers = dict( >BASE = dict( >domains = { >'economy.nudata.fi' : 'economy', >'testing.nudata.fi' : 'testapplication', >} >), > ) > > but if if go to economy.nudata.fi I ge

Re: [web2py] error in web2py book

2011-01-16 Thread Kenneth Lundström
It should not have anything to do with the version of python. What kind of an error do you receive when you get it? I develop code with an text editor. I find the web interface too slow and cumbersome to use. In the begining I used Wingwares IDE but not anymore. I would probably be great for d

Re: [web2py] error in web2py book

2011-01-16 Thread KK
1.91.6 is the reported version. I have web2py extracted from source into my python25's site-packages and debugging it from pycharm (and also running it from the command line). Oh very interesting. If I run the windows exe file and edit using the web interface it works just fine. What could be

Re: [web2py] Testing the new router

2011-01-16 Thread Kenneth Lundström
> Start with router.example.py instead. The key to using the new router is to define a dict named 'routers'. There's more documentation in the file, and I'll repost some examples below. > Post your routes.py here, along with a description of what you intend that it does (if it's not obvious).

Re: [web2py] Re: issue with TAG and unicode

2011-01-16 Thread Jonathan Lundell
On Jan 16, 2011, at 2:00 PM, carlo wrote: > >> Leave the tag itself a plain string. > > don't you think this is a hard constraint? > Personally I do. > > TAG promised to be such a handy tool to generate XML from Excel data, > which is the purpose of my app, but unfortunately this will not be > t

Re: [web2py] Testing the new router

2011-01-16 Thread Jonathan Lundell
On Jan 16, 2011, at 1:57 PM, Kenneth Lundström wrote: > > how do I test the new router that Jonathan has made. > > I renamed the routes.examples.py to routes.py and edited it. No mather what I > write in it gets used. I tried to find the answer in all posts on the > mailinglist but no success.

Re: [web2py] error in web2py book

2011-01-16 Thread Kenneth Lundström
the line redirect(URL('second')) produces an error in URL. What version of web2py are you using? Writing redirect((URL('second')) works very well, atleast with 1.91.6. Kenneth second function is maybe leave empty, then you just have to imagine what ever you want?? Richard On Sun, Jan 1

[web2py] Re: issue with TAG and unicode

2011-01-16 Thread carlo
> Leave the tag itself a plain string. don't you think this is a hard constraint? Personally I do. TAG promised to be such a handy tool to generate XML from Excel data, which is the purpose of my app, but unfortunately this will not be true.

Re: [web2py] error in web2py book

2011-01-16 Thread Richard Vézina
second function is maybe leave empty, then you just have to imagine what ever you want?? Richard On Sun, Jan 16, 2011 at 1:14 AM, KK wrote: > Hello, > > I'm attempting to learn web2py and I think there is an error in the book. > http://web2py.com/book/default/chapter/03 > > def first(): > i

[web2py] Testing the new router

2011-01-16 Thread Kenneth Lundström
Hello, how do I test the new router that Jonathan has made. I renamed the routes.examples.py to routes.py and edited it. No mather what I write in it gets used. I tried to find the answer in all posts on the mailinglist but no success. Kenneth

[web2py] Re: issue with TAG and unicode

2011-01-16 Thread carlo
> Leave the tag itself a plain string. don't you think this is a hard constraint? Personally I do. I thought TAG was a great tool to generate xml easily from Excel data replacing the "oversized" ElementTree but unfortunately this will not be possible.

[web2py] sqlform.factory, inserting variable number of records in an other table

2011-01-16 Thread Richard Vézina
Hello, Let me expose my problem. I have a test (experience test that I made in lab) that I have to redo many time. At time point 1 there is only one result, but at the other time point the is one more result to store each time. So at time point 2 there is two results, at time point 3 there is 3 re

[web2py] Re: if user going logged out

2011-01-16 Thread pk
thanks On 13 Jan., 20:51, Bruno Rocha wrote: > I figure out a problem with logout, so you have to do something like this. > > > > def define_user_session(): >         if auth.user: >             session['my_user_id'] = auth.user.id > > auth.settings.login_onaccept.append(lambda x:define_user_ses

[web2py] Re: prevent post on reload

2011-01-16 Thread Russell
This JavaScript will refresh the page without reposting the data: window.location = window.location; On Jan 17, 4:04 am, weheh wrote: > I'm using components, not typical web2py way of doing things. > > On Jan 16, 3:51 am, Kenneth Lundström > wrote: > > > But isn t web2py taking care of this alr

[web2py] Re: account for each user

2011-01-16 Thread Rick
I suppose that the problem is that the "records" list isn't completely returned from the controller file to create.html and that the "thedate" field is lost in that process. On Jan 16, 9:32 pm, Rick wrote: > Hmmm... strange... the error disappeared, but it was replaced by > another one: > KeyErro

[web2py] Re: account for each user

2011-01-16 Thread Rick
Hmmm... strange... the error disappeared, but it was replaced by another one: KeyError: 'thedate' ...and this error arises from the html-table in the create.html -- the code works when i delete the table. On Jan 16, 8:40 pm, Rick wrote: > Perhaps the previous post was a bit vague. I meant that cr

[web2py] Re: Apache, Wsgi problem

2011-01-16 Thread VP
Kenneth (see post above) had the same problem with MySQL. On Jan 16, 3:55 am, ron_m wrote: > Is there any chance to try another server based database such as MySQL. > Since SQLite did not exhibit a problem that is a valid data point but it is > an embedded database so called directly by the web2p

[web2py] Re: account for each user

2011-01-16 Thread Rick
Perhaps the previous post was a bit vague. I meant that create.html works when it only contains {{=form}}. On Jan 16, 8:35 pm, Rick wrote: > Yes, {{=form}} works without the other code. > > On Jan 16, 6:35 pm, Martín Mulone wrote: > > > > > > > > > to test, put only  {{=form}} in create.html rem

[web2py] Re: account for each user

2011-01-16 Thread Rick
Yes, {{=form}} works without the other code. On Jan 16, 6:35 pm, Martín Mulone wrote: > to test, put only  {{=form}} in create.html remove all the other. Now the > error continue? > > 2011/1/16 Rick > > > > > > > > > > > thanks for the comments. I deleted the #. At the beginning of > > create.ht

[web2py] Re: Apache, Wsgi problem

2011-01-16 Thread ron_m
I can't seem to get it to generate an error running on PostgreSQL and the apache logs show nothing. I upped the ab time ( -t ) to 100 and then used the application. It wasn't very responsive but then the ab average was 8+sec on the home page which just displays a message. I am using the default

Re: [web2py] Re: account for each user

2011-01-16 Thread Martín Mulone
to test, put only {{=form}} in create.html remove all the other. Now the error continue? 2011/1/16 Rick > thanks for the comments. I deleted the #. At the beginning of > create.html there is this code: > {{import datetime}} > {{import uuid}} > {{recording=datetime.date(2000,01,01)}} > ...but th

[web2py] Re: account for each user

2011-01-16 Thread Rick
thanks for the comments. I deleted the #. At the beginning of create.html there is this code: {{import datetime}} {{import uuid}} {{recording=datetime.date(2000,01,01)}} ...but the error remains :( On Jan 16, 2:13 pm, "Martin.Mulone" wrote: > in create.html > > #if recording!=record.thedate:} >

[web2py] Re: request.vars and lists question

2011-01-16 Thread rick
Ah! Thank you, that works great. - rick On Jan 16, 3:10 pm, Jonathan Lundell wrote: > Try: theAnimals = request.vars.getlist("animals")

[web2py] Re: request.vars and lists question

2011-01-16 Thread rick
Ah! Thank you, that works great. - rick On Jan 16, 3:10 pm, Jonathan Lundell wrote: > Try: theAnimals = request.vars.getlist("animals")

[web2py] Re: request.vars and lists question

2011-01-16 Thread rick
Ah! Thank you, that works great. - rick On Jan 16, 3:10 pm, Jonathan Lundell wrote: > Try: theAnimals = request.vars.getlist("animals")

Re: [web2py] request.vars and lists question

2011-01-16 Thread Jonathan Lundell
On Jan 16, 2011, at 8:57 AM, rick wrote: > > I have a simple function: > > def simpletest(animals): >theAnimals = request.vars["animals"] >leng = len(theAnimals) >return dict(leng = leng) > > When I call it with two animals: > http://mySite.com/myApp/default/call/run/simp

[web2py] request.vars and lists question

2011-01-16 Thread rick
I have a simple function: def simpletest(animals): theAnimals = request.vars["animals"] leng = len(theAnimals) return dict(leng = leng) When I call it with two animals: http://mySite.com/myApp/default/call/run/simpletest?animals=cat&animals=dog .. I get the answer 2, as I

[web2py] inconsistency in error messages (minor issue)

2011-01-16 Thread teemu
Hi, I am just trying to familiar myself with web2py. It looks very promising and I am sure that will use it several projects in the future. I discovered minor inconsistency in error messages defined validators.py and tools.py (Auth class to be precise). All error messages in Auth class start with

[web2py] error in web2py book

2011-01-16 Thread KK
Hello, I'm attempting to learn web2py and I think there is an error in the book. http://web2py.com/book/default/chapter/03 def first(): if request .vars.visitor_name: session .visitor_

Re: [web2py] Re: issue with TAG and unicode

2011-01-16 Thread Jonathan Lundell
On Jan 16, 2011, at 1:22 AM, carlo wrote: > r=TAG['pippo'](u'plutò') str(r) > 'plut\xc3\xb2' r=TAG[u'pippo'](u'plutò') str(r) > Traceback (most recent call last): > File "", line 1, in > File "C:\Python26\web2py\gluon\html.py", line 797, in __str__ >return self.xml() >

[web2py] Re: issue with TAG and unicode

2011-01-16 Thread Massimo Di Pierro
Tag names should not be unicode. On Jan 16, 3:22 am, carlo wrote: > >>> r=TAG['pippo'](u'plutò') > >>> str(r) > > 'plut\xc3\xb2'>>> r=TAG[u'pippo'](u'plutò') > >>> str(r) > > Traceback (most recent call last): >   File "", line 1, in >   File "C:\Python26\web2py\gluon\html.py", line 797, in __st

Re: [web2py] Prevent (ajax *.load) views from being indexed by search engines?; redirect to component's container when not loaded by ajax?

2011-01-16 Thread Martín Mulone
Try: http://www.google.com/support/webmasters/bin/answer.py?answer=93710 2011/1/16 John-Kim Murphy > This URL has been indexed by Google: > http://www.koreabites.com/inbite/inbite/ajax_signup_form.load > I would prefer this URL to be indexed: > http://www.koreabites.com/inbite/inbite/ind

[web2py] Prevent (ajax *.load) views from being indexed by search engines?; redirect to component's container when not loaded by ajax?

2011-01-16 Thread John-Kim Murphy
This URL has been indexed by Google: http://www.koreabites.com/inbite/inbite/ajax_signup_form.load I would prefer this URL to be indexed: http://www.koreabites.com/inbite/inbite/index/ Is there a way to prevent certain actions/views from being indexed by search engines? Also, is there a way to

Re: [web2py] Re: ajax upload for components

2011-01-16 Thread Michele Comitini
thanks very much richard! sorry for responding late but the flou had beaten me badly! maybe it is the age... :( There are also a couple of things that are related to the fact that doing a submission via IFRAME we cannot send the correct http headers: http://www.web2py.com/book/default/chapter/13#C

[web2py] Re: prevent post on reload

2011-01-16 Thread weheh
I'm using components, not typical web2py way of doing things. On Jan 16, 3:51 am, Kenneth Lundström wrote: > But isn t web2py taking care of this already. Have you tried this double > posting? If you answer yes on browsers question do you get two sets of > answer in your database? > > Kenneth > >

[web2py] Re: account for each user

2011-01-16 Thread Martin.Mulone
in create.html #if recording!=record.thedate:} you commented this line but you hasn't commented the pass, the same to {{#session.uuid=record.uuid}} and what is recording??.

[web2py] Re: account for each user

2011-01-16 Thread Rick
I changed the code and I suppose I'm on the right track but I get an error message when I try to run the app: ./create.html", line 91 response.write(form) ^ SyntaxError: invalid syntax Here is the code: ===in a controller file===

[web2py] Re: Apache, Wsgi problem

2011-01-16 Thread ron_m
Is there any chance to try another server based database such as MySQL. Since SQLite did not exhibit a problem that is a valid data point but it is an embedded database so called directly by the web2py server code instead of using a driver. There is a possibility there is a problem with the driv

[web2py] Re: issue with TAG and unicode

2011-01-16 Thread carlo
>>> r=TAG['pippo'](u'plutò') >>> str(r) 'plut\xc3\xb2' >>> r=TAG[u'pippo'](u'plutò') >>> str(r) Traceback (most recent call last): File "", line 1, in File "C:\Python26\web2py\gluon\html.py", line 797, in __str__ return self.xml() File "C:\Python26\web2py\gluon\html.py", line 790, in xml

Re: [web2py] Re: Upload field

2011-01-16 Thread Kenneth Lundström
Yes I was trying to understand how the manual uploading was working, never got it working, but I solved the issue an other way so did not put any more time on it. Kenneth Are you trying to do manual upload? I remember I got such an error a while back. Can't recall exactly what happened tha

Re: [web2py] Re: About bugreports

2011-01-16 Thread Kenneth Lundström
I think most of those bugreports are related with the problem removing foreign key relations in MySQL. If I remove a reference field in models file I get a error stating that MySQL cannot remove the foreign key. After that I usually backup the database, drop it, remove all files in /databases/,

Re: [web2py] Re: prevent post on reload

2011-01-16 Thread Kenneth Lundström
But isn´t web2py taking care of this already. Have you tried this double posting? If you answer yes on browsers question do you get two sets of answer in your database? Kenneth That is my suspicion, too. On Jan 16, 2:59 am, Robby O'Connor wrote: I believe (somebody can correct me if i'm w

[web2py] Re: prevent post on reload

2011-01-16 Thread weheh
That is my suspicion, too. On Jan 16, 2:59 am, Robby O'Connor wrote: > I believe (somebody can correct me if i'm wrong) that this is a browser > issue. > On 1/16/2011 2:22 AM, weheh wrote: > > > Anyone know how to prevent posting on reload? Right after submitting a > > form, if I reload, I'm alwa