Django

Code

Changeset 489

Show
Ignore:
Timestamp:
08/11/05 14:50:32 (3 years ago)
Author:
adrian
Message:

Changed model-unit-test docs so that they explicitly include a 'from django.models.examplemodel import foo' line

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • djangoproject.com/django_website/apps/docs/parts/build_documentation.py

    r488 r489  
    2424{{ blurb }} 
    2525 
    26 <h2 id='model-source-code'>Model source code</h2> 
     26<h2 id="model-source-code">Model source code</h2> 
    2727<pre class="literal-block">{{ model_source }}</pre> 
    2828 
    29 <h2 id='api-reference'>API reference</h2> 
     29<h2 id="api-reference">API reference</h2> 
    3030 
    3131{% for model in models %} 
     
    3636{% endfor %} 
    3737 
    38 <h2 id='sample-usage'>Sample API usage</h2> 
    39 <pre class="literal-block">{{ api_usage }}</pre> 
     38<h2 id="sample-usage">Sample API usage</h2> 
     39<p>This sample code assumes the above model{{ models|pluralize }} {% if models|pluralize %}have{% else %}has{% endif %} 
     40been saved in a file <tt class="docutils literal"><span class="pre">examplemodel.py</span></tt>. 
     41<pre class="literal-block">&gt;&gt;&gt; from django.models.examplemodel import {% for model in models %}{{ model.module_name }}{% if not forloop.last %}, {% endif %}{% endfor %} 
     42{{ api_usage }}</pre> 
    4043</div> 
    4144""" 
     
    107110            models.append({ 
    108111                'name': m._meta.object_name, 
     112                'module_name': m._meta.module_name, 
    109113                'methods': [method for method in dir(m) if not method.startswith('_')], 
    110114            })