Re: [web2py] Re: testers needed

2010-03-13 Thread KONTRA, Gergely
Here is it: ps: is not there an easier way to suggest changes to the codes, than creating a new project on googlecode, and commit changes to that branch, and after the patch is accepted, delete the branch, and then for the next typo again, and again... Is not that possible, that everyone can comm

Re: [web2py:38226] Re: django and web2py

2010-01-02 Thread KONTRA, Gergely
>> > On Jan 1, 9:48 am, pihentagy wrote: >> > The sytnax is Field(name, type). The default type is a string. If you >> > want it to be a reference it has to said explicitly. You do the same >> > in Django. The validator is optional and, in fact, since 1.74 you get >> > that validator by default if

Re: [web2py:38235] Re: django and web2py

2010-01-02 Thread KONTRA, Gergely
> Please never assume that something that is not done by default cannot > be done. > > db.whatever.partner.requires.zero="Please Select One" Again, where can I find info about the zero argument? It is mentioned at http://www.web2py.com/examples/static/epydoc/web2py.gluon.validators.IS_IN_DB-class

Re: [web2py:38449] Re: represent

2010-01-06 Thread KONTRA, Gergely
And do tables have represent? if I specify a format string in define_table, isn't it a shortcut to setting the represent attr of the table? On Wed, Jan 6, 2010 at 01:54, mdipierro wrote: > Sorry. I am not sure I understand the question. > > This is not a valid expression: > >   db.post.widget =

[web2py] Re: [web2py:38455] Re: represent

2010-01-07 Thread KONTRA, Gergely
Yes, AFAIK appadmin is a T2 thing. So, I wonder how can one rewrite the line below using db.post.represent (still that is more flexible) db.define_table('post', Field('title',length=256), Field('body','text',requires=IS_NOT_EMPTY()), Field('author',db.auth_user), format='%(title)s

Re: [web2py] Re: represent

2010-01-07 Thread KONTRA, Gergely
deprecated long ago. > > I guess you can still define db.post.represent but I am not sure what > do you want to do with it. What behavior do you expect? Can you > provide a concrete example? > > > On Jan 7, 9:31 am, "KONTRA, Gergely" wrote: >> Yes, AFAIK appadm

Re: [web2py] Re: represent

2010-01-08 Thread KONTRA, Gergely
st',db.post,writable=False,readable=False), >    Field('author',db.auth_user,writable=False,readable=False), >    Field('body','text',requires=IS_NOT_EMPTY())) > > ### modify an internal of the validator to > ### fetch data required to compute the vi

Re: [web2py] Re: represent

2010-01-08 Thread KONTRA, Gergely
onvoluted but it allows you to create an > arbitrary representation and specify exactly which fields you need. > > By using represent you are passing a (lambda) function. How would > web2py determine which columns to fetch? Should it fetch them all? It > could be slow. > > Massimo &g

Re: [web2py] Re: represent

2010-01-08 Thread KONTRA, Gergely
(and makes sense) is a simpler syntax for > merging format with virtualfields. I think if we do this we must do it > well and it is not a minor change. > > Massimo > > On Jan 8, 6:42 am, "KONTRA, Gergely" wrote: >> Well, then let the function accepts not a row, but

[web2py] validators, form validation

2010-01-11 Thread KONTRA, Gergely
Hi! I have a status "enumeration" for a status in one of my tables. I'd like to store it, as an integer, and access it with constants. Where should I define these constants (I guess I should in db.py), and how can I access them in the controller? And some random things about validators: date valid

[web2py] Re: validators, form validation

2010-01-11 Thread KONTRA, Gergely
   | |   | +- "Olyan lángész vagyok, hogy poroltóval kellene járnom!" -+ On Mon, Jan 11, 2010 at 13:13, KONTRA, Gergely wrote: > Hi! > I have a status "enumeration" for a status in one of my tables. I'd > like to store it, as an integer, a

Re: [web2py] Re: validators, form validation

2010-01-14 Thread KONTRA, Gergely
I cloned web2py and write 2 functions for that http://code.google.com/r/pihentagy-web2py/source/list You can use those classes like that: Field('invoice_date','date', requires=IS_DATE_IN_RANGE(minimum=datetime.date.today(), format='%d/%m/%Y')), Field('settlement_date','datetime', requires=

[web2py] doc fix

2010-01-24 Thread KONTRA, Gergely
Hi! Please have a look at http://code.google.com/r/pihentagy-web2py/source/detail?r=f503c69dee738ebb332e6d25f89328d6910b853f http://code.google.com/r/pihentagy-web2py/source/detail?r=230fbcc1f488864f868e7dd00e4d9c8b7b41bee3 I am a newbie to mercurial, but how these small bugfixes can go into web2

Re: [web2py] Re: wrong decisions and backward compatibility

2010-02-08 Thread KONTRA, Gergely
Hi! Yes, I must admit it, that a validator like IS_UPPER(), which checks only whether the input is uppercase is less useful, than an another, which actually converts to uppercase. OTOH if you haven't used the function, you expect the former. +-[ Gergely Kontra  ]--+ |

[web2py] validators, min and max

2010-02-08 Thread KONTRA, Gergely
Hi! I found another inconsistency in validators: IS_INT_IN_RANGE: IS_INT_IN_RANGE(0,10) does not accepts 10. Yes, this is in the docs, but using using args minimum and maximum, how would one know, that it includes the start/end point? Similarly, IS_LENGTH, IS_DECIMAL_IN_RANGE and so on...? OTO

Re: [web2py] Re: validators, min and max

2010-02-08 Thread KONTRA, Gergely
>> And does it makes sense to make all min and max values optional, so >> you can have: enter an integer, which is larger than 2 (witout upper >> limit)? > Having had the need recently, I would like to see: > IS_INT_IN_RANGE(1) # any integer>0 (up to sys.maxint) > IS_INT_IN_RANGE(max=10) # any inte