librelist archives

« back to archive

flask jinja and wtforms

flask jinja and wtforms

From:
Apostolos Kechagias
Date:
2013-01-14 @ 17:48
Hi,

I am experiencing an issue using jinja templates and wtforms. I want to add*
*form validation capabilities using js with this lib(
http://reactiveraven.github.com/jqBootstrapValidation/) as I use bootstrap
framework.
The problem is that I want to add attribute

data-validation-match-match="password"

in this line of code

{{ form.confirm(class_="input-block-level", placeholder="Confirm password",
required="", data-validation-match-match="password") }}

Any ideas?

Re: [flask] flask jinja and wtforms

From:
Robert Hanacek
Date:
2013-01-14 @ 18:00
Should the attribute be data-validation-matches-match="password"?

On Mon, Jan 14, 2013 at 11:48 AM, Apostolos Kechagias <apkech@gmail.com>wrote:

> Hi,
>
> I am experiencing an issue using jinja templates and wtforms. I want to add
> * *form validation capabilities using js with this lib(
> http://reactiveraven.github.com/jqBootstrapValidation/) as I use
> bootstrap framework.
> The problem is that I want to add attribute
>
> data-validation-match-match="password"
>
> in this line of code
>
> {{ form.confirm(class_="input-block-level", placeholder="Confirm
> password", required="", data-validation-match-match="password") }}
>
> Any ideas?
>
>


-- 

Robert Hanacek

Programmer | IdeaLoop, LLC
479.200.3564 | robert@idea-loop.com| www.idea-loop.com

Re: [flask] flask jinja and wtforms

From:
Apostolos Kechagias
Date:
2013-01-14 @ 18:17
Yes it should.

On Mon, Jan 14, 2013 at 8:00 PM, Robert Hanacek <robert@idea-loop.com>wrote:

> Should the attribute be data-validation-matches-match="password"?
>
>
> On Mon, Jan 14, 2013 at 11:48 AM, Apostolos Kechagias <apkech@gmail.com>wrote:
>
>> Hi,
>>
>> I am experiencing an issue using jinja templates and wtforms. I want to
>> add* *form validation capabilities using js with this lib(
>> http://reactiveraven.github.com/jqBootstrapValidation/) as I use
>> bootstrap framework.
>> The problem is that I want to add attribute
>>
>> data-validation-match-match="password"
>>
>> in this line of code
>>
>> {{ form.confirm(class_="input-block-level", placeholder="Confirm
>> password", required="", data-validation-match-match="password") }}
>>
>> Any ideas?
>>
>>
>
>
> --
>
> Robert Hanacek
>
> Programmer | IdeaLoop, LLC
> 479.200.3564 | robert@idea-loop.com| www.idea-loop.com
>

Re: [flask] flask jinja and wtforms

From:
Jesse Dubay
Date:
2013-01-14 @ 18:30
If you want to get something that isn't a valid Python identifier into
the kwargs of a call, you can use the unpacking operator:

    {{ form.confirm(..., **{'data-validation-matches-match': 'password'}) }}

Jesse

On Mon, Jan 14, 2013 at 10:17 AM, Apostolos Kechagias <apkech@gmail.com> wrote:
> Yes it should.
>
>
> On Mon, Jan 14, 2013 at 8:00 PM, Robert Hanacek <robert@idea-loop.com>
> wrote:
>>
>> Should the attribute be data-validation-matches-match="password"?
>>
>>
>> On Mon, Jan 14, 2013 at 11:48 AM, Apostolos Kechagias <apkech@gmail.com>
>> wrote:
>>>
>>> Hi,
>>>
>>> I am experiencing an issue using jinja templates and wtforms. I want to
>>> add form validation capabilities using js with this
>>> lib(http://reactiveraven.github.com/jqBootstrapValidation/) as I use
>>> bootstrap framework.
>>> The problem is that I want to add attribute
>>>
>>> data-validation-match-match="password"
>>>
>>> in this line of code
>>>
>>> {{ form.confirm(class_="input-block-level", placeholder="Confirm
>>> password", required="", data-validation-match-match="password") }}
>>>
>>> Any ideas?
>>>
>>
>>
>>
>> --
>>
>> Robert Hanacek
>>
>> Programmer | IdeaLoop, LLC
>> 479.200.3564 | robert@idea-loop.com| www.idea-loop.com
>
>