horizon/HACKING.rst
Felipe Reyes af49cf1f15 Replace force_unicode with force_text
Django changed the name to force_unicode and it's only available in
python2 as an alias of force_text. The new name is available since
Django 1.4.2

Closes-Bug: #1345642
Change-Id: Ida8c545ceec7c31999f2497d540a0dc5a653d286
2014-08-06 14:34:53 +02:00

1.0 KiB

Horizon Style Commandments

  • Step 1: Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/

  • Step 2: The following names can be imported directly, without triggering the "H302: import only modules" flake8 warning:

    collections.defaultdict,
    django.conf.settings,
    django.core.urlresolvers.reverse,
    django.core.urlresolvers.reverse_lazy,
    django.template.loader.render_to_string,
    django.utils.datastructures.SortedDict,
    django.utils.encoding.force_text,
    django.utils.html.conditional_escape,
    django.utils.html.escape,
    django.utils.http.urlencode,
    django.utils.safestring.mark_safe,
    django.utils.translation.pgettext_lazy,
    django.utils.translation.ugettext_lazy,
    django.utils.translation.ungettext_lazy,
    operator.attrgetter,
    StringIO.StringIO
  • Step 3: Read on

Horizon Specific Commandments