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

2014-04-11 Thread anubhav joshi


On Friday, April 11, 2014 4:57:33 AM UTC+5:30, Gregor Müllegger wrote:
>
> 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
>

Thanks Gregor, but I think here we first need to make it clear do we really 
want it. 

-- 
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/969aae8e-9e07-4e58-96ab-5614436b919e%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-11 Thread Gregor Müllegger
Casting to strings would make this example work. But will break in other
cases:

dict((key, str(val)) for key, val in {'value': None}.items())
  => 

I don't want to say that this problem is impossible to solve without a "is"
check in the templates, I only want to point out that this basic comparison
that is very handy in python on many ocassions is not available in the
template. And having something like this in core might just make the
template language a bit rounder and nicer to use for pythonistas.

· Gregor ·


2014-04-11 7:44 GMT+02:00 Ł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'} =>  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.
>

-- 
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/CALjSGCNDMC1q7LhamQaf%3D9jEW0bXPn5gdpmDL88dVQgKsNb__Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Revisiting multiline tags

2014-04-11 Thread Curtis Maloney
Would it help if I said please?


On 4 April 2014 11:29, Curtis Maloney  wrote:

> Have any of you tested my code which gives you multi-line tags?
>
> I'd be interested in hearing how it fares "in the real world"
>
> --
> C
>
>
>
> On 4 April 2014 01:52, dude  wrote:
>
>> More useful example is not ‘very long with’, just a situation with html
>> code block, which have in left sir already offset about 60 cols. And when
>> we add there any django template tag with params it goes exceed 80 lines
>> (for standard). But we can use 120 of course. In real life html tree can be
>> very deep. Html tags can be multilines and this is awesome when you want
>> make deep tree good looking, but dj templates  not support it.
>>
>> If django can support multiline it would be great i think and community
>> will like this feature immediately.
>>
>> 03 апр. 2014 г., в 21:29, Daniel Ellis  написал(а):
>>
>> Hmm, that does seem like a great idea!
>>
>>
>> On Thu, Apr 3, 2014 at 10:17 AM, dude  wrote:
>>
>>> Very good idea i think!
>>>
>>> Many people love format source codes to be beauty. But they can’t
>>> because django templates does’t support multiline tags.
>>>
>>>
>>> 03 апр. 2014 г., в 21:13, Daniele Procida  написал(а):
>>>
>>> > On Thu, Apr 3, 2014, Carl  wrote:
>>> >
>>> >> As someone said earlier in the thread, making Python programmers deal
>>> with
>>> >> long lines seems like some special form of torture ;)
>>> >
>>> > My own use case is this:
>>> >
>>> > {% with placeholder_width=960 generic_main_width=523
>>> sidebar_image_size="294x196" entity_image_size="445x384"
>>> entity_map_size="445x100" person_map_size="445x100"
>>> sidebar_map_size="296x100" person_image_size="460x460"
>>> person_thumbnail_size="40x40" lightbox_max_dimension=600
>>> plugin_thumbnail_size="75x75" place_image_size="627x418"
>>> place_map_size="294x182" body_heading_level=2 %}
>>> >
>>> > Now that's very horrible to read.
>>> >
>>> > This would be much nicer:
>>> >
>>> > {% with
>>> >placeholder_width=960
>>> >generic_main_width=523
>>> >sidebar_image_size="294x196"
>>> >entity_image_size="445x384"
>>> >entity_map_size="445x100"
>>> >person_map_size="445x100"
>>> >sidebar_map_size="296x100"
>>> >person_image_size="460x460"
>>> >person_thumbnail_size="40x40"
>>> >lightbox_max_dimension=600
>>> >plugin_thumbnail_size="75x75"
>>> >place_image_size="627x418"
>>> >place_map_size="294x182"
>>> >body_heading_level=2
>>> > %}
>>> >
>>> > And yes, there is a good reason for wanting to use {% with %} in this
>>> way!
>>> >
>>> > Daniele
>>> >
>>> > --
>>> > 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/20140403141333.1946415207%40smtpauth.cf.ac.uk
>>> .
>>> > 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/CAJGew6%3Drht8nSrVibSpmpz%3DQK-cunjPHup6TBXvYAY6GPWXg3g%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/CAG_XiSBY4bg85wcHPsgW0JGUoadjz0KEKMzL%3DGNAno%3DTp6rHTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.