Login
Add a comment:

Coding Guidelines

Hungarian Notation

Hungarian Notation should only be used when it makes sense. In candiwi use the following conventions.

Url encoded strings

In order to fully support Unicode, variables used in links must be encoded. To distinguish url encoded strings from normal strings url encoded strings should begin with 'url_'

Template example
--------------------------------------------------------------------------------
{% with example_var|urlencode as url_example_var %}
    <a href="/link/with/{{ url_example_var }}/">{{ example_var }}</a>
{% endwith %}
--------------------------------------------------------------------------------
View example
--------------------------------------------------------------------------------
from django.http import HttpResponseRedirect
from django.utils.http import urlquote

def some_view(request):
    example_var = get_from_somewhere()
    url_example_var = urlquote(example_var)
    return HttpResponseRedirect('/link/with/' + url_example_var)
--------------------------------------------------------------------------------