[web2py] How do I do complex validation?

2011-03-05 Thread Jason Brower
Is there a way in the model file to set a bit more complex set-ups? It is in the book? For examples I have: user_role.id http://127.0.0.1:8000/InterestID3/appadmin/select/db?orderby=user_role.id user_role.user_id http://127.0.0.1:8000/InterestID3/appadmin/select/db?orderby=user_role.user_id

[web2py] Type of computed fields.

2011-03-05 Thread imm
Hi, I'm using Version 1.91.6 (2011-01-03 17:55:14) and I'm find this behaviour with computed fields. Is correct, is the type of a computed field always a string? Example: *Define a table with a computed field:* db.define_table('entries', Field

[web2py] Recaptcha (....,, comment='')

2011-03-05 Thread Martin Weissenboeck
Again... Maybe there should be an additional formal parameter in /gluon/tools.py for Recaptcha.__init__ def __init__ (... comment = '' ): and line 619 should be self.comment = comment Regard, Martin

[web2py] Translation of error_messages for IS_INT_IN_RANGE and similar classes

2011-03-05 Thread Martin Weissenboeck
Some weeks ago there has been a discussion about this problem, but I did not find any solution in the new version 1.93.2 Therefore: may I repeat a proposal? From the description of /gluon/validators.py: Built-in validators have constructors that take the optional argument error message

[web2py] Re: Error in templating system

2011-03-05 Thread szimszon
I thought that after the = I could only write one string/variable/ function with string output which is wrapped in write... Anything else I could put in non-python block... Never mind. I can live with what you choose as solution :) Just I say it was working before :-o I will stay with web2py

[web2py] customize error messages

2011-03-05 Thread LightOfMooN
Hello I can customize some error messages like this: IS_NOT_IN_DB(db, custom_auth_table.email, error_message=T('email already used'))] But how can I customise error messages if there are more than 1 error message? For example:

[web2py] Vertical superfish menu doesn't work well, how about yours?

2011-03-05 Thread Iceberg
Hi there, I stayed with web2py 1.79 for quite some time, and am now keeping up with 1.92, oh, and latest 1.93. Lots of improvements. Wow. One minor, minor problem so far. When I try to use the new superfish menu system to produce a vertical menu, I found the menu can show up BUT, the first level

[web2py] Re: mssql, login problems

2011-03-05 Thread Stef Mientki
As it doesn't seem possible to change self._uri in SQLDB, I solved the problem by adding an extra keyword argument (which travels to SQLDB): Database_Name = r'mssql://NKCV2 *MSSQL_Login = ';UID=MY_SQL_LOGIN;PWD=MY_PASSWORD' *My_DB = DAL ( Database_Name, folder = folder, *MSSQL_Login

Re: [web2py] Re: DAL new syntax RFC

2011-03-05 Thread Phyo Arkar
Field(':name') and Field('.name') Is very hard to read. Especially : Field('.name') . When writing large applications with many lines of codes , . is very very hard to read. On 3/5/11, Luther Goh Lu Feng elf...@yahoo.com wrote: I too like the 'default' syntax much better than the new one. It

[web2py] Re: Weird self submitting forms all checkbox is checked after submit

2011-03-05 Thread szimszon
With the new 1.93.2 there is no issue... :) On márc. 4, 15:29, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Which web2py version? I cannnot reproduce it? If latest, can you post some code to reproduce it? On Mar 4, 6:12 am, szimszon szims...@gmail.com wrote: If I Submit form

[web2py] is there a function to increase a sql field

2011-03-05 Thread zhao peng
Hi, I want to know is there a function to add 1 to a sql field, or else I have to select to get the value of the field and then add 1 to the value, then update the field. Thanks.

[web2py] Little bug in admin/.../edit.html

2011-03-05 Thread Milan Melena
Symptom: when you save controller content, then disapears list of available views in gray box. 1.1 --- a/applications/admin/views/default/edit.html Fri Mar 04 17:46:21 2011 -0600 1.2 +++ b/applications/admin/views/default/edit.html Sat Mar 05 16:09:19 2011 +0100 1.3 @@

Re: [web2py] Translation of error_messages for IS_INT_IN_RANGE and similar classes

2011-03-05 Thread Jonathan Lundell
On Mar 5, 2011, at 4:01 AM, Martin Weissenboeck wrote: This solution is not very beautiful, because I have to repeat the string 'fill this', but it works. It does not work for classes like IS_INT_IN_RANGE, because there is a lot of error messages, depending on the values: if

Re: [web2py] customize error messages

2011-03-05 Thread Jonathan Lundell
On Mar 5, 2011, at 4:18 AM, LightOfMooN wrote: I can customize some error messages like this: IS_NOT_IN_DB(db, custom_auth_table.email, error_message=T('email already used'))] But how can I customise error messages if there are more than 1 error message? For example:

Re: [web2py] How do I do complex validation?

2011-03-05 Thread Kenneth Lundström
I´d say you have to create your own validator so achive that. Kenneth Is there a way in the model file to set a bit more complex set-ups? It is in the book? For examples I have: user_role.id http://127.0.0.1:8000/InterestID3/appadmin/select/db?orderby=user_role.id user_role.user_id

[web2py] Re: One form for multiple tables

2011-03-05 Thread annet
Hi Denes, I believe you want something like this: That's exactly what I wanted, thanks! Kind regards, Annet.

[web2py] Re: Multiple form flash problem.

2011-03-05 Thread annet
Denes and Jonathan, Thank you both for your replies, now I do understand the logic of the function. @Denes, So, in Python you can only simulate a CASE statement using if's? Could you provide me with an example? Kind regards, Annet

Re: [web2py] Re: Multiple form flash problem.

2011-03-05 Thread Jonathan Lundell
On Mar 5, 2011, at 8:44 AM, annet wrote: So, in Python you can only simulate a CASE statement using if's? Could you provide me with an example? The first reply here is useful:

Re: [web2py] is there a function to increase a sql field

2011-03-05 Thread Vasile Ermicioi
update tabl1 set field1=field1+1 where your_condition db(some dal condtion like: db.table1.id0).update(field1=db.table1.field1+1)

Re: [web2py] is there a function to increase a sql field

2011-03-05 Thread zhao peng
Thanks a lot. It works. On Sun, Mar 6, 2011 at 1:13 AM, Vasile Ermicioi elff...@gmail.com wrote: update tabl1 set field1=field1+1 where your_condition db(some dal condtion like: db.table1.id0).update(field1=db.table1.field1+1)

Re: [web2py] How do I do complex validation?

2011-03-05 Thread pbreit
Check here: http://web2py.com/book/default/chapter/07#Custom-Validators

Re: [web2py] Re: DAL new syntax RFC

2011-03-05 Thread pbreit
Obviously those of us who don't like it don't have to use it but I fear it going into documentation and leading to confusion. This is where I like one of the zens: There should be one-- and preferably only one --obvious way to do it.

[web2py] Re: Error in templating system

2011-03-05 Thread pbreit
There was also a suggestion that the space before the = might have been an issue: {{ =XML(msg)}} Is that space in there on purpose or by accident?

[web2py] Re: DAL new syntax RFC

2011-03-05 Thread Stefaan Himpe
think of a dot a False. Two does r and w are false, one dot and only w is false. IMHO: It's very short to write, but nearly impossible to guess its meaning. Wouldn't Field('readonly:name') and Field('invisible:name') be more readable ?

Re: [web2py] Re: Error in templating system

2011-03-05 Thread Jonathan Lundell
On Mar 5, 2011, at 11:18 AM, pbreit wrote: There was also a suggestion that the space before the = might have been an issue: {{ =XML(msg)}} Is that space in there on purpose or by accident? Leading spaces get stripped (between {{ and =), so that wasn't relevant (in this case).

[web2py] Re: web2py still unable to create application on WebFaction

2011-03-05 Thread JoeCodeswell
Dear Christopher and All, Something like you, Christopher, suggested was also suggested by the Webfaction Support folks. This suggestion worked for me, after I had investigated some other possibilities. You can read my blog post on this subject, Fixing my my web2py is unable to create a new

[web2py] Re: Vertical superfish menu doesn't work well, how about yours?

2011-03-05 Thread Iceberg
On Mar 6, 3:11 am, pbreit pbreitenb...@gmail.com wrote: That might be tricky to troubleshoot. It may have to do with a conflicting CSS style. Have you used the Inspect Element in Google Chrome? Is Item 1 the problem? Can you see anything unusual in the style list on the right? I included a

Re: [web2py] Re: web2py still unable to create application on WebFaction

2011-03-05 Thread Jonathan Lundell
On Mar 5, 2011, at 11:35 AM, JoeCodeswell wrote: Something like you, Christopher, suggested was also suggested by the Webfaction Support folks. This suggestion worked for me, after I had investigated some other possibilities. You can read my blog post on this subject, Fixing my my web2py

[web2py] Re: Bugfix for CheckboxesWidget

2011-03-05 Thread Iceberg
On Jan 31, 7:58 am, Bernd Rothert roth...@googlemail.com wrote: This patch fixes the CheckboxesWidget as a replacement for the MultipleOptionsWidget in list:reference fields. list:reference fields use the IS_IN_DB(...,multiple=True) validator. Its options() method returns possible choices a

[web2py] Re: Error in templating system

2011-03-05 Thread szimszon
It was on purbose. On márc. 5, 20:18, pbreit pbreitenb...@gmail.com wrote: There was also a suggestion that the space before the = might have been an issue: {{ =XML(msg)}}  Is that space in there on purpose or by accident?

Re: [web2py] Re: Error in templating system

2011-03-05 Thread Jonathan Lundell
On Mar 5, 2011, at 12:16 PM, szimszon wrote: It was on purbose. If so, it has only a cosmetic effect; the parser strips the spaces. On márc. 5, 20:18, pbreit pbreitenb...@gmail.com wrote: There was also a suggestion that the space before the = might have been an issue: {{ =XML(msg)}} Is

[web2py] Re: DAL new syntax RFC

2011-03-05 Thread Vidul Petrov
I agree with Stefaan. However the ':' before a variable name notation looks like the Ruby symbols whose only purpose was improved performance (lightweight strings) but lead inevitably to confusion (IMHO). On Mar 4, 5:55 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: There are some new

[web2py] Just a typo in change log.

2011-03-05 Thread luismurciano
In the change log page http://www.web2py.com/examples/default/changelog the version should be 1.93.1-2 instead 1.63.1-2 i guess. btw I think the last changes should be shown first so I dont have to scrolldown all the page :P

Re: [web2py] Re: web2py still unable to create application on WebFaction

2011-03-05 Thread Jonathan Lundell
On Mar 5, 2011, at 12:07 PM, Jonathan Lundell wrote: On Mar 5, 2011, at 11:35 AM, JoeCodeswell wrote: Something like you, Christopher, suggested was also suggested by the Webfaction Support folks. This suggestion worked for me, after I had investigated some other possibilities. You can

[web2py] Re: Vertical superfish menu doesn't work well, how about yours?

2011-03-05 Thread luismurciano
Hello Iceberg,I had the same issue just few hours ago, the problem is that superfish-vertical.css is applied before superfish.css when you use response.files.append() and overwrites some css styles. One solution could be editing the /view/layout.html adding the superfish-vertical.css after. In 43

[web2py] Hiding default error messages, Part 2

2011-03-05 Thread Chris
Hi all, I recently had to deal with a very similar situation to: http://groups.google.com/group/web2py/browse_thread/thread/ad5a9494c4bb06fb/f88a913ee7514197?lnk=gstq=custom+forms#f88a913ee7514197 -- The original message: I still seem to be missing something. Must

[web2py] Re: Multiple form flash problem.

2011-03-05 Thread villas
Hi Annet, It wasn't obvious to me why you needed two forms. Why not use one and test to see what has been filled in? Just another idea. Regards, David On Mar 5, 4:44 pm, annet annet.verm...@gmail.com wrote: Denes and Jonathan, Thank you both for your replies, now I do understand the logic of

Re: [web2py] Re: DAL new syntax RFC

2011-03-05 Thread Thadeus Burgess
Explicit is better than implicit. Typing is cheap. Design is the hardest part of development. -- Thadeus On Sat, Mar 5, 2011 at 2:52 PM, Vidul Petrov vidul.r...@gmail.com wrote: I agree with Stefaan. However the ':' before a variable name notation looks like the Ruby symbols whose only

Re: [web2py] Re: Error in templating system

2011-03-05 Thread Thadeus Burgess
Ok, when put into this context I agree, it should be fixed. It should all behave the same. -- Thadeus On Fri, Mar 4, 2011 at 8:22 PM, Jonathan Lundell jlund...@pobox.com wrote: s a strange set of rules, if you ask me. And confusing, as we've already seen, especially since the error message

Re: [web2py] Re: DAL new syntax RFC

2011-03-05 Thread Michele Comitini
+1 2011/3/6 Thadeus Burgess thade...@thadeusb.com: Explicit is better than implicit. Typing is cheap. Design is the hardest part of development. -- Thadeus On Sat, Mar 5, 2011 at 2:52 PM, Vidul Petrov vidul.r...@gmail.com wrote: I agree with Stefaan. However the ':' before a

[web2py] explanation of corrections in version 1.93.2

2011-03-05 Thread Ovidio Marinho
File read-me 193.2 ## 1.63.1-2 - This and an error? correct 1.93.2?? - support for multiple interfaces, thanks Jonathan What is This??? - jquery 1.5.1 - simplejson 2.1.3 - customizable simplejson - leaner app.yaml - css3 buttons in welcome - What is This??? - android support (experimental) What

[web2py] invalid request

2011-03-05 Thread I4py
i have to comunicate beetwen 2 files with url. for example *http://127.0.0.1/myapp/default/page * ... *http://127.0.0.1myapp/default/page?q=abcdefg* a dont have page?q=abcdefg file so web2py shows me invalid request. how can i solve this problem? i'm a litle noob in web2py and english,sry

Re: [web2py] Re: Error in templating system

2011-03-05 Thread Jonathan Lundell
On Mar 5, 2011, at 4:38 PM, Thadeus Burgess wrote: Ok, when put into this context I agree, it should be fixed. It should all behave the same. I'll create some more unit tests to expose the current behavior and then remove the special case. In the meantime, the workaround is to observe this

[web2py] How to make a simple counter

2011-03-05 Thread minux
Hi guys, I am pretty new to web2py and really enjoy learning this neat framework. However, I've just encountered a problem, while trying to developing a simple image gallery. I want to put a simple counter under each image, but could not figure out how to do so. Here are the relevant code

[web2py] error when insert record in appadmin

2011-03-05 Thread Joaquin Orbe
Hi all, I have a strange behaviour in appadmin trying to insert a record. It happens with all my tables except for auth's (auth_user, auth_group, etc). This is the error message: class 'pyodbc.ProgrammingError'(('42000', [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax

[web2py] web2py applications and apache vhosts

2011-03-05 Thread Haros
Hello guys, I know that this question has been posted a couple of times in this group but it seems that there is no answer yet... I have web2py installed with apache via wsgi. Everything works fine. Instead of having multiple web2py instances, I want each domain to point to a different

[web2py] Re: Type of computed fields.

2011-03-05 Thread DenesL
I can't reproduce this with 1.91.6 nor 1.92.1, both show r.f3 as int. On Mar 5, 4:19 am, imm ianmm...@googlemail.com wrote: Hi, I'm using Version 1.91.6 (2011-01-03 17:55:14) and I'm find this behaviour with computed fields. Is correct, is the type of a computed field always a string?

Re: [web2py] explanation of corrections in version 1.93.2

2011-03-05 Thread Bruno Barbosa
Ovidio, Para definir writable e readable fazemos o seguinte: db.define_table('tabela', Field('nome'), Field('idade')) db.tabela.nome.writable=db.tabela.nome.readable = False O Massimo falou que estava cansado de ter que escrever toda vez writable... readable

[web2py] Re: error when insert record in appadmin

2011-03-05 Thread Joaquin Orbe
Update: I've tried SQLite and it's the same problem: class 'sqlite3.OperationalError'(near ): syntax error) locals query : 'INSERT INTO my_table() VALUES ();' Any kind of help will be appreciated. Joaquin. On Sat, Mar 5, 2011 at 3:09 PM, Joaquin Orbe joaquino...@gmail.com wrote: Hi all,

[web2py] Re: How to make a simple counter

2011-03-05 Thread pbreit
Wow, hard to say but you definitely have some problems. For example, the typo in visits.viist(+=1). Are you getting error messages or is it just not doing what you want? Something like this perhaps? This code only adds one line to what is shown in the Book:

[web2py] Difference between IS_HTTP_URL and IS_URL?

2011-03-05 Thread Chris
Is there a substantive difference between IS_HTTP_URL and IS_URL?

Re: [web2py] Difference between IS_HTTP_URL and IS_URL?

2011-03-05 Thread Jonathan Lundell
On Mar 5, 2011, at 10:09 PM, Chris wrote: Is there a substantive difference between IS_HTTP_URL and IS_URL? IS_URL is a front end to IS_HTTP_URL or IS_GENERIC_URL, and also handles unicode input.

[web2py] Re: Vertical superfish menu doesn't work well, how about yours?

2011-03-05 Thread Iceberg
On Mar 6, 5:51 am, luismurciano luismurci...@gmail.com wrote: Hello Iceberg,I had the same issue just few hours ago, the problem is that superfish-vertical.css is applied before superfish.css when you use response.files.append() and overwrites some css styles. One solution could be editing the

[web2py] Re: Little bug in admin/.../edit.html

2011-03-05 Thread Massimo Di Pierro
Hi Milan, can you please email me the patch as an attachment? On Mar 5, 9:25 am, Milan Melena milan.mel...@gmail.com wrote: Symptom: when you save controller content, then disapears list of available views in gray box.      1.1 --- a/applications/admin/views/default/edit.html       Fri Mar 04

[web2py] Re: Just a typo in change log.

2011-03-05 Thread Massimo Di Pierro
Can you help us please? Download the README file from web2py/ and reorder the items. On Mar 5, 2:54 pm, luismurciano luismurci...@gmail.com wrote: In the change log pagehttp://www.web2py.com/examples/default/changelog the version should be 1.93.1-2 instead 1.63.1-2 i guess. btw I think the

[web2py] Re: DAL new syntax RFC

2011-03-05 Thread Massimo Di Pierro
OK, I will probably take it off... do not count on this feature being backward compatible, yes I need to sleep on it some more. On Mar 5, 6:49 pm, Michele Comitini michele.comit...@gmail.com wrote: +1 2011/3/6 Thadeus Burgess thade...@thadeusb.com: Explicit is better than implicit.

[web2py] boolean type in MySQL: CHAR(1) vs TINYINT(1)

2011-03-05 Thread Kevin Ivarsen
I'm connecting to a legacy MySQL database (migrate=False) with a lot of fields declared BOOLEAN, and noticed that attempts to modify these fields with the DAL failed. The DAL issues a query like this: UPDATE sometable SET someflag='T' WHERE ... but this gets rejected by MySQL. Reading through

[web2py] Version typo in latest changelog

2011-03-05 Thread Kevin Ivarsen
The latest changelog entry has a small typo: the version is listed as 1.63.1-2, but I believe it should be 1.93.1-2. http://web2py.com/examples/default/changelog Hopefully this is the appropriate place to report that sort of thing. Cheers, Kevin

Re: [web2py] Translation of error_messages for IS_INT_IN_RANGE and similar classes

2011-03-05 Thread Martin Weissenboeck
Ok, compatibility is a reason I understand. You are right: if I make a decision, which error message would be appropriate for each single field it works fine. If there is a lot of fields with IS_INT_IN_RANGE requirements like T('enter an integer between %(min)g and %(max)g') I will use an