Changeset 489
- Timestamp:
- 08/11/05 14:50:32 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
djangoproject.com/django_website/apps/docs/parts/build_documentation.py
r488 r489 24 24 {{ blurb }} 25 25 26 <h2 id= 'model-source-code'>Model source code</h2>26 <h2 id="model-source-code">Model source code</h2> 27 27 <pre class="literal-block">{{ model_source }}</pre> 28 28 29 <h2 id= 'api-reference'>API reference</h2>29 <h2 id="api-reference">API reference</h2> 30 30 31 31 {% for model in models %} … … 36 36 {% endfor %} 37 37 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 %} 40 been saved in a file <tt class="docutils literal"><span class="pre">examplemodel.py</span></tt>. 41 <pre class="literal-block">>>> from django.models.examplemodel import {% for model in models %}{{ model.module_name }}{% if not forloop.last %}, {% endif %}{% endfor %} 42 {{ api_usage }}</pre> 40 43 </div> 41 44 """ … … 107 110 models.append({ 108 111 'name': m._meta.object_name, 112 'module_name': m._meta.module_name, 109 113 'methods': [method for method in dir(m) if not method.startswith('_')], 110 114 })
