From ac28f828a8c39f6e70e8dcae95f81d303a47a4a5 Mon Sep 17 00:00:00 2001 From: Jason Pellerin Date: Sun, 27 Aug 2006 16:20:02 +0000 Subject: [PATCH] [multi-db] Merge trunk to [3657]. git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3662 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- .../admin/templatetags/admin_modify.py | 2 +- django/contrib/flatpages/views.py | 5 +++- docs/faq.txt | 27 ++++++++++++++----- docs/model-api.txt | 19 ++++++++++--- docs/overview.txt | 2 +- 5 files changed, 42 insertions(+), 13 deletions(-) diff --git a/django/contrib/admin/templatetags/admin_modify.py b/django/contrib/admin/templatetags/admin_modify.py index 7ba7bef74e..55d8bb2b95 100644 --- a/django/contrib/admin/templatetags/admin_modify.py +++ b/django/contrib/admin/templatetags/admin_modify.py @@ -195,7 +195,7 @@ def filter_interface_script_maybe(bound_field): f = bound_field.field if f.rel and isinstance(f.rel, models.ManyToManyRel) and f.rel.filter_interface: return '\n' % ( + ' SelectFilter.init("id_%s", %r, %s, "%s"); });\n' % ( f.name, f.verbose_name, f.rel.filter_interface-1, settings.ADMIN_MEDIA_PREFIX) else: return '' diff --git a/django/contrib/flatpages/views.py b/django/contrib/flatpages/views.py index 4ad24795f7..f386a52101 100644 --- a/django/contrib/flatpages/views.py +++ b/django/contrib/flatpages/views.py @@ -3,6 +3,7 @@ from django.template import loader, RequestContext from django.shortcuts import get_object_or_404 from django.http import HttpResponse from django.conf import settings +from django.core.xheaders import populate_xheaders DEFAULT_TEMPLATE = 'flatpages/default.html' @@ -32,4 +33,6 @@ def flatpage(request, url): c = RequestContext(request, { 'flatpage': f, }) - return HttpResponse(t.render(c)) + response = HttpResponse(t.render(c)) + populate_xheaders(request, response, FlatPage, f.id) + return response diff --git a/docs/faq.txt b/docs/faq.txt index 42d9ddea55..d39e203c76 100644 --- a/docs/faq.txt +++ b/docs/faq.txt @@ -16,12 +16,17 @@ hours to take a complicated Web application from concept to public launch. At the same time, the World Online Web developers have consistently been perfectionists when it comes to following best practices of Web development. -Thus, Django was designed not only to allow fast Web development, but -*best-practice* Web development. +In fall 2003, the World Online developers (Adrian Holovaty and Simon Willison) +ditched PHP and began using Python to develop its Web sites. As they built +intensive, richly interactive sites such as Lawrence.com, they began to extract +a generic Web development framework that let them build Web applications more +and more quickly. They tweaked this framework constantly, adding improvements +over two years. -Django would not be possible without a whole host of open-source projects -- -`Apache`_, `Python`_, and `PostgreSQL`_ to name a few -- and we're thrilled to -be able to give something back to the open-source community. +In summer 2005, World Online decided to open-source the resulting software, +Django. Django would not be possible without a whole host of open-source +projects -- `Apache`_, `Python`_, and `PostgreSQL`_ to name a few -- and we're +thrilled to be able to give something back to the open-source community. .. _Apache: http://httpd.apache.org/ .. _Python: http://www.python.org/ @@ -42,8 +47,8 @@ Django is pronounced **JANG**-oh. Rhymes with FANG-oh. The "D" is silent. Is Django stable? ----------------- -Yes. World Online has been using Django for more than two years. Sites built on -Django have weathered traffic spikes of over one million hits an hour and a +Yes. World Online has been using Django for more than three years. Sites built +on Django have weathered traffic spikes of over one million hits an hour and a number of Slashdottings. Yes, it's quite stable. Does Django scale? @@ -630,6 +635,14 @@ You can also use the Python API. See `creating users`_ for full info. Contributing code ================= +How can I get started contributing code to Django? +-------------------------------------------------- + +Thanks for asking! We've written an entire document devoted to this question. +It's titled `Contributing to Django`_. + +.. _Contributing do Django: http://www.djangoproject.com/documentation/contributing/ + I submitted a bug fix in the ticket system several weeks ago. Why are you ignoring my patch? -------------------------------------------------------------------------------------------- diff --git a/docs/model-api.txt b/docs/model-api.txt index 0a3abe4e26..b46a11c463 100644 --- a/docs/model-api.txt +++ b/docs/model-api.txt @@ -1222,10 +1222,13 @@ A few special cases to note about ``list_display``: of the related object. * ``ManyToManyField`` fields aren't supported, because that would entail - executing a separate SQL statement for each row in the table. + executing a separate SQL statement for each row in the table. If you + want to do this nonetheless, give your model a custom method, and add + that method's name to ``list_display``. (See below for more on custom + methods in ``list_display``.) - * If the field is a ``BooleanField``, Django will display a pretty "on" or - "off" icon instead of ``True`` or ``False``. + * If the field is a ``BooleanField`` or ``NullBooleanField``, Django will + display a pretty "on" or "off" icon instead of ``True`` or ``False``. * If the string given is a method of the model, Django will call it and display the output. This method should have a ``short_description`` @@ -1262,6 +1265,16 @@ A few special cases to note about ``list_display``: return '%s %s' % (self.color_code, self.first_name, self.last_name) colored_name.allow_tags = True + * The ``__str__()`` method is just as valid in ``list_display`` as any + other model method, so it's perfectly OK to do this:: + + list_display = ('__str__', 'some_other_field') + + * For any element of ``list_display`` that is not a field on the model, the + change list page will not allow ordering by that column. This is because + ordering is done at the database level, and Django has no way of knowing + how to order the result of a custom method at the SQL level. + ``list_display_links`` ---------------------- diff --git a/docs/overview.txt b/docs/overview.txt index 5a399582e8..8e6274dd9a 100644 --- a/docs/overview.txt +++ b/docs/overview.txt @@ -159,7 +159,7 @@ of contents for your app, it contains a simple mapping between URL patterns and Python callback functions. URLconfs also serve to decouple URLs from Python code. -Here's what a URLconf might look like for the above ``Reporter``/``Article`` +Here's what a URLconf might look like for the ``Reporter``/``Article`` example above:: from django.conf.urls.defaults import *