formencode.FancyValidator

2010-02-04 Thread gazza
Hello, I am trying to find a simple example to create a bespoke validator. Could you somebody be so kind and point me to an article to accomplish this in pylons? Much appreciated, Garyc -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To post

Re: formencode.FancyValidator

2010-02-04 Thread Graham Higgins
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 4 Feb 2010, at 15:41, gazza wrote: I am trying to find a simple example to create a bespoke validator. Could you somebody be so kind and point me to an article to accomplish this in pylons? Not an article but a few examples, FWTW (some

Re: difference between use c. or extra_vars to pass variables to templates

2010-02-04 Thread Mike Orr
On Thu, Feb 4, 2010 at 1:32 AM, Haron Media i...@haronmedia.com wrote: On 02/04/2010 08:02 AM, Mike Orr wrote: It does, but the speed of that is imperceptible. Reading the template from disk is a thousand times slower. But with Mako the templates are compiled as Python code, hence loaded

Re: HEAD requests

2010-02-04 Thread Mike Burrows
The PUT/POST translation is done in routes.middleware and I've tried putting the HEAD/GET translation there too. Two diffs below - a short one that fixes route matching for HEAD requests but reverts the method to GET (using existing code) before passing the request on to the app, and a longer

Re: formencode.FancyValidator

2010-02-04 Thread gazza
Much appreciated Graham, I will have a gander. Cheers, Garyc On Feb 4, 10:05 am, Graham Higgins gjhigg...@gmail.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 4 Feb 2010, at 15:41, gazza wrote: I am trying to find a simple example to create a bespoke validator. Could you

Re: Do your models handle all the data logic?

2010-02-04 Thread Jonathan Vanasco
On Feb 3, 12:28 pm, Haron Media i...@haronmedia.com wrote: But if you have the constraints, you're doing the checks twice. First from your application, and then the db engine does it anyways since there are constraints. Perhaps you don't have a performance hit, but I can assure you, if you

Re: formencode.FancyValidator

2010-02-04 Thread gazza
Hello, I am having a problem understanding how I can pass multiple values at once to the fancy validator i.e month and day class fooFancyValidator(formencode.FancyValidator): messages = { 'invaliddate' : _(Please select a valid date) } def

Re: HEAD requests

2010-02-04 Thread Mike Orr
I thought that the purpose of HEAD was to tell whether a resource had changed, and that it had effectively been made obsolete by If-Modified-Since and Etag. I suppose you could use HEAD to see if the resource exists or you have permission to view it, but I don't know of anybody that does that. In

Re: HEAD requests

2010-02-04 Thread Paweł Stradomski
W liście Mike Orr z dnia czwartek 04 lutego 2010: I thought that the purpose of HEAD was to tell whether a resource had changed, and that it had effectively been made obsolete by If-Modified-Since and Etag. I suppose you could use HEAD to see if the resource exists or you have permission to

Re: formencode.FancyValidator

2010-02-04 Thread gazza
Hello, I guess what I am trying to say is how do you pass multiple values from a form at the same time to a FancyValidator class? Essentially I would like to pass two values that entered in the form and both are required for validation. Any help on this would be appreciated. I see good example

Re: formencode.FancyValidator

2010-02-04 Thread Ian Wilson
I think this is what you are looking for. Two values are pulled from the field_dict. http://bitbucket.org/gjhiggins/shabti/src/tip/shabti/templates/authplus/+package+/forms/validators/validlogin.py_tmpl You might need to put this validator in chained_validators. On Thu, Feb 4, 2010 at 3:09 PM,

Re: HEAD requests

2010-02-04 Thread Mike Burrows
Thanks. In no particular order: * I guess HEAD has been neglected since conditional-GET got popular (and the latter is very useful, just not in my particular case here). * My client falls back to GET if the HEAD fails, just like Pawel's example appears to have done. * A change to Paste (or