Author: jpellerin
Date: 2006-08-27 11:20:02 -0500 (Sun, 27 Aug 2006)
New Revision: 3662
Modified:
django/branches/multiple-db-support/django/contrib/admin/templatetags/admin_modify.py
django/branches/multiple-db-support/django/contrib/flatpages/views.py
django/branches/multiple-db-support/docs/faq.txt
django/branches/multiple-db-support/docs/model-api.txt
django/branches/multiple-db-support/docs/overview.txt
Log:
[multi-db] Merge trunk to [3657].
Modified:
django/branches/multiple-db-support/django/contrib/admin/templatetags/admin_modify.py
===================================================================
---
django/branches/multiple-db-support/django/contrib/admin/templatetags/admin_modify.py
2006-08-27 13:59:47 UTC (rev 3661)
+++
django/branches/multiple-db-support/django/contrib/admin/templatetags/admin_modify.py
2006-08-27 16:20:02 UTC (rev 3662)
@@ -195,7 +195,7 @@
f = bound_field.field
if f.rel and isinstance(f.rel, models.ManyToManyRel) and
f.rel.filter_interface:
return '<script type="text/javascript">addEvent(window, "load",
function(e) {' \
- ' SelectFilter.init("id_%s", "%s", %s, "%s"); });</script>\n' % (
+ ' SelectFilter.init("id_%s", %r, %s, "%s"); });</script>\n' % (
f.name, f.verbose_name, f.rel.filter_interface-1,
settings.ADMIN_MEDIA_PREFIX)
else:
return ''
Modified: django/branches/multiple-db-support/django/contrib/flatpages/views.py
===================================================================
--- django/branches/multiple-db-support/django/contrib/flatpages/views.py
2006-08-27 13:59:47 UTC (rev 3661)
+++ django/branches/multiple-db-support/django/contrib/flatpages/views.py
2006-08-27 16:20:02 UTC (rev 3662)
@@ -3,6 +3,7 @@
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 @@
c = RequestContext(request, {
'flatpage': f,
})
- return HttpResponse(t.render(c))
+ response = HttpResponse(t.render(c))
+ populate_xheaders(request, response, FlatPage, f.id)
+ return response
Modified: django/branches/multiple-db-support/docs/faq.txt
===================================================================
--- django/branches/multiple-db-support/docs/faq.txt 2006-08-27 13:59:47 UTC
(rev 3661)
+++ django/branches/multiple-db-support/docs/faq.txt 2006-08-27 16:20:02 UTC
(rev 3662)
@@ -16,12 +16,17 @@
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 @@
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 @@
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?
--------------------------------------------------------------------------------------------
Modified: django/branches/multiple-db-support/docs/model-api.txt
===================================================================
--- django/branches/multiple-db-support/docs/model-api.txt 2006-08-27
13:59:47 UTC (rev 3661)
+++ django/branches/multiple-db-support/docs/model-api.txt 2006-08-27
16:20:02 UTC (rev 3662)
@@ -1222,10 +1222,13 @@
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 @@
return '<span style="color: #%s;">%s %s</span>' %
(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``
----------------------
Modified: django/branches/multiple-db-support/docs/overview.txt
===================================================================
--- django/branches/multiple-db-support/docs/overview.txt 2006-08-27
13:59:47 UTC (rev 3661)
+++ django/branches/multiple-db-support/docs/overview.txt 2006-08-27
16:20:02 UTC (rev 3662)
@@ -159,7 +159,7 @@
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 *
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" 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-updates
-~----------~----~----~----~------~----~------~--~---