Changeset 3076
- Timestamp:
- 06/03/06 19:58:39 (3 years ago)
- Files:
-
- django/trunk/django/contrib/humanize (added)
- django/trunk/django/contrib/humanize/__init__.py (added)
- django/trunk/django/contrib/humanize/templatetags (added)
- django/trunk/django/contrib/humanize/templatetags/humanize.py (added)
- django/trunk/django/contrib/humanize/templatetags/__init__.py (added)
- django/trunk/docs/add_ons.txt (modified) (1 diff)
- django/trunk/docs/templates.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/docs/add_ons.txt
r2958 r3076 45 45 46 46 .. _csrf documentation: http://www.djangoproject.com/documentation/csrf/ 47 48 humanize 49 ======== 50 51 A set of Django template filters useful for adding a "human touch" to data. 52 To activate these filters, add ``'django.contrib.english'`` to your 53 ``INSTALLED_APPS`` setting. Once you've done that, use ``{% load english %}`` 54 in a template, and you'll have access to these filters: 55 56 ordinal 57 ------- 58 59 Converts an integer to its ordinal as a string. 60 61 Examples: 62 63 * ``1`` becomes ``'1st'``. 64 * ``2`` becomes ``'2nd'``. 65 * ``3`` becomes ``'3rd'``. 66 67 You can pass in either an integer or a string representation of an integer. 68 69 intcomma 70 -------- 71 72 Converts an integer to a string containing commas every three digits. 73 74 Examples: 75 76 * ``4500`` becomes ``'4,500'``. 77 * ``45000`` becomes ``'45,000'``. 78 * ``450000`` becomes ``'450,000'``. 79 * ``4500000`` becomes ``'4,500,000'``. 80 81 You can pass in either an integer or a string representation of an integer. 82 83 intword 84 ------- 85 86 Converts a large integer to a friendly text representation. Works best for 87 numbers over 1 million. 88 89 Examples: 90 91 * ``1000000`` becomes ``'1.0 million'``. 92 * ``1200000`` becomes ``'1.2 million'``. 93 * ``1200000000`` becomes ``'1.2 billion'``. 94 95 Values up to 1000000000000000 (one quadrillion) are supported. 96 97 You can pass in either an integer or a string representation of an integer. 47 98 48 99 flatpages django/trunk/docs/templates.txt
r2812 r3076 1092 1092 if no mapping for None is given) 1093 1093 ========== ====================== ================================== 1094 1095 Other tags and filter libraries 1096 =============================== 1097 1098 Django comes with a couple of other template-tag libraries that you have to 1099 enable explicitly in your ``INSTALLED_APPS`` setting and enable in your 1100 template with the ``{% load %}`` tag. 1101 1102 django.contrib.humanize 1103 ----------------------- 1104 1105 A set of Django template filters useful for adding a "human touch" to data. See 1106 the `humanize documentation`_. 1107 1108 .. _humanize documentation: http://www.djangoproject.com/documentation/add_ons/#humanize 1109 1110 django.contrib.markup 1111 --------------------- 1112 1113 A collection of template filters that implement these common markup languages: 1114 1115 * Textile 1116 * Markdown 1117 * ReST (ReStructured Text)
