Sophie

Sophie

distrib > Arklinux > devel > i586 > media > main > by-pkgid > 5fcb1fedf34660bc240dc59b7bfcebc4 > files > 363

django-doc-1.2.3-1ark.noarch.rpm


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>django.contrib.humanize &mdash; Django v1.2 documentation</title>
    <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../',
        VERSION:     '1.2',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <link rel="top" title="Django v1.2 documentation" href="../../index.html" />
    <link rel="up" title="contrib packages" href="index.html" />
    <link rel="next" title="The “local flavor” add-ons" href="localflavor.html" />
    <link rel="prev" title="Deploying GeoDjango" href="gis/deployment.html" />
 
<script type="text/javascript" src="../../templatebuiltins.js"></script>
<script type="text/javascript">
(function($) {
    if (!django_template_builtins) {
       // templatebuiltins.js missing, do nothing.
       return;
    }
    $(document).ready(function() {
        // Hyperlink Django template tags and filters
        var base = "../templates/builtins.html";
        if (base == "#") {
            // Special case for builtins.html itself
            base = "";
        }
        // Tags are keywords, class '.k'
        $("div.highlight\\-html\\+django span.k").each(function(i, elem) {
             var tagname = $(elem).text();
             if ($.inArray(tagname, django_template_builtins.ttags) != -1) {
                 var fragment = tagname.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + tagname + "</a>");
             }
        });
        // Filters are functions, class '.nf'
        $("div.highlight\\-html\\+django span.nf").each(function(i, elem) {
             var filtername = $(elem).text();
             if ($.inArray(filtername, django_template_builtins.tfilters) != -1) {
                 var fragment = filtername.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + filtername + "</a>");
             }
        });
    });
})(jQuery);
</script>

  </head>
  <body>

    <div class="document">
  <div id="custom-doc" class="yui-t6">
    <div id="hd">
      <h1><a href="../../index.html">Django v1.2 documentation</a></h1>
      <div id="global-nav">
        <a title="Home page" href="../../index.html">Home</a>  |
        <a title="Table of contents" href="../../contents.html">Table of contents</a>  |
        <a title="Global index" href="../../genindex.html">Index</a>  |
        <a title="Module index" href="../../py-modindex.html">Modules</a>
      </div>
      <div class="nav">
    &laquo; <a href="gis/deployment.html" title="Deploying GeoDjango">previous</a> 
     |
    <a href="../index.html" title="API Reference" accesskey="U">up</a>
   |
    <a href="localflavor.html" title="The &amp;#8220;local flavor&amp;#8221; add-ons">next</a> &raquo;</div>
    </div>
    
    <div id="bd">
      <div id="yui-main">
        <div class="yui-b">
          <div class="yui-g" id="ref-contrib-humanize">
            
  <div class="section" id="s-module-django.contrib.humanize">
<span id="s-django-contrib-humanize"></span><span id="module-django.contrib.humanize"></span><span id="django-contrib-humanize"></span><h1>django.contrib.humanize<a class="headerlink" href="#module-django.contrib.humanize" title="Permalink to this headline">¶</a></h1>
<p>A set of Django template filters useful for adding a &#8220;human touch&#8221; to data.</p>
<p>To activate these filters, add <tt class="docutils literal"><span class="pre">'django.contrib.humanize'</span></tt> to your
<a class="reference internal" href="../settings.html#std:setting-INSTALLED_APPS"><tt class="xref std std-setting docutils literal"><span class="pre">INSTALLED_APPS</span></tt></a> setting. Once you&#8217;ve done that, use
<tt class="docutils literal"><span class="pre">{%</span> <span class="pre">load</span> <span class="pre">humanize</span> <span class="pre">%}</span></tt> in a template, and you&#8217;ll have access to these filters:</p>
<div class="section" id="s-apnumber">
<span id="apnumber"></span><h2>apnumber<a class="headerlink" href="#apnumber" title="Permalink to this headline">¶</a></h2>
<p>For numbers 1-9, returns the number spelled out. Otherwise, returns the
number. This follows Associated Press style.</p>
<p>Examples:</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">1</span></tt> becomes <tt class="docutils literal"><span class="pre">'one'</span></tt>.</li>
<li><tt class="docutils literal"><span class="pre">2</span></tt> becomes <tt class="docutils literal"><span class="pre">'two'</span></tt>.</li>
<li><tt class="docutils literal"><span class="pre">10</span></tt> becomes <tt class="docutils literal"><span class="pre">10</span></tt>.</li>
</ul>
<p>You can pass in either an integer or a string representation of an integer.</p>
</div>
<div class="section" id="s-intcomma">
<span id="intcomma"></span><h2>intcomma<a class="headerlink" href="#intcomma" title="Permalink to this headline">¶</a></h2>
<p>Converts an integer to a string containing commas every three digits.</p>
<p>Examples:</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">4500</span></tt> becomes <tt class="docutils literal"><span class="pre">'4,500'</span></tt>.</li>
<li><tt class="docutils literal"><span class="pre">45000</span></tt> becomes <tt class="docutils literal"><span class="pre">'45,000'</span></tt>.</li>
<li><tt class="docutils literal"><span class="pre">450000</span></tt> becomes <tt class="docutils literal"><span class="pre">'450,000'</span></tt>.</li>
<li><tt class="docutils literal"><span class="pre">4500000</span></tt> becomes <tt class="docutils literal"><span class="pre">'4,500,000'</span></tt>.</li>
</ul>
<p>You can pass in either an integer or a string representation of an integer.</p>
</div>
<div class="section" id="s-intword">
<span id="intword"></span><h2>intword<a class="headerlink" href="#intword" title="Permalink to this headline">¶</a></h2>
<p>Converts a large integer to a friendly text representation. Works best for
numbers over 1 million.</p>
<p>Examples:</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">1000000</span></tt> becomes <tt class="docutils literal"><span class="pre">'1.0</span> <span class="pre">million'</span></tt>.</li>
<li><tt class="docutils literal"><span class="pre">1200000</span></tt> becomes <tt class="docutils literal"><span class="pre">'1.2</span> <span class="pre">million'</span></tt>.</li>
<li><tt class="docutils literal"><span class="pre">1200000000</span></tt> becomes <tt class="docutils literal"><span class="pre">'1.2</span> <span class="pre">billion'</span></tt>.</li>
</ul>
<p>Values up to 1000000000000000 (one quadrillion) are supported.</p>
<p>You can pass in either an integer or a string representation of an integer.</p>
</div>
<div class="section" id="s-ordinal">
<span id="ordinal"></span><h2>ordinal<a class="headerlink" href="#ordinal" title="Permalink to this headline">¶</a></h2>
<p>Converts an integer to its ordinal as a string.</p>
<p>Examples:</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">1</span></tt> becomes <tt class="docutils literal"><span class="pre">'1st'</span></tt>.</li>
<li><tt class="docutils literal"><span class="pre">2</span></tt> becomes <tt class="docutils literal"><span class="pre">'2nd'</span></tt>.</li>
<li><tt class="docutils literal"><span class="pre">3</span></tt> becomes <tt class="docutils literal"><span class="pre">'3rd'</span></tt>.</li>
</ul>
<p>You can pass in either an integer or a string representation of an integer.</p>
</div>
<div class="section" id="s-naturalday">
<span id="naturalday"></span><h2>naturalday<a class="headerlink" href="#naturalday" title="Permalink to this headline">¶</a></h2>
<div class="versionadded">
<span class="title">New in Django 1.0:</span> <a class="reference internal" href="../../releases/1.0.html"><em>Please, see the release notes</em></a></div>
<p>For dates that are the current day or within one day, return &#8220;today&#8221;,
&#8220;tomorrow&#8221; or &#8220;yesterday&#8221;, as appropriate. Otherwise, format the date using
the passed in format string.</p>
<p><strong>Argument:</strong> Date formatting string as described in the <a class="reference internal" href="../templates/builtins.html#std:templatetag-now"><tt class="xref std std-ttag docutils literal"><span class="pre">now</span></tt></a> tag.</p>
<p>Examples (when &#8216;today&#8217; is 17 Feb 2007):</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">16</span> <span class="pre">Feb</span> <span class="pre">2007</span></tt> becomes <tt class="docutils literal"><span class="pre">yesterday</span></tt>.</li>
<li><tt class="docutils literal"><span class="pre">17</span> <span class="pre">Feb</span> <span class="pre">2007</span></tt> becomes <tt class="docutils literal"><span class="pre">today</span></tt>.</li>
<li><tt class="docutils literal"><span class="pre">18</span> <span class="pre">Feb</span> <span class="pre">2007</span></tt> becomes <tt class="docutils literal"><span class="pre">tomorrow</span></tt>.</li>
<li>Any other day is formatted according to given argument or the
<a class="reference internal" href="../settings.html#std:setting-DATE_FORMAT"><tt class="xref std std-setting docutils literal"><span class="pre">DATE_FORMAT</span></tt></a> setting if no argument is given.</li>
</ul>
</div>
</div>


          </div>         
        </div>
      </div>
      
        
          <div class="yui-b" id="sidebar">
            
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../../contents.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">django.contrib.humanize</a><ul>
<li><a class="reference internal" href="#apnumber">apnumber</a></li>
<li><a class="reference internal" href="#intcomma">intcomma</a></li>
<li><a class="reference internal" href="#intword">intword</a></li>
<li><a class="reference internal" href="#ordinal">ordinal</a></li>
<li><a class="reference internal" href="#naturalday">naturalday</a></li>
</ul>
</li>
</ul>

  <h3>Browse</h3>
  <ul>
    
      <li>Prev: <a href="gis/deployment.html">Deploying GeoDjango</a></li>
    
    
      <li>Next: <a href="localflavor.html">The &#8220;local flavor&#8221; add-ons</a></li>
    
  </ul>
  <h3>You are here:</h3>
  <ul>
      <li>
        <a href="../../index.html">Django v1.2 documentation</a>
        
          <ul><li><a href="../index.html">API Reference</a>
        
          <ul><li><a href="index.html"><tt class="docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal"><span class="pre">contrib</span></tt> packages</a>
        
        <ul><li>django.contrib.humanize</li></ul>
        </li></ul></li></ul>
      </li>
  </ul>  

  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../../_sources/ref/contrib/humanize.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
              <h3>Last update:</h3>
              <p class="topless">Oct 20, 2010</p>
          </div> 
        
      
    </div>
    
    <div id="ft">
      <div class="nav">
    &laquo; <a href="gis/deployment.html" title="Deploying GeoDjango">previous</a> 
     |
    <a href="../index.html" title="API Reference" accesskey="U">up</a>
   |
    <a href="localflavor.html" title="The &amp;#8220;local flavor&amp;#8221; add-ons">next</a> &raquo;</div>
    </div>
  </div>

      <div class="clearer"></div>
    </div>
  </body>
</html>