[web2py:12895] help with testing for validators

2008-12-03 Thread mdipierro
It would be great if somebody could write a unittest for validators... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsu

[web2py:12894] Re: View: Nested Loops?

2008-12-03 Thread Fran
> This should work fine It does...am not quite sure which mistake I made, but it's all working fine now. *Many* thanks :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this

[web2py:12893] Re: upload a folder

2008-12-03 Thread mdipierro
HTTP does not allow that unless your client (flash, js, etc.) uploads each individual file (http://plugins.jquery.com/project/MultiFile) or zips files and the uploads the zip file (I have never see a js library to do it). Massimo On Dec 4, 1:04 am, somebody <[EMAIL PROTECTED]> wrote: > can I upl

[web2py:12892] upload a folder

2008-12-03 Thread somebody
can I upload a folder / copy a whole folder to another directory?? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubsc

[web2py:12891] Re: redirection

2008-12-03 Thread pmate
Thanks a lot massimo i will follow your suggestions and i will study your code. Ciao Paolo On 4 Dic, 01:02, mdipierro <[EMAIL PROTECTED]> wrote: > I edited the code below, look for the lines that contain refereer > > def update(): >      try: >          dbname=request.args[0] >          db=eval(

[web2py:12890] Re: ssl_error_rx_record_too_long

2008-12-03 Thread achipa
Just ran into this one, but with apache, so a little followup - this was a case where you're trying to establish an SSL connection, and other side expects a regular http request. It had nothing to do with the actual port or self-signedness of the cert - just mismatching the virtualhost directives

[web2py:12889] trunk

2008-12-03 Thread mdipierro
I made some major changes in the handling of checkboxes following the guidelines of Bill's patch. Now you can do: INPUT(_name='x',_type='checkbox',value=True) #default on - new INPUT(_name='x',_type='checkbox',value=False) # default off - new INPUT(_name='x',_type='checkbox',value='on,_value='on'

[web2py:12888] Re: View: Nested Loops?

2008-12-03 Thread mdipierro
This should work fine {{try:}} {{for option in options:}} {{=option}} {{pass}} {{except:}} oops {{pass}} if you get an error it is usually because a line ending in : is not paired up by a pass or because of unmatched {{ }} or because a block is empty. Massimo On Dec 3, 5:50 pm, "Yarko Tymciura

[web2py:12887] Re: redirection

2008-12-03 Thread mdipierro
I edited the code below, look for the lines that contain refereer def update(): try: dbname=request.args[0] db=eval(dbname) table=request.args[1] except: response.flash=T('invalid request') redirect(URL(r=request,f='index')) try:

[web2py:12886] Re: View: Nested Loops?

2008-12-03 Thread Yarko Tymciurak
What are you trying that you think it's not working? Can you show the code? In general, think like this: Write out "normal" Python code; add {{ }} around every line; Everywhere you have an UN-INDENT, add a {{pass}} (you don't really need a pass everywhere, only where it's ambiguous - but th

[web2py:12885] View: Nested Loops?

2008-12-03 Thread Fran
I've added a section within my layout.html with some loops like this: {{for option in options:}} {{pass}} What I'd like is to have the ability to put either a {{try:}} ((except:}} {{pass}} or an {{if setting:}} {{pass:}} around this. This doesn't seem to work, so I guess there's a fundamenta

[web2py:12884] Re: redirection

2008-12-03 Thread pmate
So, wich is the best way to do it? What do you suggest? Paolo On 3 Dic, 17:24, mdipierro <[EMAIL PROTECTED]> wrote: > Yes, as long you do not allow the possibility of two browser windows > on two different pages. > > Massimo > > On Dec 3, 9:58 am, pmate <[EMAIL PROTECTED]> wrote: > > > i made th

[web2py:12883] Re: trying to get multiple db

2008-12-03 Thread mmstud
Got little further with this concept and created new validator upon modified html helpers and form handling classes. Basically im thinking to generalize and automate form processing, that takes values from several tables, perhaps even from different databases. This validator was also inspired fro

[web2py:12882] Re: new in trunk DAL unittest

2008-12-03 Thread mdipierro
Good point. We can do the command line switch. -T On Dec 3, 12:37 pm, Timothy Farrell <[EMAIL PROTECTED]> wrote: > I don't like that idea. It increases restart time (not significantly until > we get more tests) in a situation where it wouldn't make a difference the > vast majority of the time.

[web2py:12881] Re: [web2py:/] Re: new in trunk DAL unittest

2008-12-03 Thread Yarko Tymciurak
On Wed, Dec 3, 2008 at 12:37 PM, Timothy Farrell <[EMAIL PROTECTED]> wrote: > I don't like that idea. It increases restart time (not significantly > until we get more tests) in a situation where it wouldn't make a difference > the vast majority of the time. > +1and if it's a command line sw

[web2py:12880] Re: [web2py:/] Re: new in trunk DAL unittest

2008-12-03 Thread Timothy Farrell
I don't like that idea.  It increases restart time (not significantly until we get more tests) in a situation where it wouldn't make a difference the vast majority of the time. Some of your DAL tests depend on the existence of the admin app which may not be there and will cause problems for e

[web2py:12879] Re: [web2py:/] Re: new in trunk DAL unittest

2008-12-03 Thread Yarko Tymciurak
I think an option to run tests on startup (not unlike -S for shell) would be good. This would be a good start for contributions - don't ask for a merge until all tests pass (a test merge can make that the first test too). Since deployment (and auto-restart) could be anywhere, I would separate se

[web2py:/] Re: new in trunk DAL unittest

2008-12-03 Thread mdipierro
Perhaps all tests should run automatically every time web2py starts. What do people think about it? Massimo On Dec 3, 9:53 am, Timothy Farrell <[EMAIL PROTECTED]> wrote: > The branch (dal-testing-additions) is committed and I've proposed a merge > into devel. > -tim > mdipierro wrote:ok, thanks

[web2py:12877] Re: redirection

2008-12-03 Thread mdipierro
Yes, as long you do not allow the possibility of two browser windows on two different pages. Massimo On Dec 3, 9:58 am, pmate <[EMAIL PROTECTED]> wrote: > i made this way: > in controller default: > session.path='http://'+request.env.http_host+request.env.path_info > > in controller gestione/upd

[web2py:12876] Re: Dropbox based on a none unique column.

2008-12-03 Thread annet
Denes, Thanks, problem solved, and something learned again. I have just downloaded the pengoworks auto-complete files, and am trying to figure out from the post you reference above how to get all this to work properly in case of my plaatsnaam auto-complete field. Since I do not need an id, just

[web2py:12875] Re: redirection

2008-12-03 Thread pmate
i made this way: in controller default: session.path='http://'+request.env.http_host+request.env.path_info in controller gestione/update: redirect(session.path) it seems it is working but i wonder if this is the correct solution On 3 Dic, 10:26, pmate <[EMAIL PROTECTED]> wrote: > Ciao Massimo,

[web2py:12874] Re: new in trunk DAL unittest

2008-12-03 Thread Timothy Farrell
The branch (dal-testing-additions) is committed and I've proposed a merge into devel. -tim mdipierro wrote: ok, thanks. On Dec 3, 9:21 am, Timothy Farrell <[EMAIL PROTECTED]> wrote: I do it like this: import sys import os sys.path.append(os.path.realpath('../')) import unittest

[web2py:12873] Re: IS_IN_SET doesn't produce dropdown if IS_NOT_IN_DB also required

2008-12-03 Thread DenesL
tablename is created from the field parameter, if your field is 'gis_key.service' then tablename='gis_key' Your model should have something like: db.gis_key.key.requires=THIS_NOT_IN_DB(db (db.gis_key.service==request.vars.service),'gis_key.service',request.vars.service,'service already in use')

[web2py:12872] Re: new in trunk DAL unittest

2008-12-03 Thread mdipierro
ok, thanks. On Dec 3, 9:21 am, Timothy Farrell <[EMAIL PROTECTED]> wrote: > I do it like this: > import sys > import os > sys.path.append(os.path.realpath('../')) > import unittest > import datetime > import sql > and then run it from the tests directory.  Just leave it for now and I'll > includ

[web2py:12871] Re: Dropbox based on a none unique column.

2008-12-03 Thread DenesL
Annet, you have to pass the url to the javascript function: function detailsview(url) { window.open(url, 'mywindow', 'height=600, width=400,menubar=false');} {{=A(club.bedrijf.bedrijfsnaam, _href="javascript:detailsview('%s')" %URL(r=request,f='clubdetails',args =[club.bedrijf.id]),

[web2py:12870] Re: new in trunk DAL unittest

2008-12-03 Thread Timothy Farrell
I do it like this: import sys import os sys.path.append(os.path.realpath('../')) import unittest import datetime import sql and then run it from the tests directory.  Just leave it for now and I'll include it in my change branch. -tim mdipierro wrote: I was going to ask you the same qu

[web2py:12869] Re: IS_IN_SET doesn't produce dropdown if IS_NOT_IN_DB also required

2008-12-03 Thread Fran
> Fran, the code above was just an example. > You have to adapt the validator parameters to your own model, i.e. you > don't have a 'gis' table. Yup, I spotted that ;) I originally tried changing it to my data then when I thought I must be mistranslating, then I created a table exactly as defined

[web2py:12868] Re: new in trunk DAL unittest

2008-12-03 Thread mdipierro
I was going to ask you the same question. I open a python shell and import the tests. Massimo On Dec 3, 8:25 am, Timothy Farrell <[EMAIL PROTECTED]> wrote: > Massimo, > When you run unittests, which directory do you run them from.  I typically > run mine from the test directory, but i have a bu

[web2py:12867] Re: web2py 1.52 posted

2008-12-03 Thread mdipierro
There should be a README file but I may have forgot to update it. On Dec 3, 8:00 am, Iceberg <[EMAIL PROTECTED]> wrote: > On Dec 3, 6:29 am, mdipierro <[EMAIL PROTECTED]> wrote: > > > please check it out. Very minor changes. The major change is caching > > of bytecode on GAE. > > Is there any lat

[web2py:12866] Re: membership growth

2008-12-03 Thread mdipierro
Joe, thanks for clarifying the difference between "advertise" and "advocate". It is an important difference and it escaped to me. 43g, sorry but the name has a history and it is staying. gluon, tau, etc. are all trademarked. I do not like it, it is not enforcible, but it can create trouble. web2p

[web2py:12865] Re: Error in FAQ

2008-12-03 Thread mdipierro
yes, will fix it asap. On Dec 3, 12:55 am, michal niklas <[EMAIL PROTECTED]> wrote: > Hello, > > I think that there is error in FAQ 'Form > navigation':http://mdp.cti.depaul.edu/AlterEgo/default/show/33 > > There is: >    if form.accepts(session.vars,session): > > I thought that first arg for fo

[web2py:12864] Re: IS_IN_SET doesn't produce dropdown if IS_NOT_IN_DB also required

2008-12-03 Thread DenesL
Fran, the code above was just an example. You have to adapt the validator parameters to your own model, i.e. you don't have a 'gis' table. On Dec 3, 2:50 am, Fran <[EMAIL PROTECTED]> wrote: > > Fran, the following validator seems to work as per your needs: > > This looks really nice - many thanks

[web2py:12863] Re: new in trunk DAL unittest

2008-12-03 Thread Timothy Farrell
Massimo, When you run unittests, which directory do you run them from.  I typically run mine from the test directory, but i have a built-in path mechanism to be able to find the necessary modules.  With your new test_dal.py, I cannot get it to run properly without modifying the PYTHONPATH. 

[web2py:12862] Re: new in trunk DAL unittest

2008-12-03 Thread Timothy Farrell
Oh snap! I've gotta go make a launchpad branch and merge my changes in.  I have already started something for this but fortunately our efforts don't overlap much. -tim mdipierro wrote: gluon/tests/test_dal.py the test does not yet include migrations, max, min, sum operators, csv IO and

[web2py:12861] Re: web2py 1.52 posted

2008-12-03 Thread Iceberg
On Dec 3, 6:29 am, mdipierro <[EMAIL PROTECTED]> wrote: > please check it out. Very minor changes. The major change is caching > of bytecode on GAE. Is there any latest whatsnew.txt or changes.txt which comes with every version of new web2py? I could not find any in web2py_win.zip neither web2py_

[web2py:12860] Re: insert a default value into a text of a table form

2008-12-03 Thread MadWalker
Thank for the code when set to default will it set to all to default too? thanks and good day On Dec 2, 4:48 pm, "Yarko Tymciurak" <[EMAIL PROTECTED]> wrote: > somewhere before your SQLFORM(),a statement such as: > > cynotedb.comment.body.default='hello' > > will pre-populate. > > This should wo

[web2py:12859] Re: membership growth

2008-12-03 Thread 43gm
When I mention web2py to other python users, there is frequently confusion with web.py which is very unfortunate. When people scan their memories they go with the strongest associations first. Sometimes people seem to believe that web2py is the version 2.0 of web.py -- which is erroneous. Go on i

[web2py:12858] Re: redirection

2008-12-03 Thread pmate
Ciao Massimo, this is my update function in controller gestione.py: def update(): try: dbname=request.args[0] db=eval(dbname) table=request.args[1] except: response.flash=T('invalid request') redirect(URL(r=request,f='index')) try: id=in

[web2py:12857] Re: Dropbox based on a none unique column.

2008-12-03 Thread annet
Denes, Thanks for your thorough explanation. In my application I got another unsolved problem, probably you know how to solve it. In one of my views I have got a table in which one of the element reads like: {{=A(club.bedrijf.bedrijfsnaam,_href=URL (r=request,f='clubdetails',args =[club.bedri

[web2py:12856] Re: membership growth

2008-12-03 Thread Fran
+1 for Continued Advocacy - I think the Marketing around this product is part of it's excellence...it really helped me to give the project a serious try when seeing such clear, seemingly-impartial reasoning on why this project was seen to be a useful enhancement of previous framework learnings. I

[web2py:12855] Re: membership growth

2008-12-03 Thread Joe Barnhart
You don't "advertise" web2py. You "advocate" it. Advertising is done by companies to sell products -- and is generally paid for in some manner. Advocacy is done to bring attention to causes or movements. Web2py is more of a movement than a product, in my opinion. (OK, by some standards, maybe