Hey Karlis;

This is a cool idea.  I don't do enough template work to always remember the
cycle syntax, but an odd/even is pretty simple to remember.

As for getting this into Django, check out the Contributing Docs[1].  It has
everything you need on how to help out.  In particular the Requesting New
Features[2] section will be of interest to you.  The first thing to do is
bring it up here on the list (like you've done) and see if others are
interested in adding it.  You might also want to include links to any code
that you've changed so other's can take a look at the code.

Hope this help,
-T

[1]: https://docs.djangoproject.com/en/dev/internals/contributing/
[2]:
https://docs.djangoproject.com/en/dev/internals/contributing/bugs-and-features/#requesting-features

On Mon, Sep 19, 2011 at 5:58 AM, skazhy <[email protected]> wrote:

> Hi all!
>
> I've been working with Django for a while now, but today I decided to
> make a first contribution to Django that would make templates less
> ugly by adding these two values to loop_dict (in django/template/
> defaulttags.py):
>
> loop_dict['even'] = (i %2 == 0)
> loop_dict['odd'] = (i %2 != 0)
>
> Using {% if forloop.even %} would be more clear and readable than {%
> if forloop|divisibleby:"2" %}.
> As I am new to working *on* Django I don't know the history of this
> idea (if there is one) and the correct way of sending patches, all
> comments (and corrections!) are appreciated!
>
>
> -Karlis Lauva /skazhy/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/django-developers?hl=en.
>
>


-- 
Travis Swicegood | @tswicegood (most everywhere) | Senior Open Source
Engineer @ Texas Tribune / Armstrong

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to