Ticket #5480: 5480.diff

File 5480.diff, 18.2 KB (added by Maura Chace, 16 years ago)

Removed numbers from docstrings. Assuming this is the way to go.

  • tests/modeltests/select_related/models.py

     
    11"""
    2 40. Tests for select_related()
     2Tests for select_related()
    33
    44``select_related()`` follows all relationships and pre-caches any foreign key
    55values so that complex trees can be fetched in a single query. However, this
  • tests/modeltests/basic/models.py

     
    11# coding: utf-8
    22"""
    3 1. Bare-bones model
     3Bare-bones model
    44
    55This is a basic model with only two non-primary-key fields.
    66"""
  • tests/modeltests/m2m_recursive/models.py

     
    11"""
    2 28. Many-to-many relationships between the same two tables
     2Many-to-many relationships between the same two tables
    33
    44In this example, A Person can have many friends, who are also people. Friendship is a
    55symmetrical relationship - if I am your friend, you are my friend.
  • tests/modeltests/one_to_one/models.py

     
    11"""
    2 10. One-to-one relationships
     2One-to-one relationships
    33
    44To define a one-to-one relationship, use ``OneToOneField()``.
    55
  • tests/modeltests/m2o_recursive/models.py

     
    11"""
    2 11. Relating an object to itself, many-to-one
     2Relating an object to itself, many-to-one
    33
    44To define a many-to-one relationship between a model and itself, use
    55``ForeignKey('self')``.
  • tests/modeltests/custom_managers/models.py

     
    11"""
    2 23. Giving models a custom manager
     2Giving models a custom manager
    33
    44You can use a custom ``Manager`` in a particular model by extending the base
    55``Manager`` class and instantiating your custom ``Manager`` in your model.
  • tests/modeltests/invalid_models/models.py

     
    11"""
    2 26. Invalid models
     2Invalid models
    33
    44This example exists purely to point out errors in models.
    55"""
  • tests/modeltests/many_to_many/models.py

     
    11"""
    2 5. Many-to-many relationships
     2Many-to-many relationships
    33
    44To define a many-to-many relationship, use ManyToManyField().
    55
  • tests/modeltests/m2m_and_m2o/models.py

     
    11"""
    2 29. Many-to-many and many-to-one relationships to the same table
     2Many-to-many and many-to-one relationships to the same table
    33
    44Make sure to set ``related_name`` if you use relationships to the same table.
    55"""
  • tests/modeltests/validation/models.py

     
    11"""
    2 31. Validation
     2Validation
    33
    44This is an experimental feature!
    55
  • tests/modeltests/or_lookups/models.py

     
    11"""
    2 19. OR lookups
     2OR lookups
    33
    44To perform an OR lookup, or a lookup that combines ANDs and ORs,
    55combine QuerySet objects using & and | operators.
  • tests/modeltests/mutually_referential/models.py

     
    11"""
    2 24. Mutually referential many-to-one relationships
     2Mutually referential many-to-one relationships
    33
    44To define a many-to-one relationship, use ``ForeignKey()`` .
    55"""
  • tests/modeltests/custom_methods/models.py

     
    11"""
    2 3. Giving models custom methods
     2Giving models custom methods
    33
    44Any method you add to a model will be available to instances.
    55"""
  • tests/modeltests/empty/models.py

     
    11"""
    2 39. Empty model tests
     2Empty model tests
    33
    44These test that things behave sensibly for the rare corner-case of a model with
    55no fields.
  • tests/modeltests/many_to_one_null/models.py

     
    11"""
    2 16. Many-to-one relationships that can be null
     2Many-to-one relationships that can be null
    33
    44To define a many-to-one relationship that can have a null foreign key, use
    55``ForeignKey()`` with ``null=True`` .
  • tests/modeltests/get_or_create/models.py

     
    11"""
    2 33. get_or_create()
     2get_or_create()
    33
    44get_or_create() does what it says: it tries to look up an object with the given
    55parameters. If an object isn't found, it creates one with the given parameters.
  • tests/modeltests/custom_pk/models.py

     
    11# -*- coding: utf-8 -*-
    22"""
    3 14. Using a custom primary key
     3Using a custom primary key
    44
    55By default, Django adds an ``"id"`` field to each model. But you can override
    66this behavior by explicitly adding ``primary_key=True`` to a field.
  • tests/modeltests/reverse_lookup/models.py

     
    11"""
    2 25. Reverse lookups
     2Reverse lookups
    33
    44This demonstrates the reverse lookup features of the database API.
    55"""
  • tests/modeltests/m2o_recursive2/models.py

     
    11"""
    2 12. Relating a model to another model more than once
     2Relating a model to another model more than once
    33
    44In this example, a ``Person`` can have a ``mother`` and ``father`` -- both of
    55which are other ``Person`` objects.
  • tests/modeltests/m2m_multiple/models.py

     
    11"""
    2 20. Multiple many-to-many relationships between the same two tables
     2Multiple many-to-many relationships between the same two tables
    33
    44In this example, an Article can have many Categories (as "primary") and many
    55Categories (as "secondary").
  • tests/modeltests/m2m_intermediary/models.py

     
    11"""
    2 9. Many-to-many relationships via an intermediary table
     2Many-to-many relationships via an intermediary table
    33
    44For many-to-many relationships that need extra fields on the intermediary
    55table, use an intermediary model.
  • tests/modeltests/str/models.py

     
    11# -*- coding: utf-8 -*-
    22"""
    3 2. Adding __str__() or __unicode__() to models
     3Adding __str__() or __unicode__() to models
    44
    55Although it's not a strict requirement, each model should have a
    66``_str__()`` or ``__unicode__()`` method to return a "human-readable"
  • tests/modeltests/transactions/models.py

     
    11"""
    2 15. Transactions
     2Transactions
    33
    44Django handles transactions in three different ways. The default is to commit
    55each transaction upon a write, but you can decorate a function to get
  • tests/modeltests/model_inheritance/models.py

     
    11"""
    2 XX. Model inheritance
     2Model inheritance
    33
    44Model inheritance isn't yet supported.
    55"""
  • tests/modeltests/lookup/models.py

     
    11"""
    2 7. The lookup API
     2The lookup API
    33
    44This demonstrates features of the database API.
    55"""
  • tests/modeltests/choices/models.py

     
    11"""
    2 21. Specifying 'choices' for a field
     2Specifying 'choices' for a field
    33
    44Most fields take a ``choices`` parameter, which should be a tuple of tuples
    55specifying which are the valid values for that field.
  • tests/modeltests/save_delete_hooks/models.py

     
    11"""
    2 13. Adding hooks before/after saving and deleting
     2Adding hooks before/after saving and deleting
    33
    44To execute arbitrary code around ``save()`` and ``delete()``, just subclass
    55the methods.
  • tests/modeltests/pagination/models.py

     
    11"""
    2 30. Object pagination
     2Object pagination
    33
    44Django provides a framework for paginating a list of objects in a few lines
    55of code. This is often useful for dividing search results or long lists of
  • tests/modeltests/get_latest/models.py

     
    11"""
    2 8. get_latest_by
     2get_latest_by
    33
    44Models can have a ``get_latest_by`` attribute, which should be set to the name
    55of a DateField or DateTimeField. If ``get_latest_by`` exists, the model's
  • tests/modeltests/generic_relations/models.py

     
    11"""
    2 34. Generic relations
     2Generic relations
    33
    44Generic relations let an object have a foreign key to any object through a
    55content-type/object-id field. A generic foreign key can point to any object,
  • tests/modeltests/get_object_or_404/models.py

     
    11"""
    2 35. DB-API Shortcuts
     2DB-API Shortcuts
    33
    44get_object_or_404 is a shortcut function to be used in view functions for
    55performing a get() lookup and raising a Http404 exception if a DoesNotExist
  • tests/modeltests/properties/models.py

     
    11"""
    2 22. Using properties on models
     2Using properties on models
    33
    44Use properties on models just like on any other Python object.
    55"""
  • tests/modeltests/serializers/models.py

     
    11# -*- coding: utf-8 -*-
    22"""
    3 41. Serialization
     3Serialization
    44
    55``django.core.serializers`` provides interfaces to converting Django querysets
    66to and from "flat" data (i.e. strings).
  • tests/modeltests/user_commands/models.py

     
    11"""
    2 37. User-registered management commands
     2User-registered management commands
    33
    44The manage.py utility provides a number of useful commands for managing a
    55Django project. If you want to add a utility command of your own, you can.
  • tests/modeltests/reserved_names/models.py

     
    11"""
    2 18. Using SQL reserved names
     2Using SQL reserved names
    33
    44Need to use a reserved SQL name as a column name or table name? Need to include
    55a hyphen in a column or table name? No problem. Django quotes names
  • tests/modeltests/model_forms/models.py

     
    11"""
    2 36. Generating HTML forms from models
     2Generating HTML forms from models
    33
    44Django provides shortcuts for creating Form objects from a model class and a
    55model instance.
  • tests/modeltests/many_to_one/models.py

     
    11"""
    2 4. Many-to-one relationships
     2Many-to-one relationships
    33
    44To define a many-to-one relationship, use ``ForeignKey()`` .
    55"""
  • tests/modeltests/fixtures/models.py

     
    11"""
    2 37. Fixtures.
     2Fixtures.
    33
    44Fixtures are a way of loading data into the database in bulk. Fixure data
    55can be stored in any serializable format (including JSON and XML). Fixtures
  • tests/modeltests/ordering/models.py

     
    11"""
    2 6. Specifying ordering
     2Specifying ordering
    33
    44Specify default ordering for a model using the ``ordering`` attribute, which
    55should be a list or tuple of field names. This tells Django how to order the
  • tests/modeltests/custom_columns/models.py

     
    11"""
    2 17. Custom column/table names
     2Custom column/table names
    33
    44If your database column name is different than your model attribute, use the
    55``db_column`` parameter. Note that you'll use the field's name, not its column
  • tests/modeltests/field_defaults/models.py

     
    11"""
    2 32. Callable defaults
     2Callable defaults
    33
    44You can pass callable objects as the ``default`` parameter to a field. When
    55the object is created without an explicit value passed in, Django will call
  • tests/modeltests/test_client/models.py

     
    11# coding: utf-8
    22"""
    3 38. Testing using the Test Client
     3Testing using the Test Client
    44
    55The test client is a class that can act like a simple
    66browser for testing purposes.
  • tests/modeltests/manipulators/models.py

     
    11"""
    2 27. Default manipulators
     2Default manipulators
    33
    44Each model gets an AddManipulator and ChangeManipulator by default.
    55"""
Back to Top