On 11/3/06, Serg Kovrov <[EMAIL PROTECTED]> wrote:
> Forgive me for silly question, but why 'short_description' used in
> contrib.admin, instead of '__doc__' attribute?

'short_description' is used when an interface like the admin needs a
short but human-readable way to describe some attribute; a docstring
doesn't always (and in fact, rarely should) fit that criterion.

For example, consider a model with a method named 'is_paid_up'. The
short_description could be 'Is paid up', but the docstring might be:

"""
Determines whether the client's account is paid up.

"Paid up" means that:
 * The value of the setting CLIENTS_PAY is True.
 * The "is_active" field of the client's Account instance is True.
 * The date stored in the "last_payment" field is within
settings.BILLING_CYCLE_LENGTH days of the current date.

For convenience, access this via the "paid_up" property (see definition below).
"""

Trying to force docstrings to be suitable for short_description would
severely hamper Python's useful ability to intersperse documentation
with code, because things like the above couldn't happen.

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to