Re: Should there be a "is" comperator: {% if A is B %}?

2014-04-10 Thread Łukasz Rekucki
On 11 April 2014 01:11, Gregor Müllegger  wrote:
> Hi,
>
> thanks for your input. Unfortunatelly this would fail for int(0):

Not if you encode all values to strings before passing to the
template, so it's "0" instead of 0.

>
> {'value': 0} => 
>
> Gregor
>
>
> 2014-04-10 11:41 GMT+02:00 Tino de Bruijn :
>
>> Wouldn't this be easier?:
>>
>> {'required': "", 'name': 'fieldname'} => > />
>>
>> {% for name, value in attrs.items %} {{ name }}{% if value %}="{{ value
>> }}"{% endif %}{% endfor %}
>>
>>
>> Tino
>>

-- 
Łukasz Rekucki

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAEZs-EL%2BNqWuo-F6AkAWCBb5rn_7GKGXkfD35uyfF%2Bqbvss5Sw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: #22383 Add the HTML5 required tag to the input fields which are required for database entry

2014-04-10 Thread Gregor Müllegger
I think adding the `required` attribute but ignoring the other possible
html form validations (like `min` and `max` [1] for  that are used
by the forms.IntegerField) seems a bit half-hearted.

My opinion is that having the required attribute is pretty cool, but should
come with all other possible validations baked in then.
django-floppyforms already includes those validations already in the HTML
output of forms and it turns out to be quite useful in many situations.
Even if you turn of the browser validation by adding the novalidate
attribute to the  tag, it's good to have this meta data in the HTML
representation, e.g. for styling.

Gregor

[1]
https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation


2014-04-10 20:00 GMT+02:00 anubhav joshi :

>
>
> On Thursday, April 10, 2014 11:19:18 PM UTC+5:30, anubhav joshi wrote:
>>
>> A ticket has been opened asking to add HTML5 required tag in forms for
>> the fields which are required for database entry.
>>
>> Better wording:
> "required for database entry" --> fields have *required* attribute as
> *True*
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/f7f8a915-8cc4-4505-8bc3-770599afeb30%40googlegroups.com
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CALjSGCP3oS%2BmKRMs%3DJ%3D1z0R%2BcP7FNGfx%2B65%3DN9Pu44iJXkhVaw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Should there be a "is" comperator: {% if A is B %}?

2014-04-10 Thread Gregor Müllegger
Hi,

thanks for your input. Unfortunatelly this would fail for int(0):

{'value': 0} => 

Gregor


2014-04-10 11:41 GMT+02:00 Tino de Bruijn :

> Wouldn't this be easier?:
>
> {'required': "", 'name': 'fieldname'} =>  />
>
> {% for name, value in attrs.items %} {{ name }}{% if value %}="{{ value
> }}"{% endif %}{% endfor %}
>
>
> Tino
>
>
> On Wed, Apr 9, 2014 at 11:53 PM, Gregor Müllegger wrote:
>
>> Hi,
>>
>> I recently had the need to check for "value is not True" (as an identity
>> check, not
>> on equality) in django-floppyforms. The template should generate the HTML
>> attributes for an HTML element from a python dict, but leave out the
>> attribute
>> value if the dict's value is True. Like:
>>
>>   {'required': True, 'name': 'fieldname'} => > name="fieldname" />
>>
>> If there would be an "is" identity check in the Django template language
>> it
>> would look like:
>>
>> {% for name, value in attrs.items %} {{ name }}{% if value is not
>> True %}="{{ value }}"{% endif %}{% endfor %}
>>
>> But since there is none, the if case looks now like this:
>>
>> {% if value|stringformat:"s" != "True" or value != 1 %}
>>
>> See:
>> https://github.com/gregmuellegger/django-floppyforms/blob/master/floppyforms/templates/floppyforms/attrs.html
>>
>> The template previously checked with {% if not value %}, but that would
>> break if
>> you pass in the integer 1. Since "True == 1", but "True is not 1".
>>
>>
>> I do get why there is no "is" comperator in the DTL yet. It might be
>> confused
>> with the equality check by designers that don't know the underlying
>> concepts of
>> equality and identity. And I think that's totally reasonable.
>>
>> However I still want to bring this up since there is this real usecase I
>> described above. Ofcourse I could introduce a custom filter or tag to
>> scratch
>> that itch, but IMO this is something very fundamental that I would expect
>> to have
>> as a python developer.
>>
>> So here are a few solutions I can think of:
>>
>> 1. Have an "is" and "is not" comperator in the {% if %} tag. Could lead
>> to confusion.
>>
>> 2. Have a "===" and "!==" comperator in the {% if %} tag. This is
>> something nearer to
>>Javascript than python and makes it clear that it's different to ==
>> but would
>>still confuse someone who did't read the DTL documentation.
>>
>> 3. Have a "is_identical" builtin filter. So it would be {% if not
>> value|is_identical:True %}.
>>
>>
>> My favourite is option 3. It's very readable and doesn't introduce
>> possible
>> confusions for non-python programmers.
>>
>> What is your opinion on this?
>>
>>
>> Gregor
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-developers+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-developers@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-developers.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-developers/CALjSGCPsE3TTr2zzkUZboADpSOCymCue1HVC_SqB6mLMfpfwWA%40mail.gmail.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CANQFsQDXR7FcfdgaF4w6G_9uaS7e-W_Y7FnxG3%2BxFTR4h4n7OA%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CALjSGCOwL%3DvAD%2Bj3vRyNBFTjFOonHRzz9PebgSbBTuZsiQSERw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: #22383 Add the HTML5 required tag to the input fields which are required for database entry

2014-04-10 Thread anubhav joshi


On Thursday, April 10, 2014 11:19:18 PM UTC+5:30, anubhav joshi wrote:
>
> A ticket has been opened asking to add HTML5 required tag in forms for the 
> fields which are required for database entry.
>
> Better wording:
"required for database entry" --> fields have *required* attribute as *True*

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/f7f8a915-8cc4-4505-8bc3-770599afeb30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


#22383 Add the HTML5 required tag to the input fields which are required for database entry

2014-04-10 Thread anubhav joshi
A ticket has been opened asking to add HTML5 required tag in forms for the 
fields which are required for database entry.

There have been several issues:

   1. Is this new option going to stay or is it just transitional.
   2. Is it going to be an optional feature or default behaviour.
   3. Should we be using a proper deprecation strategy or make it default 
   on master as a backward-incompaible change as otherwise it will be of not 
   much use.
   4. The number of users wanting this may be quite a many.
   
Refs. #22383 

People involved in discussion uptil now on ticket on IRC or ticket: 
timograham, loic84, apollo13  and me.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/92e488c9-2a7d-41f9-8233-612b169d5d40%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Who manages the django-i18n mailing group?

2014-04-10 Thread Bruno Ribeiro da Silva
Hey folks,

Django now 100% translated to pt_BR.

Thanks for the help with transifex!


On Thu, Apr 10, 2014 at 9:58 AM, Bruno Ribeiro da Silva <
bruno.dev...@gmail.com> wrote:

> Thank you!
>
>
> On Thu, Apr 10, 2014 at 9:49 AM, Ramiro Morales  wrote:
>
>> On Thu, Apr 10, 2014 at 9:26 AM, Bruno Ribeiro da Silva
>>  wrote:
>> > Hi everyone,
>> >
>> > I'm trying to fix some translations in transifex but I'm waiting for 3
>> days
>> > since I requested to join the pt-br group.
>>
>> I've just accepted you there (with my Transifex the Django project admin
>> hat.)
>>
>>
>> --
>> Ramiro Morales
>> @ramiromorales
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-developers+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-developers@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-developers.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-developers/CAO7PdF_6rwNWFTh6rpJw9MzvFuCxMN5i5WVW0AHpbaa6eX8uOQ%40mail.gmail.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Bruno Ribeiro da Silva
> Python Dev and Homebrewer!
>



-- 
Bruno Ribeiro da Silva
Python Dev and Homebrewer!

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAE-2%3DJytFt780RvOfLY1OjUBcB08oJnX75A6oUU_SXX-0k81cg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Who manages the django-i18n mailing group?

2014-04-10 Thread Bruno Ribeiro da Silva
Thank you!


On Thu, Apr 10, 2014 at 9:49 AM, Ramiro Morales  wrote:

> On Thu, Apr 10, 2014 at 9:26 AM, Bruno Ribeiro da Silva
>  wrote:
> > Hi everyone,
> >
> > I'm trying to fix some translations in transifex but I'm waiting for 3
> days
> > since I requested to join the pt-br group.
>
> I've just accepted you there (with my Transifex the Django project admin
> hat.)
>
>
> --
> Ramiro Morales
> @ramiromorales
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CAO7PdF_6rwNWFTh6rpJw9MzvFuCxMN5i5WVW0AHpbaa6eX8uOQ%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Bruno Ribeiro da Silva
Python Dev and Homebrewer!

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAE-2%3DJyPU-WiyZJygrPwOdZ6OiJ%3DMTfYxCREFMJ2JQmJkYFW5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Who manages the django-i18n mailing group?

2014-04-10 Thread Ramiro Morales
On Thu, Apr 10, 2014 at 9:26 AM, Bruno Ribeiro da Silva
 wrote:
> Hi everyone,
>
> I'm trying to fix some translations in transifex but I'm waiting for 3 days
> since I requested to join the pt-br group.

I've just accepted you there (with my Transifex the Django project admin hat.)


-- 
Ramiro Morales
@ramiromorales

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAO7PdF_6rwNWFTh6rpJw9MzvFuCxMN5i5WVW0AHpbaa6eX8uOQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Who manages the django-i18n mailing group?

2014-04-10 Thread Bruno Ribeiro da Silva
Hi everyone,

I'm trying to fix some translations in transifex but I'm waiting for 3 days
since I requested to join the pt-br group. I already sent two messages to
django-i18n and none was approved. Looking at the list, the last message is
from Feb 24. Can someone give me some help here? I would like to do this
before the the window for translation closes.

Thanks!

-- 
Bruno Ribeiro da Silva
Python Dev and Homebrewer!

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAE-2%3DJwF00DAZGN%3DPOs%3Dspkax_5Mu8a-W9TS-Goa6QiaH_MQEw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: py2exe + Django 1.6

2014-04-10 Thread Ramiro Morales
On Thu, Apr 10, 2014 at 7:13 AM, Antonio Francisco Martín Romero
 wrote:
> Hi everyone,
>
> I was using py2exe + Django 1.3 without problems

This post doesn't belong to this list. django-dev is exclusively for
discussions about development _of_ Django.

Regards,

-- 
Ramiro Morales
@ramiromorales

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAO7PdF-_YsDzxhLbo7ZtRQCALWD0im%2BQs0YUU%2BF8oH-_Wj_3Xw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


py2exe + Django 1.6

2014-04-10 Thread Antonio Francisco Martín Romero
Hi everyone,

I was using py2exe + Django 1.3 without problems. From Django 1.4 the way 
to find the commands changed  and it tries to find .py files as you can see 
in the find_commands() function in the file core/management/__init__.py . 
When you compile Django using py2exe, your don't have .py files, just .pyc 
and manage.exe won't have any command. I have tried to modify the 
find_command() function but the result was negative. Also, I have tried to 
run commands manually but the functions try to find .py files as well.

Did anyone manage to do it?

Cheers


-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/98506afa-0514-414a-8285-f5692ac742a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Should there be a "is" comperator: {% if A is B %}?

2014-04-10 Thread Tino de Bruijn
Wouldn't this be easier?:

{'required': "", 'name': 'fieldname'} => 

{% for name, value in attrs.items %} {{ name }}{% if value %}="{{ value
}}"{% endif %}{% endfor %}


Tino


On Wed, Apr 9, 2014 at 11:53 PM, Gregor Müllegger wrote:

> Hi,
>
> I recently had the need to check for "value is not True" (as an identity
> check, not
> on equality) in django-floppyforms. The template should generate the HTML
> attributes for an HTML element from a python dict, but leave out the
> attribute
> value if the dict's value is True. Like:
>
>   {'required': True, 'name': 'fieldname'} =>  name="fieldname" />
>
> If there would be an "is" identity check in the Django template language it
> would look like:
>
> {% for name, value in attrs.items %} {{ name }}{% if value is not True
> %}="{{ value }}"{% endif %}{% endfor %}
>
> But since there is none, the if case looks now like this:
>
> {% if value|stringformat:"s" != "True" or value != 1 %}
>
> See:
> https://github.com/gregmuellegger/django-floppyforms/blob/master/floppyforms/templates/floppyforms/attrs.html
>
> The template previously checked with {% if not value %}, but that would
> break if
> you pass in the integer 1. Since "True == 1", but "True is not 1".
>
>
> I do get why there is no "is" comperator in the DTL yet. It might be
> confused
> with the equality check by designers that don't know the underlying
> concepts of
> equality and identity. And I think that's totally reasonable.
>
> However I still want to bring this up since there is this real usecase I
> described above. Ofcourse I could introduce a custom filter or tag to
> scratch
> that itch, but IMO this is something very fundamental that I would expect
> to have
> as a python developer.
>
> So here are a few solutions I can think of:
>
> 1. Have an "is" and "is not" comperator in the {% if %} tag. Could lead to
> confusion.
>
> 2. Have a "===" and "!==" comperator in the {% if %} tag. This is
> something nearer to
>Javascript than python and makes it clear that it's different to == but
> would
>still confuse someone who did't read the DTL documentation.
>
> 3. Have a "is_identical" builtin filter. So it would be {% if not
> value|is_identical:True %}.
>
>
> My favourite is option 3. It's very readable and doesn't introduce possible
> confusions for non-python programmers.
>
> What is your opinion on this?
>
>
> Gregor
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CALjSGCPsE3TTr2zzkUZboADpSOCymCue1HVC_SqB6mLMfpfwWA%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CANQFsQDXR7FcfdgaF4w6G_9uaS7e-W_Y7FnxG3%2BxFTR4h4n7OA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.