Re: [Django] #15887: Improve django.views.decorators.http docs

2011-04-22 Thread Django
#15887: Improve  django.views.decorators.http docs
-+-
   Reporter:  RoySmith   |  Owner:  nobody
   Type: | Status:  new
  Cleanup/optimization   |  Component:  Documentation
  Milestone: |   Severity:  Normal
Version:  1.3|   Keywords:
 Resolution: |  Has patch:  1
   Triage Stage: |Needs tests:  0
  Unreviewed |  Easy pickings:  0
Needs documentation:  0  |
Patch needs improvement:  0  |
-+-
Changes (by EnTeQuAk):

 * cc: cg@… (added)
 * needs_better_patch:   => 0
 * component:  Core (Other) => Documentation
 * needs_tests:   => 0
 * needs_docs:   => 0
 * has_patch:  0 => 1
 * type:  Bug => Cleanup/optimization


Comment:

 They return a proper 405 (Not Allowed) response.  If it's really required
 to note this I created a small patch to mention the return value.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #9371: Fixtures combined with inherited models causing constraint violations/possible double entry of data

2011-04-22 Thread Django
#9371: Fixtures combined with inherited models causing constraint
violations/possible double entry of data
-+-
   Reporter: |  Owner:  nobody
  terpsquared| Status:  new
   Type: |  Component:  Core
  Uncategorized  |  (Serialization)
  Milestone: |   Severity:  Normal
Version:  1.0|   Keywords:
 Resolution: |  Has patch:  0
   Triage Stage:  Accepted   |Needs tests:  0
Needs documentation:  0  |  Easy pickings:  0
Patch needs improvement:  0  |
-+-
Changes (by tehfink ):

 * cc: djsnickles@… (added)
 * type:   => Uncategorized
 * severity:   => Normal
 * easy:   => 0


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15880: manage.py: difficult to run in background (and crashes when input isn't a terminal)

2011-04-22 Thread Django
#15880: manage.py: difficult to run in background (and crashes when input isn't 
a
terminal)
-+-
   Reporter: |  Owner:  nobody
  dstndstn@… | Status:  new
   Type:  Bug|  Component:  Core (Management
  Milestone: |  commands)
Version:  1.3|   Severity:  Normal
 Resolution: |   Keywords:  regression
   Triage Stage:  Accepted   |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
-+-
Changes (by kmtracey):

 * keywords:   => regression


Comment:

 So apparently `termios.tcsetattr` sends a SIGTTOU signal when the process
 has been put in the background, which by default causes the process to be
 stopped. Attached patch ignores SIGTTOU for the duration of tcsetattr. It
 has the virtue of seeming to work, the only weirdness I notice is that the
 first command typed after starting manage.py runserver in the background
 is double-echoed. But I'd really rather fix whatever is causing terminal
 echo to be turned off, if anyone has a clue how to do that. This other
 approach of ensuring it is on is getting uglier and uglier.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r16094 - in django/branches/releases/1.3.X: django/contrib/admin/views tests/regressiontests/admin_changelist

2011-04-22 Thread noreply
Author: carljm
Date: 2011-04-22 21:40:06 -0700 (Fri, 22 Apr 2011)
New Revision: 16094

Modified:
   django/branches/releases/1.3.X/django/contrib/admin/views/main.py
   
django/branches/releases/1.3.X/tests/regressiontests/admin_changelist/tests.py
Log:
[1.3.X] Fixed #15819 - Fixed 1.3 regression from r15526 causing duplicate 
search results in admin with search_fields traversing to non-M2M related 
models. Thanks to Adam Kochanowski for the report and Ryan Kaskel for the patch.

Backport of r16093 from trunk.

Modified: django/branches/releases/1.3.X/django/contrib/admin/views/main.py
===
--- django/branches/releases/1.3.X/django/contrib/admin/views/main.py   
2011-04-23 03:55:21 UTC (rev 16093)
+++ django/branches/releases/1.3.X/django/contrib/admin/views/main.py   
2011-04-23 04:40:06 UTC (rev 16094)
@@ -26,6 +26,15 @@
 # Text to display within change-list table cells if the value is blank.
 EMPTY_CHANGELIST_VALUE = ugettext_lazy('(None)')
 
+def field_needs_distinct(field):
+if ((hasattr(field, 'rel') and
+ isinstance(field.rel, models.ManyToManyRel)) or
+(isinstance(field, models.related.RelatedObject) and
+ not field.field.unique)):
+ return True
+return False
+
+
 class ChangeList(object):
 def __init__(self, request, model, list_display, list_display_links, 
list_filter, date_hierarchy, search_fields, list_select_related, list_per_page, 
list_editable, model_admin):
 self.model = model
@@ -189,8 +198,7 @@
 f = self.lookup_opts.get_field_by_name(field_name)[0]
 except models.FieldDoesNotExist:
 raise IncorrectLookupParameters
-if hasattr(f, 'rel') and isinstance(f.rel, 
models.ManyToManyRel):
-use_distinct = True
+use_distinct = field_needs_distinct(f)
 
 # if key ends with __in, split parameter into separate values
 if key.endswith('__in'):
@@ -264,7 +272,7 @@
 for search_spec in orm_lookups:
 field_name = search_spec.split('__', 1)[0]
 f = self.lookup_opts.get_field_by_name(field_name)[0]
-if hasattr(f, 'rel') and isinstance(f.rel, 
models.ManyToManyRel):
+if field_needs_distinct(f):
 use_distinct = True
 break
 

Modified: 
django/branches/releases/1.3.X/tests/regressiontests/admin_changelist/tests.py
===
--- 
django/branches/releases/1.3.X/tests/regressiontests/admin_changelist/tests.py  
2011-04-23 03:55:21 UTC (rev 16093)
+++ 
django/branches/releases/1.3.X/tests/regressiontests/admin_changelist/tests.py  
2011-04-23 04:40:06 UTC (rev 16094)
@@ -1,6 +1,6 @@
 from django.contrib import admin
 from django.contrib.admin.options import IncorrectLookupParameters
-from django.contrib.admin.views.main import ChangeList
+from django.contrib.admin.views.main import ChangeList, SEARCH_VAR
 from django.core.paginator import Paginator
 from django.template import Context, Template
 from django.test import TransactionTestCase
@@ -148,12 +148,14 @@
 band.genres.add(blues)
 
 m = BandAdmin(Band, admin.site)
-cl = ChangeList(MockFilteredRequestA(blues.pk), Band, m.list_display,
+request = MockFilterRequest('genres', blues.pk)
+
+cl = ChangeList(request, Band, m.list_display,
 m.list_display_links, m.list_filter, m.date_hierarchy,
 m.search_fields, m.list_select_related, m.list_per_page,
 m.list_editable, m)
 
-cl.get_results(MockFilteredRequestA(blues.pk))
+cl.get_results(request)
 
 # There's only one Group instance
 self.assertEqual(cl.result_count, 1)
@@ -169,12 +171,14 @@
 Membership.objects.create(group=band, music=lead, role='bass player')
 
 m = GroupAdmin(Group, admin.site)
-cl = ChangeList(MockFilteredRequestB(lead.pk), Group, m.list_display,
+request = MockFilterRequest('members', lead.pk)
+
+cl = ChangeList(request, Group, m.list_display,
 m.list_display_links, m.list_filter, m.date_hierarchy,
 m.search_fields, m.list_select_related, m.list_per_page,
 m.list_editable, m)
 
-cl.get_results(MockFilteredRequestB(lead.pk))
+cl.get_results(request)
 
 # There's only one Group instance
 self.assertEqual(cl.result_count, 1)
@@ -191,12 +195,14 @@
 Membership.objects.create(group=four, music=lead, role='guitar player')
 
 m = QuartetAdmin(Quartet, admin.site)
-cl = ChangeList(MockFilteredRequestB(lead.pk), Quartet, m.list_display,
+request = MockFilterRequest('members', lead.pk)
+
+cl = ChangeList(request, Quartet, m.list_display,
 m.list_display_links, m.list_f

[Changeset] r16093 - in django/trunk: django/contrib/admin/views tests/regressiontests/admin_changelist

2011-04-22 Thread noreply
Author: carljm
Date: 2011-04-22 20:55:21 -0700 (Fri, 22 Apr 2011)
New Revision: 16093

Modified:
   django/trunk/django/contrib/admin/views/main.py
   django/trunk/tests/regressiontests/admin_changelist/tests.py
Log:
Fixed #15819 - Fixed 1.3 regression from r15526 causing duplicate search 
results in admin with search_fields traversing to non-M2M related models. 
Thanks to Adam Kochanowski for the report and Ryan Kaskel for the patch.

Modified: django/trunk/django/contrib/admin/views/main.py
===
--- django/trunk/django/contrib/admin/views/main.py 2011-04-22 21:25:16 UTC 
(rev 16092)
+++ django/trunk/django/contrib/admin/views/main.py 2011-04-23 03:55:21 UTC 
(rev 16093)
@@ -26,6 +26,15 @@
 # Text to display within change-list table cells if the value is blank.
 EMPTY_CHANGELIST_VALUE = ugettext_lazy('(None)')
 
+def field_needs_distinct(field):
+if ((hasattr(field, 'rel') and
+ isinstance(field.rel, models.ManyToManyRel)) or
+(isinstance(field, models.related.RelatedObject) and
+ not field.field.unique)):
+ return True
+return False
+
+
 class ChangeList(object):
 def __init__(self, request, model, list_display, list_display_links, 
list_filter, date_hierarchy, search_fields, list_select_related, list_per_page, 
list_editable, model_admin):
 self.model = model
@@ -189,8 +198,7 @@
 f = self.lookup_opts.get_field_by_name(field_name)[0]
 except models.FieldDoesNotExist:
 raise IncorrectLookupParameters
-if hasattr(f, 'rel') and isinstance(f.rel, 
models.ManyToManyRel):
-use_distinct = True
+use_distinct = field_needs_distinct(f)
 
 # if key ends with __in, split parameter into separate values
 if key.endswith('__in'):
@@ -264,7 +272,7 @@
 for search_spec in orm_lookups:
 field_name = search_spec.split('__', 1)[0]
 f = self.lookup_opts.get_field_by_name(field_name)[0]
-if hasattr(f, 'rel') and isinstance(f.rel, 
models.ManyToManyRel):
+if field_needs_distinct(f):
 use_distinct = True
 break
 

Modified: django/trunk/tests/regressiontests/admin_changelist/tests.py
===
--- django/trunk/tests/regressiontests/admin_changelist/tests.py
2011-04-22 21:25:16 UTC (rev 16092)
+++ django/trunk/tests/regressiontests/admin_changelist/tests.py
2011-04-23 03:55:21 UTC (rev 16093)
@@ -1,6 +1,6 @@
 from django.contrib import admin
 from django.contrib.admin.options import IncorrectLookupParameters
-from django.contrib.admin.views.main import ChangeList
+from django.contrib.admin.views.main import ChangeList, SEARCH_VAR
 from django.core.paginator import Paginator
 from django.template import Context, Template
 from django.test import TransactionTestCase
@@ -148,12 +148,14 @@
 band.genres.add(blues)
 
 m = BandAdmin(Band, admin.site)
-cl = ChangeList(MockFilteredRequestA(blues.pk), Band, m.list_display,
+request = MockFilterRequest('genres', blues.pk)
+
+cl = ChangeList(request, Band, m.list_display,
 m.list_display_links, m.list_filter, m.date_hierarchy,
 m.search_fields, m.list_select_related, m.list_per_page,
 m.list_editable, m)
 
-cl.get_results(MockFilteredRequestA(blues.pk))
+cl.get_results(request)
 
 # There's only one Group instance
 self.assertEqual(cl.result_count, 1)
@@ -169,12 +171,14 @@
 Membership.objects.create(group=band, music=lead, role='bass player')
 
 m = GroupAdmin(Group, admin.site)
-cl = ChangeList(MockFilteredRequestB(lead.pk), Group, m.list_display,
+request = MockFilterRequest('members', lead.pk)
+
+cl = ChangeList(request, Group, m.list_display,
 m.list_display_links, m.list_filter, m.date_hierarchy,
 m.search_fields, m.list_select_related, m.list_per_page,
 m.list_editable, m)
 
-cl.get_results(MockFilteredRequestB(lead.pk))
+cl.get_results(request)
 
 # There's only one Group instance
 self.assertEqual(cl.result_count, 1)
@@ -191,12 +195,14 @@
 Membership.objects.create(group=four, music=lead, role='guitar player')
 
 m = QuartetAdmin(Quartet, admin.site)
-cl = ChangeList(MockFilteredRequestB(lead.pk), Quartet, m.list_display,
+request = MockFilterRequest('members', lead.pk)
+
+cl = ChangeList(request, Quartet, m.list_display,
 m.list_display_links, m.list_filter, m.date_hierarchy,
 m.search_fields, m.list_select_related, m.list_per_page,
 m.list_editable, m)
 
-cl.get_results(MockFilteredReques

Re: [Django] #15819: Admin searches should use distinct, if query involves joins

2011-04-22 Thread Django
#15819: Admin searches should use distinct, if query involves joins
-+-
   Reporter:  Adam   |  Owner:  ryankask
  Kochanowski | Status:  new
   Type:  Bug|  Component:  contrib.admin
  Milestone: |   Severity:  Normal
Version:  1.3|   Keywords:
 Resolution: |  Has patch:  1
   Triage Stage:  Accepted   |Needs tests:  0
Needs documentation:  0  |  Easy pickings:  0
Patch needs improvement:  0  |
-+-

Comment (by carljm):

 Looks good, I'm preparing to commit this. Unlike #11707, I don't think
 there's an argument to be made for holding this until #15559 is fixed. For
 people in situations where .distinct() is broken for whatever reason, the
 workaround here is simple: don't use search_fields with relations in a way
 that triggers it.

 Thanks for the patch!

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15856: Add a localflavor for Macedonia

2011-04-22 Thread Django
#15856: Add a localflavor for Macedonia
-+-
   Reporter: |  Owner:  nobody
  vasiliyeah | Status:  new
   Type:  New|  Component:  contrib.localflavor
  feature|   Severity:  Normal
  Milestone:  1.4|   Keywords:
Version:  SVN|  Has patch:  1
 Resolution: |Needs tests:  0
   Triage Stage:  Accepted   |  Easy pickings:  0
Needs documentation:  0  |
Patch needs improvement:  1  |
-+-

Comment (by vasiliyeah):

 Disregard the pervious comment. I think what jezdez meant is that tuple
 wasn't prefixed with MK but it should have been. And I thought that I did
 prefix it. I've attached a patch with my latest work. I tried to keep
 stuff consistent with what is in other localflavors and reordered some of
 the code so it's sorted alphabetically.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #8472: Add "Recent Actions" panel to app_index template

2011-04-22 Thread Django
#8472: Add "Recent Actions" panel to app_index template
---+---
   Reporter:  juliae   |  Owner:  burzak
   Type:  New feature  | Status:  assigned
  Milestone:   |  Component:  contrib.admin
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  1
Needs documentation:  0|Needs tests:  1
Patch needs improvement:  0|  Easy pickings:  0
---+---
Changes (by burzak):

 * needs_better_patch:  1 => 0


Comment:

 I improved the patch as jacob suggested. I removed the 'for_current_app'
 option and I added the 'for_app' option that recives the app name.

 I'm not sure what kind of test I can add to this patch, can someone give
 me some advise about this? I don't have much experience, sorry.

 I removed the check of 'patch needs improvement' but I leave the 'needs
 tests' unless someone says that it doesn't need any tests.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #13182: Remove useless whitespaces in JSON dump with indent option

2011-04-22 Thread Django
#13182: Remove useless whitespaces in JSON dump with indent option
-+-
   Reporter:  stephaner  |  Owner:  gptvnt
   Type: | Status:  assigned
  Cleanup/optimization   |  Component:  Core
  Milestone: |  (Serialization)
Version:  SVN|   Severity:  Normal
 Resolution: |   Keywords:
   Triage Stage:  Ready for  |  Has patch:  1
  checkin|Needs tests:  0
Needs documentation:  0  |  Easy pickings:  0
Patch needs improvement:  0  |
-+-
Changes (by anonymous):

 * easy:   => 0


Comment:

 As of
 
[https://github.com/simplejson/simplejson/commit/5cad556f7d60a84eda51adca054c51a192c98c09
 v2.1.5]. this is fixed in simplejson.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #13696: Admin Edit Inline templates only output hidden field for PK when inline_admin_form.has_auto_field

2011-04-22 Thread Django
#13696: Admin Edit Inline templates only output hidden field for PK when
inline_admin_form.has_auto_field
-+-
   Reporter: |  Owner:  nobody
  evan.reiser@…  | Status:  reopened
   Type:  Bug|  Component:  contrib.admin
  Milestone: |   Severity:  Normal
Version:  1.2|   Keywords:  inline templates
 Resolution: |  Has patch:  0
   Triage Stage:  Accepted   |Needs tests:  0
Needs documentation:  0  |  Easy pickings:  1
Patch needs improvement:  0  |
-+-
Changes (by evan.reiser@…):

 * easy:   => 1


Comment:

 This is a very easy fix, all you need to do is change this line:

 {{{
 {% if inline_admin_form.has_auto_field %}{{
 inline_admin_form.pk_field.field }}{% endif %}
 }}}

 to this:

 {{{
 {% if inline_admin_form.pk_field %}{{ inline_admin_form.pk_field.field
 }}{% endif %}
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15789: floatformat filter works incorrectly when decimal precision is set low

2011-04-22 Thread Django
#15789: floatformat filter works incorrectly when decimal precision is set low
+-
   Reporter:  akaihola  |  Owner:  igalarzab
   Type:  Bug   | Status:  assigned
  Milestone:|  Component:  Template system
Version:  SVN   |   Severity:  Normal
 Resolution:|   Keywords:
   Triage Stage:  Accepted  |  Has patch:  1
Needs documentation:  0 |Needs tests:  0
Patch needs improvement:  0 |  Easy pickings:  1
+-
Changes (by igalarzab):

 * status:  new => assigned
 * owner:  nobody => igalarzab
 * has_patch:  0 => 1
 * needs_tests:  1 => 0


Comment:

 Hi,

 I found some more problems. For example, with a precission of two digits,
 this regression test fails:

 self.assertEqual(floatformat(13.1031, -3), u'13.103')

 I think this patch solves these problems.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15856: Add a localflavor for Macedonia

2011-04-22 Thread Django
#15856: Add a localflavor for Macedonia
-+-
   Reporter: |  Owner:  nobody
  vasiliyeah | Status:  new
   Type:  New|  Component:  contrib.localflavor
  feature|   Severity:  Normal
  Milestone:  1.4|   Keywords:
Version:  SVN|  Has patch:  1
 Resolution: |Needs tests:  0
   Triage Stage:  Accepted   |  Easy pickings:  0
Needs documentation:  0  |
Patch needs improvement:  1  |
-+-

Comment (by vasiliyeah):

 Replying to [comment:4 jezdez]:
 > Please attach the patch here for the sake of completeness.
 >
 > Unless there is a specific reason, please don't prefix the
 MUNICIPALITY_CHOICES  with "MK.".
 >
 > Also, the translation updates shouldn't be part of the patch.

 Are you sure about the prefix? I can remove it without a problem, but I
 did that in order to be consistent with the existing codebase for
 localflavor. Looking at choices tuples for other localflavors I can see
 that tupples are prefixed with the country code example:

 {{{HR_COUNTY_CHOICES}}} (this is a new one)

 {{{IS_POSTALCODES}}}

 {{{US_TERRITORIES}}}

 etc...

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r16092 - django/branches/releases/1.3.X/docs/ref

2011-04-22 Thread noreply
Author: SmileyChris
Date: 2011-04-22 14:25:16 -0700 (Fri, 22 Apr 2011)
New Revision: 16092

Modified:
   django/branches/releases/1.3.X/docs/ref/signals.txt
Log:
[1.3.X] Fixes #15862 -- Error in post_syncdb documentation example. Thanks for 
the report and patch andialbrecht.

Backport of r16091 from trunk.

Modified: django/branches/releases/1.3.X/docs/ref/signals.txt
===
--- django/branches/releases/1.3.X/docs/ref/signals.txt 2011-04-22 21:23:26 UTC 
(rev 16091)
+++ django/branches/releases/1.3.X/docs/ref/signals.txt 2011-04-22 21:25:16 UTC 
(rev 16092)
@@ -388,7 +388,7 @@
 For example, the :mod:`django.contrib.auth` app only prompts to create a
 superuser when ``interactive`` is ``True``.
 
-For example, yourapp/signals/__init__.py could be written like::
+For example, ``yourapp/management/__init__.py`` could be written like::
 
 from django.db.models.signals import post_syncdb
 import yourapp.models

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r16091 - django/trunk/docs/ref

2011-04-22 Thread noreply
Author: SmileyChris
Date: 2011-04-22 14:23:26 -0700 (Fri, 22 Apr 2011)
New Revision: 16091

Modified:
   django/trunk/docs/ref/signals.txt
Log:
Fixes #15862 -- Error in post_syncdb documentation example. Thanks for the 
report and patch andialbrecht.

Modified: django/trunk/docs/ref/signals.txt
===
--- django/trunk/docs/ref/signals.txt   2011-04-22 21:18:27 UTC (rev 16090)
+++ django/trunk/docs/ref/signals.txt   2011-04-22 21:23:26 UTC (rev 16091)
@@ -389,7 +389,7 @@
 For example, the :mod:`django.contrib.auth` app only prompts to create a
 superuser when ``interactive`` is ``True``.
 
-For example, yourapp/signals/__init__.py could be written like::
+For example, ``yourapp/management/__init__.py`` could be written like::
 
 from django.db.models.signals import post_syncdb
 import yourapp.models

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15880: manage.py: difficult to run in background (and crashes when input isn't a terminal)

2011-04-22 Thread Django
#15880: manage.py: difficult to run in background (and crashes when input isn't 
a
terminal)
-+-
   Reporter: |  Owner:  nobody
  dstndstn@… | Status:  new
   Type:  Bug|  Component:  Core (Management
  Milestone: |  commands)
Version:  1.3|   Severity:  Normal
 Resolution: |   Keywords:
   Triage Stage:  Accepted   |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
-+-

Comment (by kmtracey):

 This was likely caused by r15883. The exception with piping to /dev/null
 has already been fixed on trunk and 1.3.X. The suspending on reload it
 seems can be fixed by ignoring SIGTTOU/SIGTTIN (or maybe just one of
 those, I don't have time to experiment right now) though I have no idea
 what side-effects that has. Or if anyone else has a better suggestion for
 fixing this or the original problem fixed by r15883 feel free to chime in.
 I'd prefer to prevent the original problem, but since I don't know what
 causes terminal echo to get turned off on reload, I don't know how to
 prevent it.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Django] #15887: Improve django.views.decorators.http docs

2011-04-22 Thread Django
#15887: Improve  django.views.decorators.http docs
--+--
 Reporter:  RoySmith  |  Owner:  nobody
 Type:  Bug   | Status:  new
Milestone:|  Component:  Core (Other)
  Version:  1.3   |   Severity:  Normal
 Keywords:|   Triage Stage:  Unreviewed
Has patch:  0 |  Easy pickings:  0
--+--
 {{{
 require_http_methods()
 require_GET()
 require_POST()
 }}}

 None of these describe what happens if you try to access the view with the
 wrong method.  Throw some exception?  Return a 404?  Cause daemons to fly
 out of your nose?  Some additional clarity here would be useful.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r16090 - in django/trunk: django/forms docs/ref/forms tests/regressiontests/forms/tests

2011-04-22 Thread noreply
Author: SmileyChris
Date: 2011-04-22 14:18:27 -0700 (Fri, 22 Apr 2011)
New Revision: 16090

Modified:
   django/trunk/django/forms/fields.py
   django/trunk/docs/ref/forms/fields.txt
   django/trunk/tests/regressiontests/forms/tests/fields.py
Log:
Fixed #13584 -- Optionally allow empty files with django.forms.FileField. 
Thanks for the patch erickr and closedbracket.

Modified: django/trunk/django/forms/fields.py
===
--- django/trunk/django/forms/fields.py 2011-04-22 21:05:29 UTC (rev 16089)
+++ django/trunk/django/forms/fields.py 2011-04-22 21:18:27 UTC (rev 16090)
@@ -450,6 +450,7 @@
 
 def __init__(self, *args, **kwargs):
 self.max_length = kwargs.pop('max_length', None)
+self.allow_empty_file = kwargs.pop('allow_empty_file', False)
 super(FileField, self).__init__(*args, **kwargs)
 
 def to_python(self, data):
@@ -468,7 +469,7 @@
 raise ValidationError(self.error_messages['max_length'] % 
error_values)
 if not file_name:
 raise ValidationError(self.error_messages['invalid'])
-if not file_size:
+if not self.allow_empty_file and not file_size:
 raise ValidationError(self.error_messages['empty'])
 
 return data

Modified: django/trunk/docs/ref/forms/fields.txt
===
--- django/trunk/docs/ref/forms/fields.txt  2011-04-22 21:05:29 UTC (rev 
16089)
+++ django/trunk/docs/ref/forms/fields.txt  2011-04-22 21:18:27 UTC (rev 
16090)
@@ -503,10 +503,15 @@
 * Empty value: ``None``
 * Normalizes to: An ``UploadedFile`` object that wraps the file content
   and file name into a single object.
-* Validates that non-empty file data has been bound to the form.
+* Can validate that non-empty file data has been bound to the form.
 * Error message keys: ``required``, ``invalid``, ``missing``, ``empty``,
   ``max_length``
 
+Has two optional arguments for validation, ''max_length'' and 
+''allow_empty_file''. If provided, these ensure that the file name is at 
+most the given length, and that validation will succeed even if the file 
+content is empty.
+
 To learn more about the ``UploadedFile`` object, see the :doc:`file uploads
 documentation `.
 

Modified: django/trunk/tests/regressiontests/forms/tests/fields.py
===
--- django/trunk/tests/regressiontests/forms/tests/fields.py2011-04-22 
21:05:29 UTC (rev 16089)
+++ django/trunk/tests/regressiontests/forms/tests/fields.py2011-04-22 
21:18:27 UTC (rev 16090)
@@ -506,6 +506,11 @@
 self.assertEqual('files/test2.pdf', f.clean(None, 'files/test2.pdf'))
 self.assertEqual(SimpleUploadedFile, 
type(f.clean(SimpleUploadedFile('name', 'Some File Content'
 
+def test_filefield_3(self):
+f = FileField(allow_empty_file=True)
+self.assertEqual(SimpleUploadedFile,
+ type(f.clean(SimpleUploadedFile('name', ''
+
 # URLField 
##
 
 def test_urlfield_1(self):

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r16089 - in django/branches/releases/1.3.X: django/template django/test tests/regressiontests/templates

2011-04-22 Thread noreply
Author: SmileyChris
Date: 2011-04-22 14:05:29 -0700 (Fri, 22 Apr 2011)
New Revision: 16089

Modified:
   django/branches/releases/1.3.X/django/template/context.py
   django/branches/releases/1.3.X/django/test/utils.py
   django/branches/releases/1.3.X/tests/regressiontests/templates/tests.py
Log:
[1.3.X] Fixes regression #15721 -- {% include %} and RequestContext not working 
together. Refs #15814.

Backport of r16031, plus the utility from r16030.

Modified: django/branches/releases/1.3.X/django/template/context.py
===
--- django/branches/releases/1.3.X/django/template/context.py   2011-04-22 
18:17:26 UTC (rev 16088)
+++ django/branches/releases/1.3.X/django/template/context.py   2011-04-22 
21:05:29 UTC (rev 16089)
@@ -14,21 +14,16 @@
 "pop() has been called more times than push()"
 pass
 
-class EmptyClass(object):
-# No-op class which takes no args to its __init__ method, to help implement
-# __copy__
-pass
-
 class BaseContext(object):
 def __init__(self, dict_=None):
-dict_ = dict_ or {}
-self.dicts = [dict_]
+self._reset_dicts(dict_)
 
+def _reset_dicts(self, value=None):
+self.dicts = [value or {}]
+
 def __copy__(self):
-duplicate = EmptyClass()
-duplicate.__class__ = self.__class__
-duplicate.__dict__ = self.__dict__.copy()
-duplicate.dicts = duplicate.dicts[:]
+duplicate = copy(super(BaseContext, self))
+duplicate.dicts = self.dicts[:]
 return duplicate
 
 def __repr__(self):
@@ -78,6 +73,15 @@
 return d[key]
 return otherwise
 
+def new(self, values=None):
+"""
+Returns a new context with the same properties, but with only the
+values given in 'values' stored.
+"""
+new_context = copy(self)
+new_context._reset_dicts(values)
+return new_context
+
 class Context(BaseContext):
 "A stack container for variable context"
 def __init__(self, dict_=None, autoescape=True, current_app=None, 
use_l10n=None):
@@ -99,14 +103,6 @@
 self.dicts.append(other_dict)
 return other_dict
 
-def new(self, values=None):
-"""
-Returns a new Context with the same 'autoescape' value etc, but with
-only the values given in 'values' stored.
-"""
-return self.__class__(dict_=values, autoescape=self.autoescape,
-  current_app=self.current_app, 
use_l10n=self.use_l10n)
-
 class RenderContext(BaseContext):
 """
 A stack container for storing Template state.

Modified: django/branches/releases/1.3.X/django/test/utils.py
===
--- django/branches/releases/1.3.X/django/test/utils.py 2011-04-22 18:17:26 UTC 
(rev 16088)
+++ django/branches/releases/1.3.X/django/test/utils.py 2011-04-22 21:05:29 UTC 
(rev 16089)
@@ -6,13 +6,16 @@
 from django.core import mail
 from django.core.mail.backends import locmem
 from django.test import signals
-from django.template import Template
+from django.template import Template, loader, TemplateDoesNotExist
+from django.template.loaders import cached
 from django.utils.translation import deactivate
 
 __all__ = ('Approximate', 'ContextList', 'setup_test_environment',
'teardown_test_environment', 'get_runner')
 
+RESTORE_LOADERS_ATTR = '_original_template_source_loaders'
 
+
 class Approximate(object):
 def __init__(self, val, places=7):
 self.val = val
@@ -125,3 +128,41 @@
 test_module = __import__(test_module_name, {}, {}, test_path[-1])
 test_runner = getattr(test_module, test_path[-1])
 return test_runner
+
+
+def setup_test_template_loader(templates_dict, use_cached_loader=False):
+"""
+Changes Django to only find templates from within a dictionary (where each
+key is the template name and each value is the corresponding template
+content to return).
+
+Use meth:`restore_template_loaders` to restore the original loaders.
+"""
+if hasattr(loader, RESTORE_LOADERS_ATTR):
+raise Exception("loader.%s already exists" % RESTORE_LOADERS_ATTR)
+
+def test_template_loader(template_name, template_dirs=None):
+"A custom template loader that loads templates from a dictionary."
+try:
+return (templates_dict[template_name], "test:%s" % template_name)
+except KeyError:
+raise TemplateDoesNotExist(template_name)
+
+if use_cached_loader:
+template_loader = cached.Loader(('test_template_loader',))
+template_loader._cached_loaders = (test_template_loader,)
+else:
+template_loader = test_template_loader
+
+setattr(loader, RESTORE_LOADERS_ATTR, loader.template_source_loaders)
+loader.template_source_loaders = (template_loader,)
+return template_loader
+
+
+def restore_template_loaders():
+"""
+Restores the original t

[Django] #15886: Improve django.core.serializers.get_serializer() docs

2011-04-22 Thread Django
#15886: Improve django.core.serializers.get_serializer() docs
--+--
 Reporter:  RoySmith  |  Owner:  nobody
 Type:  Bug   | Status:  new
Milestone:|  Component:  Core (Serialization)
  Version:  1.3   |   Severity:  Normal
 Keywords:|   Triage Stage:  Unreviewed
Has patch:  0 |  Easy pickings:  0
--+--
 By experimentation, it appears that calling get_serializer() with an
 unknown format raises KeyError, but this is not documented.  It should be
 documented what the behavior is.

 Even better (maybe this should be a separate issue), it should raise some
 more specific exception, which would make it easier to handle at a higher
 level (such as middleware).

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #10899: easier manipulation of sessions by test client

2011-04-22 Thread Django
#10899: easier manipulation of sessions by test client
---+---
   Reporter:  tallfred |  Owner:  nobody
   Type:  New feature  | Status:  reopened
  Milestone:   |  Component:  Testing framework
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  1
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
---+---
Changes (by prestontimmons):

 * cc: prestontimmons (added)


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #7267: clean_html() bug

2011-04-22 Thread Django
#7267: clean_html() bug
-+-
   Reporter:  Nikolay|  Owner:  nobody
| Status:  new
   Type:  Bug|  Component:  Core (Other)
  Milestone: |   Severity:  Normal
Version:  SVN|   Keywords:  html
 Resolution: |  Has patch:  1
   Triage Stage:  Accepted   |Needs tests:  0
Needs documentation:  0  |  Easy pickings:  0
Patch needs improvement:  1  |
-+-
Changes (by prestontimmons):

 * cc: prestontimmons (added)
 * needs_better_patch:  0 => 1
 * easy:   => 0


Comment:

 Thanks for updating the patch. The approach looks good but when I apply it
 I get the following test failure:

 {{{#!python
 
F.
 ==
 FAIL: test_clean_html (regressiontests.utils.html.TestUtilsHtml)
 --
 Traceback (most recent call last):
   File
 "/root/pycon2011/djangoenv/src/django/tests/regressiontests/utils/html.py",
 line 135, in test_clean_html
 self.check_output(f, value, output)
   File
 "/root/pycon2011/djangoenv/src/django/tests/regressiontests/utils/html.py",
 line 14, in check_output
 self.assertEqual(function(value), output)
 AssertionError: u'I killwhitespace' != u'I kill
 whitespace'
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Django] #15885: Update the docs to explain that auth views now return TemplateResponse

2011-04-22 Thread Django
#15885: Update the docs to explain that auth views now return TemplateResponse
+---
 Reporter:  prestontimmons  |  Owner:  nobody
 Type:  New feature | Status:  new
Milestone:  |  Component:  Documentation
  Version:  1.3 |   Severity:  Normal
 Keywords:  |   Triage Stage:  Unreviewed
Has patch:  1   |  Easy pickings:  1
+---
 Changeset r16087 modified the auth views to return a TemplateResponse
 rather than an HttpResponse.

 Document the change in the Authentication topic page.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15815: Support memcached binary protocol in PyLibMCCache

2011-04-22 Thread Django
#15815: Support memcached binary protocol in PyLibMCCache
-+-
   Reporter:  mtigas |  Owner:  nobody
   Type:  New| Status:  new
  feature|  Component:  Core (Cache system)
  Milestone: |   Severity:  Normal
Version:  1.3|   Keywords:
 Resolution: |  Has patch:  1
   Triage Stage:  Accepted   |Needs tests:  1
Needs documentation:  1  |  Easy pickings:  0
Patch needs improvement:  1  |
-+-

Comment (by mtigas):

 I’ll agree with that, though I wasn’t sure how to make this semantically
 better.

 For the older cache framework, django-newcache accepted `binary` as a
 cache param (with `timeout`, `cull_frequency`, et. al.), with
 `CACHE_BEHAVIORS` as a separate settings option. (Using django-newcache as
 a comparison point since some of the newer 1.3+ cache features like
 versioning and key prefixing appear to have been based on the `newcache`
 implementation.)

 But I didn’t quite feel that special casing `PyLibMCCache` to accept a new
 base parameter was correct, either …

 {{{
 CACHES = {
 'default' : {
 "BACKEND" : 'django.core.cache.backends.memcached.PyLibMCCache',
 "LOCATION" : '127.0.0.1:11211',
 "BINARY" : True,
 "OPTIONS" : dict(tcp_nodelay=True, ketama=True),
 }
 }
 }}}

 … since the description of `OPTIONS` reads, “Any options that should be
 passed to cache backend. The list options understood by each backend vary
 with each backend. […] Cache backends backed by a third-party library will
 pass their options directly to the underlying cache library.”

 In particular, that seems to imply that for consistency’s sake, all
 implementation-specific options regarding a backend should go into
 `OPTIONS` and that it’s up to the backend to do what it needs to provide
 the correct information to the underlying library.

 Technically, a more semantically-correct option would be to do something
 like:

 {{{
 CACHES = {
 'default' : {
 "BACKEND" : 'django.core.cache.backends.memcached.PyLibMCCache',
 "LOCATION" : '127.0.0.1:11211',
 "OPTIONS" : {
 "binary": True,
 "behaviors" : dict(tcp_nodelay=True, ketama=True),
 }
 }
 }
 }}}

 Not really sure what the best patch would be at this point.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15884: Model validation allows nullable primary key field.

2011-04-22 Thread Django
#15884: Model validation allows nullable primary key field.
-+-
   Reporter: |  Owner:  JustinTArthur
  JustinTArthur  | Status:  assigned
   Type:  Bug|  Component:  Database layer
  Milestone: |  (models, ORM)
Version:  1.3|   Severity:  Normal
 Resolution: |   Keywords:
   Triage Stage: |  Has patch:  1
  Unreviewed |Needs tests:  0
Needs documentation:  0  |  Easy pickings:  0
Patch needs improvement:  0  |
-+-
Changes (by JustinTArthur):

 * has_patch:  0 => 1
 * component:  Uncategorized => Database layer (models, ORM)


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15884: Model validation allows nullable primary key field.

2011-04-22 Thread Django
#15884: Model validation allows nullable primary key field.
-+---
   Reporter:  JustinTArthur  |  Owner:  JustinTArthur
   Type:  Bug| Status:  assigned
  Milestone: |  Component:  Uncategorized
Version:  1.3|   Severity:  Normal
 Resolution: |   Keywords:
   Triage Stage:  Unreviewed |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
-+---
Changes (by JustinTArthur):

 * status:  new => assigned
 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 The correct link for the `CASCADE` interest point is actually
 source:/django/trunk/django/db/models/deletion.py@15927#L19

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Django] #15884: Model validation allows nullable primary key field.

2011-04-22 Thread Django
#15884: Model validation allows nullable primary key field.
---+---
 Reporter:  JustinTArthur  |  Owner:  JustinTArthur
 Type:  Bug| Status:  new
Milestone: |  Component:  Uncategorized
  Version:  1.3|   Severity:  Normal
 Keywords: |   Triage Stage:  Unreviewed
Has patch:  0  |  Easy pickings:  0
---+---
 If I have a primary key field that is also nullable, the model validation
 code is currently allowing it:
 {{{
 #!python
 class MyModel(models.Model):
 other_model = OneToOneField(OtherModel, primary_key=True, null=True)
 }}}

 This behavior seems like a defect given two circumstances:
  * No SQL implementation I know of allows a primary key column to be
 `NULL` in the schema.
  * Django's `CASCADE` deletion will `None`/`NULL` out any `null=True`
 foreign keys (see source:/trunk/django/db/models/deletion.py@15927#L19),
   * While a SQL backend might correctly map the `None` to a `0` instead of
 `NULL` in the `UPDATE` statement, after a second deletion against the same
 table, you would have more than one row with primary key of `0`, thus
 violating the uniqueness constraint intrinsic to a primary key field.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r16088 - in django/trunk: django/db/models django/db/models/sql tests/regressiontests/queries

2011-04-22 Thread noreply
Author: jezdez
Date: 2011-04-22 11:17:26 -0700 (Fri, 22 Apr 2011)
New Revision: 16088

Modified:
   django/trunk/django/db/models/query.py
   django/trunk/django/db/models/sql/query.py
   django/trunk/tests/regressiontests/queries/tests.py
Log:
Fixed #14729 -- RawQuerySet.__repr__ fails when params passed as list. Thanks, 
intgr for ticket and accuser for patch.

Modified: django/trunk/django/db/models/query.py
===
--- django/trunk/django/db/models/query.py  2011-04-22 18:17:16 UTC (rev 
16087)
+++ django/trunk/django/db/models/query.py  2011-04-22 18:17:26 UTC (rev 
16088)
@@ -1385,7 +1385,7 @@
 yield instance
 
 def __repr__(self):
-return "" % (self.raw_query % self.params)
+return "" % (self.raw_query % tuple(self.params))
 
 def __getitem__(self, k):
 return list(self)[k]

Modified: django/trunk/django/db/models/sql/query.py
===
--- django/trunk/django/db/models/sql/query.py  2011-04-22 18:17:16 UTC (rev 
16087)
+++ django/trunk/django/db/models/sql/query.py  2011-04-22 18:17:26 UTC (rev 
16088)
@@ -74,7 +74,7 @@
 return iter(result)
 
 def __repr__(self):
-return "" % (self.sql % self.params)
+return "" % (self.sql % tuple(self.params))
 
 def _execute_query(self):
 self.cursor = connections[self.using].cursor()

Modified: django/trunk/tests/regressiontests/queries/tests.py
===
--- django/trunk/tests/regressiontests/queries/tests.py 2011-04-22 18:17:16 UTC 
(rev 16087)
+++ django/trunk/tests/regressiontests/queries/tests.py 2011-04-22 18:17:26 UTC 
(rev 16088)
@@ -1317,6 +1317,23 @@
 self.assertIsNot(q1, q1.all())
 
 
+class RawQueriesTests(TestCase):
+def setUp(self):
+n1 = Note.objects.create(note='n1', misc='foo', id=1)
+
+def test_ticket14729(self):
+# Test representation of raw query with one or few parameters passed 
as list
+query = "SELECT * FROM queries_note WHERE note = %s"
+params = ['n1']
+qs = Note.objects.raw(query, params=params)
+self.assertEqual(repr(qs), "")
+
+query = "SELECT * FROM queries_note WHERE note = %s and misc = %s"
+params = ['n1', 'foo']
+qs = Note.objects.raw(query, params=params)
+self.assertEqual(repr(qs), "")
+
+
 class GeneratorExpressionTests(TestCase):
 def test_ticket10432(self):
 # Using an empty generator expression as the rvalue for an "__in"

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r16087 - in django/trunk: django/contrib/admin django/contrib/auth docs/ref/contrib/admin tests/regressiontests/admin_views

2011-04-22 Thread noreply
Author: jezdez
Date: 2011-04-22 11:17:16 -0700 (Fri, 22 Apr 2011)
New Revision: 16087

Modified:
   django/trunk/django/contrib/admin/actions.py
   django/trunk/django/contrib/admin/options.py
   django/trunk/django/contrib/admin/sites.py
   django/trunk/django/contrib/auth/admin.py
   django/trunk/django/contrib/auth/views.py
   django/trunk/docs/ref/contrib/admin/index.txt
   django/trunk/tests/regressiontests/admin_views/tests.py
Log:
Fixed #15008 -- Replaced all calls in the admin to render_to_response with 
TemplateResponses for easier customization. Thanks to Chris Adams for the 
initial patch.

Modified: django/trunk/django/contrib/admin/actions.py
===
--- django/trunk/django/contrib/admin/actions.py2011-04-22 14:08:31 UTC 
(rev 16086)
+++ django/trunk/django/contrib/admin/actions.py2011-04-22 18:17:16 UTC 
(rev 16087)
@@ -2,12 +2,11 @@
 Built-in, globally-available admin actions.
 """
 
-from django import template
 from django.core.exceptions import PermissionDenied
 from django.contrib.admin import helpers
 from django.contrib.admin.util import get_deleted_objects, model_ngettext
 from django.db import router
-from django.shortcuts import render_to_response
+from django.template.response import TemplateResponse
 from django.utils.encoding import force_unicode
 from django.utils.translation import ugettext_lazy, ugettext as _
 
@@ -76,10 +75,10 @@
 }
 
 # Display the confirmation page
-return render_to_response(modeladmin.delete_selected_confirmation_template 
or [
+return TemplateResponse(request, 
modeladmin.delete_selected_confirmation_template or [
 "admin/%s/%s/delete_selected_confirmation.html" % (app_label, 
opts.object_name.lower()),
 "admin/%s/delete_selected_confirmation.html" % app_label,
 "admin/delete_selected_confirmation.html"
-], context, context_instance=template.RequestContext(request))
+], context, current_app=modeladmin.admin_site.name)
 
 delete_selected.short_description = ugettext_lazy("Delete selected 
%(verbose_name_plural)s")

Modified: django/trunk/django/contrib/admin/options.py
===
--- django/trunk/django/contrib/admin/options.py2011-04-22 14:08:31 UTC 
(rev 16086)
+++ django/trunk/django/contrib/admin/options.py2011-04-22 18:17:16 UTC 
(rev 16087)
@@ -1,5 +1,5 @@
 from functools import update_wrapper, partial
-from django import forms, template
+from django import forms
 from django.forms.formsets import all_valid
 from django.forms.models import (modelform_factory, modelformset_factory,
 inlineformset_factory, BaseInlineFormSet)
@@ -15,7 +15,8 @@
 from django.db.models.fields import BLANK_CHOICE_DASH, FieldDoesNotExist
 from django.db.models.sql.constants import LOOKUP_SEP, QUERY_TERMS
 from django.http import Http404, HttpResponse, HttpResponseRedirect
-from django.shortcuts import get_object_or_404, render_to_response
+from django.shortcuts import get_object_or_404
+from django.template.response import SimpleTemplateResponse, TemplateResponse
 from django.utils.decorators import method_decorator
 from django.utils.datastructures import SortedDict
 from django.utils.html import escape, escapejs
@@ -708,12 +709,12 @@
 form_template = self.add_form_template
 else:
 form_template = self.change_form_template
-context_instance = template.RequestContext(request, 
current_app=self.admin_site.name)
-return render_to_response(form_template or [
+
+return TemplateResponse(request, form_template or [
 "admin/%s/%s/change_form.html" % (app_label, 
opts.object_name.lower()),
 "admin/%s/change_form.html" % app_label,
 "admin/change_form.html"
-], context, context_instance=context_instance)
+], context, current_app=self.admin_site.name)
 
 def response_add(self, request, obj, post_url_continue='../%s/'):
 """
@@ -1074,7 +1075,9 @@
 # something is screwed up with the database, so display an error
 # page.
 if ERROR_FLAG in request.GET.keys():
-return render_to_response('admin/invalid_setup.html', 
{'title': _('Database error')})
+return SimpleTemplateResponse('admin/invalid_setup.html', {
+'title': _('Database error'),
+})
 return HttpResponseRedirect(request.path + '?' + ERROR_FLAG + '=1')
 
 # If the request was POSTed, this might be a bulk action or a bulk
@@ -1183,12 +1186,12 @@
 'actions_selection_counter': self.actions_selection_counter,
 }
 context.update(extra_context or {})
-context_instance = template.RequestContext(request, 
current_app=self.admin_site.name)
-return render_to_response(self.change_list_template or [
+
+return TemplateResponse(request, self.change_list_templ

Re: [Django] #15856: Add a localflavor for Macedonia

2011-04-22 Thread Django
#15856: Add a localflavor for Macedonia
-+-
   Reporter: |  Owner:  nobody
  vasiliyeah | Status:  new
   Type:  New|  Component:  contrib.localflavor
  feature|   Severity:  Normal
  Milestone:  1.4|   Keywords:
Version:  SVN|  Has patch:  1
 Resolution: |Needs tests:  0
   Triage Stage:  Accepted   |  Easy pickings:  0
Needs documentation:  0  |
Patch needs improvement:  1  |
-+-

Comment (by jezdez):

 Please attach the patch here for the sake of completeness.

 Unless there is a specific reason, please don't prefix the
 MUNICIPALITY_CHOICES  with "MK.".

 Also, the translation updates shouldn't be part of the patch.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15875: F() example in db queries topic guide has an error

2011-04-22 Thread Django
#15875: F() example in db queries topic guide has an error
-+-
   Reporter:  jblaine|  Owner:  nobody
   Type:  Bug| Status:  new
  Milestone: |  Component:  Documentation
Version:  1.3|   Severity:  Normal
 Resolution: |   Keywords:
   Triage Stage:  Ready for  |  Has patch:  1
  checkin|Needs tests:  0
Needs documentation:  0  |  Easy pickings:  1
Patch needs improvement:  0  |
-+-
Changes (by jacob):

 * stage:  Accepted => Ready for checkin


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #10899: easier manipulation of sessions by test client

2011-04-22 Thread Django
#10899: easier manipulation of sessions by test client
---+---
   Reporter:  tallfred |  Owner:  nobody
   Type:  New feature  | Status:  reopened
  Milestone:   |  Component:  Testing framework
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  1
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
---+---
Changes (by prestontimmons):

 * needs_better_patch:  1 => 0
 * needs_docs:  1 => 0


Comment:

 Attached is an updated patch against r16086. I'd appreciate if somebody
 could review this.

 My questions are:

 1) Are the doc's I added enough? What needs to be said on this? Should the
 old example be removed?

 2) Since the session is being cached on the Client, problems arise with
 functions that change the session key. This patch makes sure the session
 key is updated both when a view is called and when the login/logout Client
 methods are called. Are there any other functions that change the session
 key I need to be aware of?

 Thanks.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15008: Convert admin views to use TemplateResponse

2011-04-22 Thread Django
#15008: Convert admin views to use TemplateResponse
-+-
   Reporter:  acdha  |  Owner:  acdha
   Type: | Status:  assigned
  Cleanup/optimization   |  Component:  contrib.admin
  Milestone: |   Severity:  Normal
Version:  SVN|   Keywords:  templateresponse
 Resolution: |  Has patch:  1
   Triage Stage:  Accepted   |Needs tests:  0
Needs documentation:  1  |  Easy pickings:  0
Patch needs improvement:  1  |
-+-
Changes (by acdha):

 * easy:   => 0


Comment:

 I've updated the patch against the current trunk (note the new git branch
 name with the ticket number):

 https://github.com/acdha/django/compare/master...15008-admin-template-
 response

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r16086 - in django/trunk/docs: ref ref/contrib topics/db

2011-04-22 Thread noreply
Author: ramiro
Date: 2011-04-22 07:08:31 -0700 (Fri, 22 Apr 2011)
New Revision: 16086

Modified:
   django/trunk/docs/ref/contrib/humanize.txt
   django/trunk/docs/ref/request-response.txt
   django/trunk/docs/topics/db/queries.txt
Log:
Fixed a couple of small documentation typos.

Modified: django/trunk/docs/ref/contrib/humanize.txt
===
--- django/trunk/docs/ref/contrib/humanize.txt  2011-04-22 12:28:58 UTC (rev 
16085)
+++ django/trunk/docs/ref/contrib/humanize.txt  2011-04-22 14:08:31 UTC (rev 
16086)
@@ -101,7 +101,7 @@
 * ``17 Feb 2007 16:29:31`` becomes ``29 seconds ago``.
 * ``17 Feb 2007 16:29:00`` becomes ``a minute ago``.
 * ``17 Feb 2007 16:25:35`` becomes ``4 minutes ago``.
-* ``17 Feb 2007 15:30:29`` becomes ``an hours ago``.
+* ``17 Feb 2007 15:30:29`` becomes ``an hour ago``.
 * ``17 Feb 2007 13:31:29`` becomes ``2 hours ago``.
 * ``16 Feb 2007 13:31:29`` becomes ``yesterday``.
 * Any other day is formatted according to given argument or the

Modified: django/trunk/docs/ref/request-response.txt
===
--- django/trunk/docs/ref/request-response.txt  2011-04-22 12:28:58 UTC (rev 
16085)
+++ django/trunk/docs/ref/request-response.txt  2011-04-22 14:08:31 UTC (rev 
16086)
@@ -497,7 +497,7 @@
 
 * The iterator should return strings.
 * If an :class:`HttpResponse` has been initialized with an iterator as its
-  content, you can't use the class:`HttpResponse` instance as a file-like
+  content, you can't use the :class:`HttpResponse` instance as a file-like
   object. Doing so will raise ``Exception``.
 
 Setting headers

Modified: django/trunk/docs/topics/db/queries.txt
===
--- django/trunk/docs/topics/db/queries.txt 2011-04-22 12:28:58 UTC (rev 
16085)
+++ django/trunk/docs/topics/db/queries.txt 2011-04-22 14:08:31 UTC (rev 
16086)
@@ -75,7 +75,7 @@
 ``save()`` takes a number of advanced options not described here.
 See the documentation for ``save()`` for complete details.
 
-To create an object and save it all in one step see the ```create()```
+To create an object and save it all in one step see the ``create()``
 method.
 
 Saving changes to objects
@@ -572,7 +572,7 @@
 For date and date/time fields, you can add or subtract a ``datetime.timedelta``
 object.  The following would return all entries that were modified more than 3 
days
 after they were published::
-   
+
 >>> from datetime import timedelta
 >>> Entry.objects.filter(mod_date__gt=F('pub_date') + timedelta(days=3))
 

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15836: Raw query documentation indicates wrong type for params

2011-04-22 Thread Django
#15836: Raw query documentation indicates wrong type for params
-+---
   Reporter:  riverfr0zen@…  |  Owner:  nobody
   Type:  Bug| Status:  new
  Milestone:  1.4|  Component:  Documentation
Version:  1.3|   Severity:  Normal
 Resolution: |   Keywords:
   Triage Stage:  Accepted   |  Has patch:  0
Needs documentation:  0  |Needs tests:  1
Patch needs improvement:  0  |  Easy pickings:  0
-+---
Changes (by jacob):

 * needs_tests:  0 => 1
 * stage:  Ready for checkin => Accepted


Comment:

 Er, wait, no it's not - needs a quick test first.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15836: Raw query documentation indicates wrong type for params

2011-04-22 Thread Django
#15836: Raw query documentation indicates wrong type for params
-+-
   Reporter: |  Owner:  nobody
  riverfr0zen@…  | Status:  new
   Type:  Bug|  Component:  Documentation
  Milestone:  1.4|   Severity:  Normal
Version:  1.3|   Keywords:
 Resolution: |  Has patch:  0
   Triage Stage:  Ready for  |Needs tests:  0
  checkin|  Easy pickings:  0
Needs documentation:  0  |
Patch needs improvement:  0  |
-+-
Changes (by jacob):

 * stage:  Accepted => Ready for checkin
 * milestone:   => 1.4


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #8472: Add "Recent Actions" panel to app_index template

2011-04-22 Thread Django
#8472: Add "Recent Actions" panel to app_index template
---+---
   Reporter:  juliae   |  Owner:  burzak
   Type:  New feature  | Status:  assigned
  Milestone:   |  Component:  contrib.admin
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  1
Needs documentation:  0|Needs tests:  1
Patch needs improvement:  1|  Easy pickings:  0
---+---
Changes (by jacob):

 * needs_better_patch:  0 => 1


Comment:

 Ick, I really don't like the way `for_current_app` works. Template tags
 that require specific things from the context aren't a good practice. How
 about ` {% get_admin_log 10 as admin_log for_user 23 for_app "appname" %}
 `? So in the case of admin templates, it'd be `{% get_admin_log ...
 for_app app_list.0.name %}`.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15829: Provide item to sitemap template

2011-04-22 Thread Django
#15829: Provide item to sitemap template
---+--
   Reporter:  manfre   |  Owner:  manfre
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.sitemaps
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:  sitemaps
   Triage Stage:  Accepted |  Has patch:  1
Needs documentation:  0|Needs tests:  1
Patch needs improvement:  0|  Easy pickings:  0
---+--
Changes (by jacob):

 * needs_better_patch:   => 0
 * stage:  Unreviewed => Accepted
 * easy:   => 0
 * needs_tests:   => 1
 * needs_docs:   => 0


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15820: inline admin formset uses incorrect form

2011-04-22 Thread Django
#15820: inline admin formset uses incorrect form
-+-
   Reporter:  shanyu |  Owner:  nobody
   Type:  Bug| Status:  new
  Milestone: |  Component:  contrib.admin
Version:  1.2|   Severity:  Normal
 Resolution: |   Keywords:  inlinemodeladmin,
   Triage Stage:  Accepted   |  inlines
Needs documentation:  0  |  Has patch:  0
Patch needs improvement:  0  |Needs tests:  0
 |  Easy pickings:  0
-+-
Changes (by jacob):

 * needs_better_patch:   => 0
 * stage:  Unreviewed => Accepted
 * easy:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15852: Exception when http.parse_cookie recieves bad cookie

2011-04-22 Thread Django
#15852: Exception when http.parse_cookie recieves bad cookie
-+-
   Reporter:  Fredrik|  Owner:  nobody
  Stålnacke  | Status:  new
   Type:  Bug|  Component:  HTTP handling
  Milestone: |   Severity:  Normal
Version:  1.3|   Keywords:  parse_cookie
 Resolution: |  Has patch:  1
   Triage Stage:  Accepted   |Needs tests:  0
Needs documentation:  0  |  Easy pickings:  0
Patch needs improvement:  1  |
-+-
Changes (by vung):

 * needs_tests:  1 => 0


Comment:

 This is related to #13007.

 Here is a short example:
 {{{
 from django import http
 http.parse_cookie('a:=b; a:=c; d=e')
 }}}


 The problem is that when a `CookieError` is raised
 `http.SimpleCookie._loose_set` bypasses regular code paths to store a key
 whose value is `None`. The normal code path would ensure that the value is
 a `Morcel` object.

 `None` works fine when the key occurs only once, so this isn't catched by
 the test commited in r15523.

 When the same key is encountered a second time, though, this value is used
 in `BaseCookie` under the assumption that it is a `Morsel` instance and
 consequently it has a `set()` method. Of course, `None` doesn't have one,
 hence the bug.

 The immediate fix is to use a `Morcel` instance. It doesn't matter if it
 supports `httponly` or not, it will be removed anyway.

 Fixing this brings a second problem: bad cookies are colected in a list,
 to be removed when loading finishes. This will result in calling `del
 self[key]` more than once for the same key and will fail.

 15852_repeated_bad_key.diff is a short patch that fixes the above.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15817: ImageField having [width|height]_field set sytematically compute the image dimensions in ModelForm validation process

2011-04-22 Thread Django
#15817: ImageField having [width|height]_field set sytematically compute the 
image
dimensions in ModelForm validation process
-+-
   Reporter:  stan   |  Owner:  nobody
 | Status:  new
   Type: |  Component:  Forms
  Cleanup/optimization   |   Severity:  Normal
  Milestone: |   Keywords:  ImageField,
Version:  1.3|  dimension, height_field,
 Resolution: |  width_field, slow
   Triage Stage:  Accepted   |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
-+-
Changes (by emulbreh):

 * needs_better_patch:   => 0
 * stage:  Unreviewed => Accepted
 * easy:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r16085 - django/branches/releases/1.3.X/django/forms

2011-04-22 Thread noreply
Author: jezdez
Date: 2011-04-22 05:28:58 -0700 (Fri, 22 Apr 2011)
New Revision: 16085

Modified:
   django/branches/releases/1.3.X/django/forms/fields.py
Log:
[1.3.X] Fixed #15758 -- Removed stale constants that were missed in r15983.

Backport from trunk (r16084).

Modified: django/branches/releases/1.3.X/django/forms/fields.py
===
--- django/branches/releases/1.3.X/django/forms/fields.py   2011-04-22 
12:27:58 UTC (rev 16084)
+++ django/branches/releases/1.3.X/django/forms/fields.py   2011-04-22 
12:28:58 UTC (rev 16085)
@@ -26,16 +26,14 @@
 from django.core.validators import EMPTY_VALUES
 
 from util import ErrorList
-from widgets import TextInput, PasswordInput, HiddenInput, 
MultipleHiddenInput, \
-ClearableFileInput, CheckboxInput, Select, NullBooleanSelect, 
SelectMultiple, \
-DateInput, DateTimeInput, TimeInput, SplitDateTimeWidget, 
SplitHiddenDateTimeWidget, \
-FILE_INPUT_CONTRADICTION
+from widgets import (TextInput, PasswordInput, HiddenInput,
+MultipleHiddenInput, ClearableFileInput, CheckboxInput, Select,
+NullBooleanSelect, SelectMultiple, DateInput, DateTimeInput, TimeInput,
+SplitDateTimeWidget, SplitHiddenDateTimeWidget, FILE_INPUT_CONTRADICTION)
 
 __all__ = (
 'Field', 'CharField', 'IntegerField',
-'DEFAULT_DATE_INPUT_FORMATS', 'DateField',
-'DEFAULT_TIME_INPUT_FORMATS', 'TimeField',
-'DEFAULT_DATETIME_INPUT_FORMATS', 'DateTimeField', 'TimeField',
+'DateField', 'TimeField', 'DateTimeField', 'TimeField',
 'RegexField', 'EmailField', 'FileField', 'ImageField', 'URLField',
 'BooleanField', 'NullBooleanField', 'ChoiceField', 'MultipleChoiceField',
 'ComboField', 'MultiValueField', 'FloatField', 'DecimalField',
@@ -54,10 +52,6 @@
 )
 return getattr(formats, name)
 
-DEFAULT_DATE_INPUT_FORMATS = lazy(lambda: en_format('DATE_INPUT_FORMATS'), 
tuple, list)()
-DEFAULT_TIME_INPUT_FORMATS = lazy(lambda: en_format('TIME_INPUT_FORMATS'), 
tuple, list)()
-DEFAULT_DATETIME_INPUT_FORMATS = lazy(lambda: 
en_format('DATETIME_INPUT_FORMATS'), tuple, list)()
-
 class Field(object):
 widget = TextInput # Default widget to use when rendering this type of 
Field.
 hidden_widget = HiddenInput # Default widget to use when rendering this as 
"hidden".

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r16084 - django/trunk/django/forms

2011-04-22 Thread noreply
Author: jezdez
Date: 2011-04-22 05:27:58 -0700 (Fri, 22 Apr 2011)
New Revision: 16084

Modified:
   django/trunk/django/forms/fields.py
Log:
Fixed #15758 -- Removed stale constants that were missed in r15983.

Modified: django/trunk/django/forms/fields.py
===
--- django/trunk/django/forms/fields.py 2011-04-22 12:21:58 UTC (rev 16083)
+++ django/trunk/django/forms/fields.py 2011-04-22 12:27:58 UTC (rev 16084)
@@ -26,16 +26,14 @@
 from django.core.validators import EMPTY_VALUES
 
 from util import ErrorList
-from widgets import TextInput, PasswordInput, HiddenInput, 
MultipleHiddenInput, \
-ClearableFileInput, CheckboxInput, Select, NullBooleanSelect, 
SelectMultiple, \
-DateInput, DateTimeInput, TimeInput, SplitDateTimeWidget, 
SplitHiddenDateTimeWidget, \
-FILE_INPUT_CONTRADICTION
+from widgets import (TextInput, PasswordInput, HiddenInput,
+MultipleHiddenInput, ClearableFileInput, CheckboxInput, Select,
+NullBooleanSelect, SelectMultiple, DateInput, DateTimeInput, TimeInput,
+SplitDateTimeWidget, SplitHiddenDateTimeWidget, FILE_INPUT_CONTRADICTION)
 
 __all__ = (
 'Field', 'CharField', 'IntegerField',
-'DEFAULT_DATE_INPUT_FORMATS', 'DateField',
-'DEFAULT_TIME_INPUT_FORMATS', 'TimeField',
-'DEFAULT_DATETIME_INPUT_FORMATS', 'DateTimeField', 'TimeField',
+'DateField', 'TimeField', 'DateTimeField', 'TimeField',
 'RegexField', 'EmailField', 'FileField', 'ImageField', 'URLField',
 'BooleanField', 'NullBooleanField', 'ChoiceField', 'MultipleChoiceField',
 'ComboField', 'MultiValueField', 'FloatField', 'DecimalField',
@@ -44,10 +42,6 @@
 )
 
 
-DEFAULT_DATE_INPUT_FORMATS = lazy(lambda: en_format('DATE_INPUT_FORMATS'), 
tuple, list)()
-DEFAULT_TIME_INPUT_FORMATS = lazy(lambda: en_format('TIME_INPUT_FORMATS'), 
tuple, list)()
-DEFAULT_DATETIME_INPUT_FORMATS = lazy(lambda: 
en_format('DATETIME_INPUT_FORMATS'), tuple, list)()
-
 class Field(object):
 widget = TextInput # Default widget to use when rendering this type of 
Field.
 hidden_widget = HiddenInput # Default widget to use when rendering this as 
"hidden".

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r16083 - in django/branches/releases/1.3.X: django/core/handlers tests/regressiontests/handlers

2011-04-22 Thread noreply
Author: jezdez
Date: 2011-04-22 05:21:58 -0700 (Fri, 22 Apr 2011)
New Revision: 16083

Modified:
   django/branches/releases/1.3.X/django/core/handlers/modpython.py
   django/branches/releases/1.3.X/django/core/handlers/wsgi.py
   django/branches/releases/1.3.X/tests/regressiontests/handlers/tests.py
Log:
[1.3.X] Fixed #15672 -- Refined changes made in r15918. Thanks, vung.

Backport from trunk (r16082).

Modified: django/branches/releases/1.3.X/django/core/handlers/modpython.py
===
--- django/branches/releases/1.3.X/django/core/handlers/modpython.py
2011-04-22 12:15:52 UTC (rev 16082)
+++ django/branches/releases/1.3.X/django/core/handlers/modpython.py
2011-04-22 12:21:58 UTC (rev 16083)
@@ -179,11 +179,10 @@
 try:
 request = self.request_class(req)
 except UnicodeDecodeError:
-logger.warning('Bad Request (UnicodeDecodeError): %s' % 
request.path,
+logger.warning('Bad Request (UnicodeDecodeError)',
 exc_info=sys.exc_info(),
 extra={
 'status_code': 400,
-'request': request
 }
 )
 response = http.HttpResponseBadRequest()

Modified: django/branches/releases/1.3.X/django/core/handlers/wsgi.py
===
--- django/branches/releases/1.3.X/django/core/handlers/wsgi.py 2011-04-22 
12:15:52 UTC (rev 16082)
+++ django/branches/releases/1.3.X/django/core/handlers/wsgi.py 2011-04-22 
12:21:58 UTC (rev 16083)
@@ -265,7 +265,6 @@
 exc_info=sys.exc_info(),
 extra={
 'status_code': 400,
-'request': request
 }
 )
 response = http.HttpResponseBadRequest()

Modified: django/branches/releases/1.3.X/tests/regressiontests/handlers/tests.py
===
--- django/branches/releases/1.3.X/tests/regressiontests/handlers/tests.py  
2011-04-22 12:15:52 UTC (rev 16082)
+++ django/branches/releases/1.3.X/tests/regressiontests/handlers/tests.py  
2011-04-22 12:21:58 UTC (rev 16083)
@@ -1,7 +1,9 @@
 from django.utils import unittest
 from django.conf import settings
 from django.core.handlers.wsgi import WSGIHandler
+from django.test import RequestFactory
 
+
 class HandlerTests(unittest.TestCase):
 
 def test_lock_safety(self):
@@ -23,3 +25,10 @@
 # Reset settings
 settings.MIDDLEWARE_CLASSES = old_middleware_classes
 
+def test_bad_path_info(self):
+"""Tests for bug #15672 ('request' referenced before assignment)"""
+environ = RequestFactory().get('/').environ
+environ['PATH_INFO'] = '\xed'
+handler = WSGIHandler()
+response = handler(environ, lambda *a, **k: None)
+self.assertEqual(response.status_code, 400)

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #11195: add fieldname to admin changelist tags -- eases CSS customization

2011-04-22 Thread Django
#11195: add fieldname to admin changelist  tags -- eases CSS customization
---+---
   Reporter:  akaihola |  Owner:  nobody
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:  css
   Triage Stage:  Accepted |  Has patch:  1
Needs documentation:  1|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
---+---
Changes (by vdboor):

 * easy:   => 0


Comment:

 Suggestion.

 what I've done in my custom admin_list.py implementation is the following:

 {{{
 list_column_classes = getattr(cl.model_admin, 'list_column_classes')
 or {}

 for field_name in cl.list_display:
 # 

 column_class = list_column_classes.get(field_name)
 if column_class:
 row_classes.append(column_class)
 }}}

 * This allows the developers to define a `list_column_classes` attribute
 on a `ModelAdmin`
 * Only the rows that really need a class have to included.

 Getting the HTML size trimmed down is one thing.
 Having an admin list with badly formatted column widths is far worse for
 clients.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r16082 - in django/trunk: django/core/handlers tests/regressiontests/handlers

2011-04-22 Thread noreply
Author: jezdez
Date: 2011-04-22 05:15:52 -0700 (Fri, 22 Apr 2011)
New Revision: 16082

Modified:
   django/trunk/django/core/handlers/modpython.py
   django/trunk/django/core/handlers/wsgi.py
   django/trunk/tests/regressiontests/handlers/tests.py
Log:
Fixed #15672 -- Refined changes made in r15918. Thanks, vung.

Modified: django/trunk/django/core/handlers/modpython.py
===
--- django/trunk/django/core/handlers/modpython.py  2011-04-22 12:14:54 UTC 
(rev 16081)
+++ django/trunk/django/core/handlers/modpython.py  2011-04-22 12:15:52 UTC 
(rev 16082)
@@ -179,11 +179,10 @@
 try:
 request = self.request_class(req)
 except UnicodeDecodeError:
-logger.warning('Bad Request (UnicodeDecodeError): %s' % 
request.path,
+logger.warning('Bad Request (UnicodeDecodeError)',
 exc_info=sys.exc_info(),
 extra={
 'status_code': 400,
-'request': request
 }
 )
 response = http.HttpResponseBadRequest()

Modified: django/trunk/django/core/handlers/wsgi.py
===
--- django/trunk/django/core/handlers/wsgi.py   2011-04-22 12:14:54 UTC (rev 
16081)
+++ django/trunk/django/core/handlers/wsgi.py   2011-04-22 12:15:52 UTC (rev 
16082)
@@ -265,7 +265,6 @@
 exc_info=sys.exc_info(),
 extra={
 'status_code': 400,
-'request': request
 }
 )
 response = http.HttpResponseBadRequest()

Modified: django/trunk/tests/regressiontests/handlers/tests.py
===
--- django/trunk/tests/regressiontests/handlers/tests.py2011-04-22 
12:14:54 UTC (rev 16081)
+++ django/trunk/tests/regressiontests/handlers/tests.py2011-04-22 
12:15:52 UTC (rev 16082)
@@ -1,7 +1,9 @@
 from django.utils import unittest
 from django.conf import settings
 from django.core.handlers.wsgi import WSGIHandler
+from django.test import RequestFactory
 
+
 class HandlerTests(unittest.TestCase):
 
 def test_lock_safety(self):
@@ -23,3 +25,10 @@
 # Reset settings
 settings.MIDDLEWARE_CLASSES = old_middleware_classes
 
+def test_bad_path_info(self):
+"""Tests for bug #15672 ('request' referenced before assignment)"""
+environ = RequestFactory().get('/').environ
+environ['PATH_INFO'] = '\xed'
+handler = WSGIHandler()
+response = handler(environ, lambda *a, **k: None)
+self.assertEqual(response.status_code, 400)

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r16081 - in django/trunk: . django/db/backends/mysql django/db/backends/oracle django/db/backends/postgresql_psycopg2 docs/faq docs/ref tests/regressiontests/backends

2011-04-22 Thread noreply
Author: jacob
Date: 2011-04-22 05:14:54 -0700 (Fri, 22 Apr 2011)
New Revision: 16081

Modified:
   django/trunk/AUTHORS
   django/trunk/django/db/backends/mysql/base.py
   django/trunk/django/db/backends/oracle/base.py
   django/trunk/django/db/backends/postgresql_psycopg2/operations.py
   django/trunk/docs/faq/models.txt
   django/trunk/docs/ref/databases.txt
   django/trunk/tests/regressiontests/backends/tests.py
Log:
Fixed #14091 - be more correct about logging queries in connection.queries.

Thanks to Aymeric Augustin for figuring out how to make this work across
multiple databases.

Modified: django/trunk/AUTHORS
===
--- django/trunk/AUTHORS2011-04-22 12:06:11 UTC (rev 16080)
+++ django/trunk/AUTHORS2011-04-22 12:14:54 UTC (rev 16081)
@@ -60,6 +60,7 @@
 atlithorn 
 Jökull Sólberg Auðunsson 
 Arthur 
+Aymeric Augustin 
 av0...@mail.ru
 David Avsajanishvili 
 Mike Axiak 

Modified: django/trunk/django/db/backends/mysql/base.py
===
--- django/trunk/django/db/backends/mysql/base.py   2011-04-22 12:06:11 UTC 
(rev 16080)
+++ django/trunk/django/db/backends/mysql/base.py   2011-04-22 12:14:54 UTC 
(rev 16081)
@@ -191,6 +191,12 @@
 def fulltext_search_sql(self, field_name):
 return 'MATCH (%s) AGAINST (%%s IN BOOLEAN MODE)' % field_name
 
+def last_executed_query(self, cursor, sql, params):
+# With MySQLdb, cursor objects have an (undocumented) "_last_executed"
+# attribute where the exact query sent to the database is saved.
+# See MySQLdb/cursors.py in the source distribution.
+return cursor._last_executed
+
 def no_limit_value(self):
 # 2**64 - 1, as recommended by the MySQL documentation
 return 18446744073709551615L

Modified: django/trunk/django/db/backends/oracle/base.py
===
--- django/trunk/django/db/backends/oracle/base.py  2011-04-22 12:06:11 UTC 
(rev 16080)
+++ django/trunk/django/db/backends/oracle/base.py  2011-04-22 12:14:54 UTC 
(rev 16081)
@@ -210,6 +210,11 @@
 else:
 return "%s"
 
+def last_executed_query(self, cursor, sql, params):
+# http://cx-oracle.sourceforge.net/html/cursor.html#Cursor.statement
+# The DB API definition does not define this attribute.
+return cursor.statement
+
 def last_insert_id(self, cursor, table_name, pk_name):
 sq_name = self._get_sequence_name(table_name)
 cursor.execute('SELECT "%s".currval FROM dual' % sq_name)

Modified: django/trunk/django/db/backends/postgresql_psycopg2/operations.py
===
--- django/trunk/django/db/backends/postgresql_psycopg2/operations.py   
2011-04-22 12:06:11 UTC (rev 16080)
+++ django/trunk/django/db/backends/postgresql_psycopg2/operations.py   
2011-04-22 12:14:54 UTC (rev 16081)
@@ -202,9 +202,8 @@
 return 63
 
 def last_executed_query(self, cursor, sql, params):
-# With psycopg2, cursor objects have a "query" attribute that is the
-# exact query sent to the database. See docs here:
-# 
http://www.initd.org/tracker/psycopg/wiki/psycopg2_documentation#postgresql-status-message-and-executed-query
+# http://initd.org/psycopg/docs/cursor.html#cursor.query
+# The query attribute is a Psycopg extension to the DB API 2.0.
 return cursor.query
 
 def return_insert_id(self):

Modified: django/trunk/docs/faq/models.txt
===
--- django/trunk/docs/faq/models.txt2011-04-22 12:06:11 UTC (rev 16080)
+++ django/trunk/docs/faq/models.txt2011-04-22 12:14:54 UTC (rev 16081)
@@ -22,9 +22,8 @@
 
 ``connection.queries`` includes all SQL statements -- INSERTs, UPDATES,
 SELECTs, etc. Each time your app hits the database, the query will be recorded.
-Note that the raw SQL logged in ``connection.queries`` may not include
-parameter quoting.  Parameter quoting is performed by the database-specific
-backend, and not all backends provide a way to retrieve the SQL after quoting.
+Note that the SQL recorded here may be :ref:`incorrectly quoted under SQLite
+`.
 
 .. versionadded:: 1.2
 

Modified: django/trunk/docs/ref/databases.txt
===
--- django/trunk/docs/ref/databases.txt 2011-04-22 12:06:11 UTC (rev 16080)
+++ django/trunk/docs/ref/databases.txt 2011-04-22 12:14:54 UTC (rev 16081)
@@ -465,7 +465,7 @@
 binary distribution, if needed.
 
 "Database is locked" errors

+---
 
 SQLite is meant to be a lightweight database, and thus can't support a high
 level of concurrency. ``OperationalError: database is locked`` errors indicate
@@ -506,6 +506,16 @@
 SQ

Re: [Django] #15255: DB Cache table creation (createcachetable) ignores the DB Router

2011-04-22 Thread Django
#15255: DB Cache table creation (createcachetable) ignores the DB Router
+-
   Reporter:  zvikico   |  Owner:  nobody
   Type:  Bug   | Status:  new
  Milestone:  1.4   |  Component:  Core (Cache system)
Version:  1.3-beta  |   Severity:  Normal
 Resolution:|   Keywords:
   Triage Stage:  Accepted  |  Has patch:  1
Needs documentation:  0 |Needs tests:  1
Patch needs improvement:  0 |  Easy pickings:  0
+-

Comment (by jacob):

 By the way, there are tests for `createcachetable` in
 `regressiontests/cache/tests.py`; we just need a new test method that
 tests it with the multidb flag. The test suite should already have an
 "other" database definition for you to test against.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r16080 - in django/branches/releases/1.3.X: django/views/generic tests/regressiontests/generic_views

2011-04-22 Thread noreply
Author: jezdez
Date: 2011-04-22 05:06:11 -0700 (Fri, 22 Apr 2011)
New Revision: 16080

Modified:
   django/branches/releases/1.3.X/django/views/generic/list.py
   django/branches/releases/1.3.X/tests/regressiontests/generic_views/dates.py
   django/branches/releases/1.3.X/tests/regressiontests/generic_views/urls.py
Log:
[1.3.X] Fixed #15698 -- Fixed inconsistant handling of context_object_name in 
paginated MultipleObjectMixin views. Thanks, Dave Hall.

Backport from trunk (r16079).

Modified: django/branches/releases/1.3.X/django/views/generic/list.py
===
--- django/branches/releases/1.3.X/django/views/generic/list.py 2011-04-22 
12:03:58 UTC (rev 16079)
+++ django/branches/releases/1.3.X/django/views/generic/list.py 2011-04-22 
12:06:11 UTC (rev 16080)
@@ -89,6 +89,7 @@
 """
 queryset = kwargs.pop('object_list')
 page_size = self.get_paginate_by(queryset)
+context_object_name = self.get_context_object_name(queryset)
 if page_size:
 paginator, page, queryset, is_paginated = 
self.paginate_queryset(queryset, page_size)
 context = {
@@ -105,7 +106,6 @@
 'object_list': queryset
 }
 context.update(kwargs)
-context_object_name = self.get_context_object_name(queryset)
 if context_object_name is not None:
 context[context_object_name] = queryset
 return context

Modified: 
django/branches/releases/1.3.X/tests/regressiontests/generic_views/dates.py
===
--- django/branches/releases/1.3.X/tests/regressiontests/generic_views/dates.py 
2011-04-22 12:03:58 UTC (rev 16079)
+++ django/branches/releases/1.3.X/tests/regressiontests/generic_views/dates.py 
2011-04-22 12:06:11 UTC (rev 16080)
@@ -119,6 +119,13 @@
 self.assertEqual(res.status_code, 200)
 self.assertEqual(list(res.context['date_list']), 
[datetime.datetime(year, 1, 1)])
 
+def test_year_view_paginated(self):
+res = self.client.get('/dates/books/2006/paginated/')
+self.assertEqual(res.status_code, 200)
+self.assertEqual(list(res.context['book_list']), 
list(Book.objects.filter(pubdate__year=2006)))
+self.assertEqual(list(res.context['object_list']), 
list(Book.objects.filter(pubdate__year=2006)))
+self.assertTemplateUsed(res, 'generic_views/book_archive_year.html')
+
 def test_year_view_invalid_pattern(self):
 res = self.client.get('/dates/books/no_year/')
 self.assertEqual(res.status_code, 404)
@@ -190,6 +197,13 @@
 self.assertEqual(res.context['next_month'], future)
 self.assertEqual(res.context['previous_month'], datetime.date(2006, 5, 
1))
 
+def test_month_view_paginated(self):
+res = self.client.get('/dates/books/2008/oct/paginated/')
+self.assertEqual(res.status_code, 200)
+self.assertEqual(list(res.context['book_list']), 
list(Book.objects.filter(pubdate__year=2008, pubdate__month=10)))
+self.assertEqual(list(res.context['object_list']), 
list(Book.objects.filter(pubdate__year=2008, pubdate__month=10)))
+self.assertTemplateUsed(res, 'generic_views/book_archive_month.html')
+
 def test_custom_month_format(self):
 res = self.client.get('/dates/books/2008/10/')
 self.assertEqual(res.status_code, 200)
@@ -251,6 +265,15 @@
 self.assertEqual(res.status_code, 200)
 self.assertEqual(list(res.context['book_list']), [b])
 
+def test_week_view_paginated(self):
+week_start = datetime.date(2008, 9, 28)
+week_end = week_start + datetime.timedelta(days=7)
+res = self.client.get('/dates/books/2008/week/39/')
+self.assertEqual(res.status_code, 200)
+self.assertEqual(list(res.context['book_list']), 
list(Book.objects.filter(pubdate__gte=week_start, pubdate__lt=week_end)))
+self.assertEqual(list(res.context['object_list']), 
list(Book.objects.filter(pubdate__gte=week_start, pubdate__lt=week_end)))
+self.assertTemplateUsed(res, 'generic_views/book_archive_week.html')
+
 def test_week_view_invalid_pattern(self):
 res = self.client.get('/dates/books/2007/week/no_week/')
 self.assertEqual(res.status_code, 404)
@@ -327,6 +350,13 @@
 self.assertEqual(res.context['next_day'], future)
 self.assertEqual(res.context['previous_day'], datetime.date(2006, 5, 
1))
 
+def test_day_view_paginated(self):
+res = self.client.get('/dates/books/2008/oct/1/')
+self.assertEqual(res.status_code, 200)
+self.assertEqual(list(res.context['book_list']), 
list(Book.objects.filter(pubdate__year=2008, pubdate__month=10, 
pubdate__day=1)))
+self.assertEqual(list(res.context['object_list']), 
list(Book.objects.filter(pubdate__year=2008, pubdate__month=10, 
pubdate__day=1)))
+self.assertTemplateUsed(res, 'generic_views/book_archive_day

[Changeset] r16079 - in django/trunk: django/views/generic tests/regressiontests/generic_views

2011-04-22 Thread noreply
Author: jezdez
Date: 2011-04-22 05:03:58 -0700 (Fri, 22 Apr 2011)
New Revision: 16079

Modified:
   django/trunk/django/views/generic/list.py
   django/trunk/tests/regressiontests/generic_views/dates.py
   django/trunk/tests/regressiontests/generic_views/urls.py
Log:
Fixed #15698 -- Fixed inconsistant handling of context_object_name in paginated 
MultipleObjectMixin views. Thanks, Dave Hall.

Modified: django/trunk/django/views/generic/list.py
===
--- django/trunk/django/views/generic/list.py   2011-04-22 12:03:50 UTC (rev 
16078)
+++ django/trunk/django/views/generic/list.py   2011-04-22 12:03:58 UTC (rev 
16079)
@@ -89,6 +89,7 @@
 """
 queryset = kwargs.pop('object_list')
 page_size = self.get_paginate_by(queryset)
+context_object_name = self.get_context_object_name(queryset)
 if page_size:
 paginator, page, queryset, is_paginated = 
self.paginate_queryset(queryset, page_size)
 context = {
@@ -105,7 +106,6 @@
 'object_list': queryset
 }
 context.update(kwargs)
-context_object_name = self.get_context_object_name(queryset)
 if context_object_name is not None:
 context[context_object_name] = queryset
 return context

Modified: django/trunk/tests/regressiontests/generic_views/dates.py
===
--- django/trunk/tests/regressiontests/generic_views/dates.py   2011-04-22 
12:03:50 UTC (rev 16078)
+++ django/trunk/tests/regressiontests/generic_views/dates.py   2011-04-22 
12:03:58 UTC (rev 16079)
@@ -119,6 +119,13 @@
 self.assertEqual(res.status_code, 200)
 self.assertEqual(list(res.context['date_list']), 
[datetime.datetime(year, 1, 1)])
 
+def test_year_view_paginated(self):
+res = self.client.get('/dates/books/2006/paginated/')
+self.assertEqual(res.status_code, 200)
+self.assertEqual(list(res.context['book_list']), 
list(Book.objects.filter(pubdate__year=2006)))
+self.assertEqual(list(res.context['object_list']), 
list(Book.objects.filter(pubdate__year=2006)))
+self.assertTemplateUsed(res, 'generic_views/book_archive_year.html')
+
 def test_year_view_invalid_pattern(self):
 res = self.client.get('/dates/books/no_year/')
 self.assertEqual(res.status_code, 404)
@@ -190,6 +197,13 @@
 self.assertEqual(res.context['next_month'], future)
 self.assertEqual(res.context['previous_month'], datetime.date(2006, 5, 
1))
 
+def test_month_view_paginated(self):
+res = self.client.get('/dates/books/2008/oct/paginated/')
+self.assertEqual(res.status_code, 200)
+self.assertEqual(list(res.context['book_list']), 
list(Book.objects.filter(pubdate__year=2008, pubdate__month=10)))
+self.assertEqual(list(res.context['object_list']), 
list(Book.objects.filter(pubdate__year=2008, pubdate__month=10)))
+self.assertTemplateUsed(res, 'generic_views/book_archive_month.html')
+
 def test_custom_month_format(self):
 res = self.client.get('/dates/books/2008/10/')
 self.assertEqual(res.status_code, 200)
@@ -251,6 +265,15 @@
 self.assertEqual(res.status_code, 200)
 self.assertEqual(list(res.context['book_list']), [b])
 
+def test_week_view_paginated(self):
+week_start = datetime.date(2008, 9, 28)
+week_end = week_start + datetime.timedelta(days=7)
+res = self.client.get('/dates/books/2008/week/39/')
+self.assertEqual(res.status_code, 200)
+self.assertEqual(list(res.context['book_list']), 
list(Book.objects.filter(pubdate__gte=week_start, pubdate__lt=week_end)))
+self.assertEqual(list(res.context['object_list']), 
list(Book.objects.filter(pubdate__gte=week_start, pubdate__lt=week_end)))
+self.assertTemplateUsed(res, 'generic_views/book_archive_week.html')
+
 def test_week_view_invalid_pattern(self):
 res = self.client.get('/dates/books/2007/week/no_week/')
 self.assertEqual(res.status_code, 404)
@@ -327,6 +350,13 @@
 self.assertEqual(res.context['next_day'], future)
 self.assertEqual(res.context['previous_day'], datetime.date(2006, 5, 
1))
 
+def test_day_view_paginated(self):
+res = self.client.get('/dates/books/2008/oct/1/')
+self.assertEqual(res.status_code, 200)
+self.assertEqual(list(res.context['book_list']), 
list(Book.objects.filter(pubdate__year=2008, pubdate__month=10, 
pubdate__day=1)))
+self.assertEqual(list(res.context['object_list']), 
list(Book.objects.filter(pubdate__year=2008, pubdate__month=10, 
pubdate__day=1)))
+self.assertTemplateUsed(res, 'generic_views/book_archive_day.html')
+
 def test_next_prev_context(self):
 res = self.client.get('/dates/books/2008/oct/01/')
 self.assertEqual(res.content, "Archive for Oct. 1, 2008. Previous day 
is Ma

[Changeset] r16078 - in django/trunk: django/contrib/admin tests/regressiontests/admin_widgets

2011-04-22 Thread noreply
Author: jezdez
Date: 2011-04-22 05:03:50 -0700 (Fri, 22 Apr 2011)
New Revision: 16078

Modified:
   django/trunk/django/contrib/admin/widgets.py
   django/trunk/tests/regressiontests/admin_widgets/tests.py
Log:
Fixed #15673 -- Allow limit_choices_to to use a tuple for __in filters. Thanks, 
EnTeQuAk.

Modified: django/trunk/django/contrib/admin/widgets.py
===
--- django/trunk/django/contrib/admin/widgets.py2011-04-22 12:03:42 UTC 
(rev 16077)
+++ django/trunk/django/contrib/admin/widgets.py2011-04-22 12:03:50 UTC 
(rev 16078)
@@ -99,7 +99,7 @@
 if lookups and hasattr(lookups, 'items'):
 items = []
 for k, v in lookups.items():
-if isinstance(v, list):
+if isinstance(v, (tuple, list)):
 v = u','.join([str(x) for x in v])
 elif isinstance(v, bool):
 # See django.db.fields.BooleanField.get_prep_lookup

Modified: django/trunk/tests/regressiontests/admin_widgets/tests.py
===
--- django/trunk/tests/regressiontests/admin_widgets/tests.py   2011-04-22 
12:03:42 UTC (rev 16077)
+++ django/trunk/tests/regressiontests/admin_widgets/tests.py   2011-04-22 
12:03:50 UTC (rev 16078)
@@ -8,7 +8,8 @@
 from django.contrib.admin import widgets
 from django.contrib.admin.widgets import (FilteredSelectMultiple,
 AdminSplitDateTime, AdminFileWidget, ForeignKeyRawIdWidget, 
AdminRadioSelect,
-RelatedFieldWidgetWrapper, ManyToManyRawIdWidget)
+RelatedFieldWidgetWrapper, ManyToManyRawIdWidget,
+url_params_from_lookup_dict)
 from django.core.files.storage import default_storage
 from django.core.files.uploadedfile import SimpleUploadedFile
 from django.db.models import DateField
@@ -180,7 +181,13 @@
 self.assertContains(response,
 'Select a valid choice. That choice is not one of the 
available choices.')
 
+def test_url_params_from_lookup_dict_any_iterable(self):
+lookup1 = url_params_from_lookup_dict({'color__in': ('red', 'blue')})
+lookup2 = url_params_from_lookup_dict({'color__in': ['red', 'blue']})
+self.assertEqual(lookup1, {'color__in': 'red,blue'})
+self.assertEqual(lookup1, lookup2)
 
+
 class FilteredSelectMultipleWidgetTest(TestCase):
 def test_render(self):
 w = FilteredSelectMultiple('test', False)

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r16077 - in django/trunk: . django/contrib/localflavor django/contrib/localflavor/hr docs/ref/contrib tests/regressiontests/forms tests/regressiontests/forms/localflavor tests/regressiont

2011-04-22 Thread noreply
Author: jezdez
Date: 2011-04-22 05:03:42 -0700 (Fri, 22 Apr 2011)
New Revision: 16077

Added:
   django/trunk/django/contrib/localflavor/hr/
   django/trunk/django/contrib/localflavor/hr/__init__.py
   django/trunk/django/contrib/localflavor/hr/forms.py
   django/trunk/django/contrib/localflavor/hr/hr_choices.py
   django/trunk/tests/regressiontests/forms/localflavor/hr.py
Modified:
   django/trunk/AUTHORS
   django/trunk/docs/ref/contrib/localflavor.txt
   django/trunk/tests/regressiontests/forms/localflavortests.py
   django/trunk/tests/regressiontests/forms/tests/__init__.py
Log:
Fixed #15705 -- Added Croatian (hr) localflavor. Thanks, Zlatko Ma?\197?\161ek 
and Julien Phalip.

Modified: django/trunk/AUTHORS
===
--- django/trunk/AUTHORS2011-04-22 12:03:30 UTC (rev 16076)
+++ django/trunk/AUTHORS2011-04-22 12:03:42 UTC (rev 16077)
@@ -531,6 +531,7 @@
 Gasper Zejn 
 Jarek Zgoda 
 Cheng Zhang
+Zlatko Mašek 
 
 A big THANK YOU goes to:
 

Added: django/trunk/django/contrib/localflavor/hr/__init__.py
===
Added: django/trunk/django/contrib/localflavor/hr/forms.py
===
--- django/trunk/django/contrib/localflavor/hr/forms.py 
(rev 0)
+++ django/trunk/django/contrib/localflavor/hr/forms.py 2011-04-22 12:03:42 UTC 
(rev 16077)
@@ -0,0 +1,281 @@
+# -*- coding: utf-8 -*-
+"""
+HR-specific Form helpers
+"""
+import re
+
+from django.forms.fields import Field, Select, RegexField
+from django.core.validators import EMPTY_VALUES
+from django.forms import ValidationError
+from django.utils.translation import ugettext_lazy as _
+from django.utils.encoding import smart_unicode
+
+jmbg_re = re.compile(r'^(?P\d{2})(?P\d{2})(?P\d{3})' + \
+r'(?P\d{2})(?P\d{3})(?P\d{1})$')
+oib_re = re.compile(r'^\d{11}$')
+plate_re = re.compile(ur'^(?P[A-ZČŠŽ]{2})' + \
+ur'(?P\d{3,4})(?P[ABCDEFGHIJKLMNOPRSTUVZ]{1,2})$')
+postal_code_re = re.compile(r'^\d{5}$')
+phone_re = re.compile(r'^(\+385|00385|0)(?P\d{2})(?P\d{6,7})$')
+jmbag_re = re.compile(r'^601983(?P\d{1})1(?P\d{10})(?P\d{1})$')
+
+
+class HRCountySelect(Select):
+"""
+A Select widget that uses a list of counties of Croatia as its choices.
+"""
+
+def __init__(self, attrs=None):
+from hr_choices import HR_COUNTY_CHOICES
+super(HRCountySelect, self).__init__(attrs, choices=HR_COUNTY_CHOICES)
+
+
+class HRLicensePlatePrefixSelect(Select):
+"""
+A Select widget that uses a list of vehicle license plate prefixes of
+Croatia as its choices.
+"""
+
+def __init__(self, attrs=None):
+from hr_choices import HR_LICENSE_PLATE_PREFIX_CHOICES
+super(HRLicensePlatePrefixSelect, self).__init__(attrs,
+choices=HR_LICENSE_PLATE_PREFIX_CHOICES)
+
+
+class HRPhoneNumberPrefixSelect(Select):
+"""
+A Select widget that uses a list of phone number prefixes of Croatia as its
+choices.
+"""
+
+def __init__(self, attrs=None):
+from hr_choices import HR_PHONE_NUMBER_PREFIX_CHOICES
+super(HRPhoneNumberPrefixSelect, self).__init__(attrs,
+choices=HR_PHONE_NUMBER_PREFIX_CHOICES)
+
+
+class HRJMBGField(Field):
+"""
+Unique Master Citizen Number (JMBG) field.
+The number is still in use in Croatia, but it is being replaced by OIB.
+
+Source: http://en.wikipedia.org/wiki/Unique_Master_Citizen_Number
+
+For who might be reimplementing:
+The "area" regular expression group is used to calculate the region where a
+person was registered. Additional validation can be implemented in
+accordance with it, however this could result in exclusion of legit
+immigrated citizens. Therefore, this field works for any ex-Yugoslavia
+country.
+"""
+default_error_messages = {
+'invalid': _('Enter a valid 13 digit JMBG'),
+'date': _('Error in date segment'),
+}
+
+def clean(self, value):
+super(HRJMBGField, self).clean(value)
+if value in EMPTY_VALUES:
+return u''
+
+value = value.strip()
+
+matches = jmbg_re.search(value)
+if matches is None:
+raise ValidationError(self.error_messages['invalid'])
+
+# Make sure the date part is correct.
+dd = int(matches.group('dd'))
+mm = int(matches.group('mm'))
+yyy = int(matches.group('yyy'))
+import datetime
+try:
+datetime.date(yyy,mm,dd)
+except:
+raise ValidationError(self.error_messages['date'])
+
+# Validate checksum.
+k = matches.group('k')
+checksum = 0
+for i,j in zip(range(7,1,-1),range(6)):
+checksum+=i*(int(value[j])+int(value[13-i]))
+m = 11 - checksum % 11
+if m == 10:
+raise ValidationError(self.error_messa

[Changeset] r16076 - in django/trunk: django/contrib/localflavor django/contrib/localflavor/ru docs/ref/contrib tests/regressiontests/forms tests/regressiontests/forms/localflavor tests/regressiontes

2011-04-22 Thread noreply
Author: jezdez
Date: 2011-04-22 05:03:30 -0700 (Fri, 22 Apr 2011)
New Revision: 16076

Added:
   django/trunk/django/contrib/localflavor/ru/
   django/trunk/django/contrib/localflavor/ru/__init__.py
   django/trunk/django/contrib/localflavor/ru/forms.py
   django/trunk/django/contrib/localflavor/ru/ru_regions.py
   django/trunk/tests/regressiontests/forms/localflavor/ru.py
Modified:
   django/trunk/docs/ref/contrib/localflavor.txt
   django/trunk/tests/regressiontests/forms/localflavortests.py
   django/trunk/tests/regressiontests/forms/tests/__init__.py
Log:
Fixed #15013 -- Added Russian (ru) localflavor package. Thanks, blackraven and 
Julien Phalip.

Added: django/trunk/django/contrib/localflavor/ru/__init__.py
===
Added: django/trunk/django/contrib/localflavor/ru/forms.py
===
--- django/trunk/django/contrib/localflavor/ru/forms.py 
(rev 0)
+++ django/trunk/django/contrib/localflavor/ru/forms.py 2011-04-22 12:03:30 UTC 
(rev 16076)
@@ -0,0 +1,68 @@
+"""
+Russian-specific forms helpers
+"""
+import re
+
+from django.core.validators import EMPTY_VALUES
+from django.forms import ValidationError
+from django.forms.fields import CharField, Select, RegexField
+from django.utils.translation import ugettext_lazy as _
+
+phone_digits_re = re.compile(r'^(?:[78]-?)?(\d{3})[-\.]?(\d{3})[-\.]?(\d{4})$')
+
+
+class RUCountySelect(Select):
+"""
+A Select widget that uses a list of Russian Counties as its choices.
+"""
+def __init__(self, attrs=None):
+from ru_regions import RU_COUNTY_CHOICES
+super(RUCountySelect, self).__init__(attrs, choices=RU_COUNTY_CHOICES)
+
+
+class RURegionSelect(Select):
+"""
+A Select widget that uses a list of Russian Regions as its choices.
+"""
+def __init__(self, attrs=None):
+from ru_regions import RU_REGIONS_CHOICES
+super(RURegionSelect, self).__init__(attrs, choices=RU_REGIONS_CHOICES)
+
+
+class RUPostalCodeField(RegexField):
+"""
+Russian Postal code field.
+Format: XX, where X is any digit, and first digit is not zero.
+"""
+default_error_messages = {
+'invalid': _(u'Enter a postal code in the format XX.'),
+}
+def __init__(self, *args, **kwargs):
+super(RUPostalCodeField, self).__init__(r'^\d{6}$',
+max_length=None, min_length=None, *args, **kwargs)
+
+
+class RUPassportNumberField(RegexField):
+"""
+Russian internal passport number format:
+ XX where X - any digit.
+"""
+default_error_messages = {
+'invalid': _(u'Enter a passport number in the format  XX.'),
+}
+def __init__(self, *args, **kwargs):
+super(RUPassportNumberField, self).__init__(r'^\d{4} \d{6}$',
+max_length=None, min_length=None, *args, **kwargs)
+
+
+class RUAlienPassportNumberField(RegexField):
+"""
+Russian alien's passport number format:
+XX XXX where X - any digit.
+"""
+default_error_messages = {
+'invalid': _(u'Enter a passport number in the format XX XXX.'),
+}
+def __init__(self, *args, **kwargs):
+super(RUAlienPassportNumberField, self).__init__(r'^\d{2} \d{7}$',
+max_length=None, min_length=None, *args, **kwargs)

Added: django/trunk/django/contrib/localflavor/ru/ru_regions.py
===
--- django/trunk/django/contrib/localflavor/ru/ru_regions.py
(rev 0)
+++ django/trunk/django/contrib/localflavor/ru/ru_regions.py2011-04-22 
12:03:30 UTC (rev 16076)
@@ -0,0 +1,104 @@
+# -*- encoding: utf-8 -*-
+"""
+Sources:
+http://ru.wikipedia.org/wiki/Коды_субъектов_Российской_Федерации
+http://ru.wikipedia.org/wiki/Федеральные_округа_Российской_Федерации
+"""
+from django.utils.translation import ugettext_lazy as _
+
+RU_COUNTY_CHOICES = (
+("Central Federal County", _("Central Federal County")),
+("South Federal County", _("South Federal County")),
+("North-West Federal County", _("North-West Federal County")),
+("Far-East Federal County", _("Far-East Federal County")),
+("Siberian Federal County", _("Siberian Federal County")),
+("Ural Federal County", _("Ural Federal County")),
+("Privolzhsky Federal County", _("Privolzhsky Federal County")),
+("North-Caucasian Federal County", _("North-Caucasian Federal County"))
+)
+
+RU_REGIONS_CHOICES = (
+("77", _("Moskva")),
+("78", _("Saint-Peterburg")),
+("50", _("Moskovskaya oblast'")),
+("01", _("Adygeya, Respublika")),
+("02", _("Bashkortostan, Respublika")),
+("03", _("Buryatia, Respublika")),
+("04", _("Altay, Respublika")),
+("05", _("Dagestan, Respublika")),
+("06", _("Ingushskaya Respublika")),
+("07", _("Kabardino-Balkarskaya Respublika")),
+("08", _("Kalmykia, Respublika")),
+("0

[Changeset] r16075 - in django/trunk: django/utils tests/regressiontests/utils

2011-04-22 Thread noreply
Author: jezdez
Date: 2011-04-22 05:03:18 -0700 (Fri, 22 Apr 2011)
New Revision: 16075

Modified:
   django/trunk/django/utils/module_loading.py
   django/trunk/tests/regressiontests/utils/module_loading.py
Log:
Fixed #15662 -- Made sure the module_has_submodule utility function follow 
correct PEP 302, passing the package as the second argument to the find_module 
method of the importer. Thanks, Bradley Ayers.

Modified: django/trunk/django/utils/module_loading.py
===
--- django/trunk/django/utils/module_loading.py 2011-04-22 12:03:10 UTC (rev 
16074)
+++ django/trunk/django/utils/module_loading.py 2011-04-22 12:03:18 UTC (rev 
16075)
@@ -12,7 +12,7 @@
 except KeyError:
 pass
 for finder in sys.meta_path:
-if finder.find_module(name):
+if finder.find_module(name, package):
 return True
 for entry in package.__path__:  # No __path__, then not a package.
 try:

Modified: django/trunk/tests/regressiontests/utils/module_loading.py
===
--- django/trunk/tests/regressiontests/utils/module_loading.py  2011-04-22 
12:03:10 UTC (rev 16074)
+++ django/trunk/tests/regressiontests/utils/module_loading.py  2011-04-22 
12:03:18 UTC (rev 16075)
@@ -1,5 +1,6 @@
 import os
 import sys
+import imp
 from zipimport import zipimporter
 
 from django.utils import unittest
@@ -8,6 +9,12 @@
 
 
 class DefaultLoader(unittest.TestCase):
+def setUp(self):
+sys.meta_path.insert(0, ProxyFinder())
+
+def tearDown(self):
+sys.meta_path.pop(0)
+
 def test_loader(self):
 "Normal module existence can be tested"
 test_module = import_module('regressiontests.utils.test_module')
@@ -25,6 +32,10 @@
 self.assertFalse(module_has_submodule(test_module, 'no_such_module'))
 self.assertRaises(ImportError, import_module, 
'regressiontests.utils.test_module.no_such_module')
 
+# A child that doesn't exist, but is the name of a package on the path
+self.assertFalse(module_has_submodule(test_module, 'django'))
+self.assertRaises(ImportError, import_module, 
'regressiontests.utils.test_module.django')
+
 # Don't be confused by caching of import misses
 import types  # causes attempted import of regressiontests.utils.types
 
self.assertFalse(module_has_submodule(sys.modules['regressiontests.utils'], 
'types'))
@@ -84,6 +95,25 @@
 self.assertFalse(module_has_submodule(egg_module, 'no_such_module'))
 self.assertRaises(ImportError, import_module, 
'egg_module.sub1.sub2.no_such_module')
 
+class ProxyFinder(object):
+def __init__(self):
+self._cache = {}
+
+def find_module(self, fullname, path=None):
+tail = fullname.rsplit('.', 1)[-1]
+try:
+self._cache[fullname] = imp.find_module(tail, path)
+except ImportError:
+return None
+else:
+return self  # this is a loader as well
+
+def load_module(self, fullname):
+if fullname in sys.modules:
+return sys.modules[fullname]
+fd, fn, info = self._cache[fullname]
+return imp.load_module(fullname, fd, fn, info)
+
 class TestFinder(object):
 def __init__(self, *args, **kwargs):
 self.importer = zipimporter(*args, **kwargs)

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r16074 - in django/trunk: django/utils tests/regressiontests/i18n

2011-04-22 Thread noreply
Author: jezdez
Date: 2011-04-22 05:03:10 -0700 (Fri, 22 Apr 2011)
New Revision: 16074

Modified:
   django/trunk/django/utils/numberformat.py
   django/trunk/tests/regressiontests/i18n/tests.py
Log:
Fixed #13810 -- Truncate numbers correctly when given number of decimal 
positions is zero. Thanks, milosu  and ?\197?\129ukasz Rekucki.

Modified: django/trunk/django/utils/numberformat.py
===
--- django/trunk/django/utils/numberformat.py   2011-04-22 12:03:03 UTC (rev 
16073)
+++ django/trunk/django/utils/numberformat.py   2011-04-22 12:03:10 UTC (rev 
16074)
@@ -2,7 +2,7 @@
 from django.utils.safestring import mark_safe
 
 
-def format(number, decimal_sep, decimal_pos, grouping=0, thousand_sep=''):
+def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep=''):
 """
 Gets a number (as a number or string), and returns it as a string,
 using formats definied as arguments:
@@ -29,11 +29,11 @@
 # decimal part
 if '.' in str_number:
 int_part, dec_part = str_number.split('.')
-if decimal_pos:
+if decimal_pos is not None:
 dec_part = dec_part[:decimal_pos]
 else:
 int_part, dec_part = str_number, ''
-if decimal_pos:
+if decimal_pos is not None:
 dec_part = dec_part + ('0' * (decimal_pos - len(dec_part)))
 if dec_part: dec_part = decimal_sep + dec_part
 # grouping

Modified: django/trunk/tests/regressiontests/i18n/tests.py
===
--- django/trunk/tests/regressiontests/i18n/tests.py2011-04-22 12:03:03 UTC 
(rev 16073)
+++ django/trunk/tests/regressiontests/i18n/tests.py2011-04-22 12:03:10 UTC 
(rev 16074)
@@ -171,6 +171,7 @@
 settings.USE_THOUSAND_SEPARATOR = False
 self.assertEqual(u'6.66', nformat(self.n, decimal_sep='.', 
decimal_pos=2, grouping=3, thousand_sep=','))
 self.assertEqual(u'6A6', nformat(self.n, decimal_sep='A', 
decimal_pos=1, grouping=1, thousand_sep='B'))
+self.assertEqual(u'6', nformat(self.n, decimal_sep='X', 
decimal_pos=0, grouping=1, thousand_sep='Y'))
 
 settings.USE_THOUSAND_SEPARATOR = True
 self.assertEqual(u'66,666.66', nformat(self.n, decimal_sep='.', 
decimal_pos=2, grouping=3, thousand_sep=','))

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r16073 - in django/trunk: django/core tests/regressiontests/pagination_regress

2011-04-22 Thread noreply
Author: jezdez
Date: 2011-04-22 05:03:03 -0700 (Fri, 22 Apr 2011)
New Revision: 16073

Modified:
   django/trunk/django/core/paginator.py
   django/trunk/tests/regressiontests/pagination_regress/tests.py
Log:
Fixed #13689 -- Convert the per_page value to an integer upon initialization of 
the Paginator class to prevent unpleasant TypeErrors. Thanks, rbanffy, Eric 
Florenzano and Claude Paroz.

Modified: django/trunk/django/core/paginator.py
===
--- django/trunk/django/core/paginator.py   2011-04-22 12:02:55 UTC (rev 
16072)
+++ django/trunk/django/core/paginator.py   2011-04-22 12:03:03 UTC (rev 
16073)
@@ -13,8 +13,8 @@
 class Paginator(object):
 def __init__(self, object_list, per_page, orphans=0, 
allow_empty_first_page=True):
 self.object_list = object_list
-self.per_page = per_page
-self.orphans = orphans
+self.per_page = int(per_page)
+self.orphans = int(orphans)
 self.allow_empty_first_page = allow_empty_first_page
 self._num_pages = self._count = None
 

Modified: django/trunk/tests/regressiontests/pagination_regress/tests.py
===
--- django/trunk/tests/regressiontests/pagination_regress/tests.py  
2011-04-22 12:02:55 UTC (rev 16072)
+++ django/trunk/tests/regressiontests/pagination_regress/tests.py  
2011-04-22 12:03:03 UTC (rev 16073)
@@ -94,6 +94,11 @@
 (([1, 2], 1, 1, True), (2, 1, [1])),
 (([1, 2, 3], 2, 1, True), (3, 1, [1])),
 ((eleven, 10, 1, True), (11, 1, [1])),
+# Non-integer inputs
+((ten, '4', 1, False), (10, 3, [1, 2, 3])),
+((ten, u'4', 1, False), (10, 3, [1, 2, 3])),
+((ten, 4, '1', False), (10, 3, [1, 2, 3])),
+((ten, 4, u'1', False), (10, 3, [1, 2, 3])),
 )
 for params, output in tests:
 self.check_paginator(params, output)

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r16072 - in django/trunk: django/contrib/humanize/templatetags tests/regressiontests/humanize

2011-04-22 Thread noreply
Author: jezdez
Date: 2011-04-22 05:02:55 -0700 (Fri, 22 Apr 2011)
New Revision: 16072

Modified:
   django/trunk/django/contrib/humanize/templatetags/humanize.py
   django/trunk/tests/regressiontests/humanize/tests.py
Log:
Fixed #11321 -- Handle timezones correctly in conjunction with naturalday 
filter. Thanks, aarond10 and seocam.

Modified: django/trunk/django/contrib/humanize/templatetags/humanize.py
===
--- django/trunk/django/contrib/humanize/templatetags/humanize.py   
2011-04-22 12:02:47 UTC (rev 16071)
+++ django/trunk/django/contrib/humanize/templatetags/humanize.py   
2011-04-22 12:02:55 UTC (rev 16072)
@@ -84,6 +84,7 @@
 formatted according to settings.DATE_FORMAT.
 """
 try:
+tzinfo = getattr(value, 'tzinfo', None)
 value = date(value.year, value.month, value.day)
 except AttributeError:
 # Passed value wasn't a date object
@@ -91,7 +92,8 @@
 except ValueError:
 # Date arguments out of range
 return value
-delta = value - date.today()
+today = datetime.now(tzinfo).replace(microsecond=0, second=0, minute=0, 
hour=0)
+delta = value - today.date()
 if delta.days == 0:
 return _(u'today')
 elif delta.days == 1:

Modified: django/trunk/tests/regressiontests/humanize/tests.py
===
--- django/trunk/tests/regressiontests/humanize/tests.py2011-04-22 
12:02:47 UTC (rev 16071)
+++ django/trunk/tests/regressiontests/humanize/tests.py2011-04-22 
12:02:55 UTC (rev 16072)
@@ -1,4 +1,4 @@
-from datetime import timedelta, date, datetime
+from datetime import timedelta, date, datetime, tzinfo, timedelta
 
 from django.template import Template, Context, add_to_builtins
 from django.utils import unittest
@@ -8,6 +8,24 @@
 
 add_to_builtins('django.contrib.humanize.templatetags.humanize')
 
+
+class FixedOffset(tzinfo):
+"""Fixed offset in hours east from UTC."""
+
+def __init__(self, offset, name):
+self.__offset = timedelta(hours=offset)
+self.__name = name
+
+def utcoffset(self, dt):
+return self.__offset
+
+def tzname(self, dt):
+return self.__name
+
+def dst(self, dt):
+return timedelta(0)
+
+
 class HumanizeTests(unittest.TestCase):
 
 def humanize_tester(self, test_list, result_list, method):
@@ -97,7 +115,19 @@
 rendered = t.render(Context(locals())).strip()
 self.assertTrue(u' hours ago' in rendered)
 
+def test_naturalday_tz(self):
+from django.contrib.humanize.templatetags.humanize import naturalday
 
-if __name__ == '__main__':
-unittest.main()
+today = date.today()
+tz_one = FixedOffset(-12, 'TzOne')
+tz_two = FixedOffset(12, 'TzTwo')
 
+# Can be today or yesterday
+date_one = datetime(today.year, today.month, today.day, tzinfo=tz_one)
+naturalday_one = naturalday(date_one)
+# Can be today or tomorrow
+date_two = datetime(today.year, today.month, today.day, tzinfo=tz_two)
+naturalday_two = naturalday(date_two)
+
+# As 24h of difference they will never be the same
+self.assertNotEqual(naturalday_one, naturalday_two)

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r16071 - in django/trunk: django/contrib/humanize/templatetags docs/ref/contrib tests/regressiontests/humanize

2011-04-22 Thread noreply
Author: jezdez
Date: 2011-04-22 05:02:47 -0700 (Fri, 22 Apr 2011)
New Revision: 16071

Modified:
   django/trunk/django/contrib/humanize/templatetags/humanize.py
   django/trunk/docs/ref/contrib/humanize.txt
   django/trunk/tests/regressiontests/humanize/tests.py
Log:
Fixed #12771 -- Added naturaltime filter to humanize contrib app. Thanks, 
phinpho, djansoft and xtrqt.

Modified: django/trunk/django/contrib/humanize/templatetags/humanize.py
===
--- django/trunk/django/contrib/humanize/templatetags/humanize.py   
2011-04-22 12:02:38 UTC (rev 16070)
+++ django/trunk/django/contrib/humanize/templatetags/humanize.py   
2011-04-22 12:02:47 UTC (rev 16071)
@@ -2,7 +2,7 @@
 from django.utils.encoding import force_unicode
 from django import template
 from django.template import defaultfilters
-from datetime import date
+from datetime import date, datetime
 import re
 
 register = template.Library()
@@ -83,7 +83,7 @@
 present day returns representing string. Otherwise, returns a string
 formatted according to settings.DATE_FORMAT.
 """
-try: 
+try:
 value = date(value.year, value.month, value.day)
 except AttributeError:
 # Passed value wasn't a date object
@@ -100,3 +100,35 @@
 return _(u'yesterday')
 return defaultfilters.date(value, arg)
 register.filter(naturalday)
+
+def naturaltime(value, arg=None):
+"""
+For date and time values shows how many seconds, minutes or hours ago 
compared to
+current timestamp returns representing string. Otherwise, returns a string
+formatted according to settings.DATE_FORMAT
+"""
+try:
+value = datetime(value.year, value.month, value.day, value.hour, 
value.minute, value.second)
+except AttributeError:
+return value
+except ValueError:
+return value
+
+delta = datetime.now() - value
+if delta.days != 0:
+value = date(value.year, value.month, value.day)
+return naturalday(value, arg)
+elif delta.seconds == 0:
+return _(u'now')
+elif delta.seconds < 60:
+return _(u'%s seconds ago' % (delta.seconds))
+elif delta.seconds / 60 < 2:
+return _(r'a minute ago')
+elif delta.seconds / 60 < 60:
+return _(u'%s minutes ago' % (delta.seconds/60))
+elif delta.seconds / 60 / 60 < 2:
+return _(u'an hour ago')
+elif delta.seconds / 60 / 60 < 24:
+return _(u'%s hours ago' % (delta.seconds/60/60))
+return naturalday(value, arg)
+register.filter(naturaltime)

Modified: django/trunk/docs/ref/contrib/humanize.txt
===
--- django/trunk/docs/ref/contrib/humanize.txt  2011-04-22 12:02:38 UTC (rev 
16070)
+++ django/trunk/docs/ref/contrib/humanize.txt  2011-04-22 12:02:47 UTC (rev 
16071)
@@ -82,6 +82,31 @@
 * Any other day is formatted according to given argument or the
   :setting:`DATE_FORMAT` setting if no argument is given.
 
+.. templatefilter:: naturaltime
+
+naturaltime
+---
+
+.. versionadded:: 1.4
+
+For date and time values shows how many seconds, minutes or hours ago compared
+to current timestamp returns representing string. Otherwise, it behaves like
+:tfilter:`naturaldate`, so it can also take string argument for date formating.
+
+**Argument:** Date formatting string as described in the :tfilter:`date` tag.
+
+Examples (when 'now' is 17 Feb 2007 16:30:00):
+
+* ``17 Feb 2007 16:30:00`` becomes ``now``.
+* ``17 Feb 2007 16:29:31`` becomes ``29 seconds ago``.
+* ``17 Feb 2007 16:29:00`` becomes ``a minute ago``.
+* ``17 Feb 2007 16:25:35`` becomes ``4 minutes ago``.
+* ``17 Feb 2007 15:30:29`` becomes ``an hours ago``.
+* ``17 Feb 2007 13:31:29`` becomes ``2 hours ago``.
+* ``16 Feb 2007 13:31:29`` becomes ``yesterday``.
+* Any other day is formatted according to given argument or the
+  :setting:`DATE_FORMAT` setting if no argument is given.
+
 .. templatefilter:: ordinal
 
 ordinal

Modified: django/trunk/tests/regressiontests/humanize/tests.py
===
--- django/trunk/tests/regressiontests/humanize/tests.py2011-04-22 
12:02:38 UTC (rev 16070)
+++ django/trunk/tests/regressiontests/humanize/tests.py2011-04-22 
12:02:47 UTC (rev 16071)
@@ -1,4 +1,4 @@
-from datetime import timedelta, date
+from datetime import timedelta, date, datetime
 
 from django.template import Template, Context, add_to_builtins
 from django.utils import unittest
@@ -72,6 +72,32 @@
someday_result, u"I'm not a date value", None)
 self.humanize_tester(test_list, result_list, 'naturalday')
 
+def test_naturaltime(self):
+from django.template import defaultfilters
+now = datetime.now()
+seconds_ago = now - timedelta(seconds=30)
+a_minute_ago = now - timedelta(minutes=1, seconds=30)
+m

[Changeset] r16070 - in django/trunk: . django/contrib/localflavor django/contrib/localflavor/cn docs/ref/contrib tests/regressiontests/forms tests/regressiontests/forms/localflavor tests/regressiont

2011-04-22 Thread noreply
Author: jezdez
Date: 2011-04-22 05:02:38 -0700 (Fri, 22 Apr 2011)
New Revision: 16070

Added:
   django/trunk/django/contrib/localflavor/cn/
   django/trunk/django/contrib/localflavor/cn/__init__.py
   django/trunk/django/contrib/localflavor/cn/cn_provinces.py
   django/trunk/django/contrib/localflavor/cn/forms.py
   django/trunk/tests/regressiontests/forms/localflavor/cn.py
Modified:
   django/trunk/AUTHORS
   django/trunk/docs/ref/contrib/localflavor.txt
   django/trunk/tests/regressiontests/forms/localflavortests.py
   django/trunk/tests/regressiontests/forms/tests/__init__.py
Log:
Fixed #12379 -- Added Chinese (cn) localflavor package. Thanks, Xia Kai, Daniel 
Duan, DaNmarner and ?\197?\129ukasz Rekucki.

Modified: django/trunk/AUTHORS
===
--- django/trunk/AUTHORS2011-04-22 12:02:25 UTC (rev 16069)
+++ django/trunk/AUTHORS2011-04-22 12:02:38 UTC (rev 16070)
@@ -151,6 +151,7 @@
 d...@mayonnaise.net
 dready 
 Maximillian Dornseif 
+Daniel Duan 
 Jeremy Dunck 
 Andrew Durdin 
 d...@woofle.net
@@ -256,6 +257,7 @@
 Michael Josephson 
 jpelle...@gmail.com
 junzhang...@gmail.com
+Xia Kai 
 Antti Kaihola 
 Bahadır Kandemir 
 Karderio 

Added: django/trunk/django/contrib/localflavor/cn/__init__.py
===
Added: django/trunk/django/contrib/localflavor/cn/cn_provinces.py
===
--- django/trunk/django/contrib/localflavor/cn/cn_provinces.py  
(rev 0)
+++ django/trunk/django/contrib/localflavor/cn/cn_provinces.py  2011-04-22 
12:02:38 UTC (rev 16070)
@@ -0,0 +1,49 @@
+# -*- coding: utf-8 -*-
+
+"""
+An alphabetical list of provinces for use as `choices` in a formfield.
+
+Reference:
+http://en.wikipedia.org/wiki/ISO_3166-2:CN
+http://en.wikipedia.org/wiki/Province_%28China%29
+http://en.wikipedia.org/wiki/Direct-controlled_municipality
+http://en.wikipedia.org/wiki/Autonomous_regions_of_China
+"""
+
+
+CN_PROVINCE_CHOICES = (
+("anhui", u"安徽"),
+("beijing", u"北京"),
+("chongqing", u"重庆"),
+("fujian", u"福建"),
+("gansu", u"甘肃"),
+("guangdong", u"广东"),
+("guangxi", u"广西壮族自治区"),
+("guizhou", u"贵州"),
+("hainan", u"海南"),
+("hebei", u"河北"),
+("heilongjiang", u"黑龙江"),
+("henan", u"河南"),
+("hongkong", u"香港"),
+("hubei", u"湖北"),
+("hunan", u"湖南"),
+("jiangsu", u"江苏"),
+("jiangxi", u"江西"),
+("jilin", u"吉林"),
+("liaoning", u"辽宁"),
+("macao", u"澳门"),
+("neimongol", u"内蒙古自治区"),
+("ningxia", u"宁夏回族自治区"),
+("qinghai", u"青海"),
+("shaanxi", u"陕西"),
+("shandong", u"山东"),
+("shanghai", u"上海"),
+("shanxi", u"山西"),
+("sichuan", u"四川"),
+("taiwan", u"台湾"),
+("tianjin", u"天津"),
+("xinjiang", u"新疆维吾尔自治区"),
+("xizang", u"西藏自治区"),
+("yunnan", u"云南"),
+("zhejiang", u"浙江"),
+)

Added: django/trunk/django/contrib/localflavor/cn/forms.py
===
--- django/trunk/django/contrib/localflavor/cn/forms.py 
(rev 0)
+++ django/trunk/django/contrib/localflavor/cn/forms.py 2011-04-22 12:02:38 UTC 
(rev 16070)
@@ -0,0 +1,212 @@
+# -*- coding: utf-8 -*-
+
+"""
+Chinese-specific form helpers
+"""
+import re
+
+from django.forms import ValidationError
+from django.forms.fields import CharField, RegexField, Select
+from django.utils.translation import ugettext_lazy as _
+
+
+__all__ = (
+'CNProvinceSelect',
+'CNPostCodeField',
+'CNIDCardField',
+'CNPhoneNumberField',
+'CNCellNumberField',
+)
+
+
+ID_CARD_RE = r'^\d{15}(\d{2}[0-9xX])?$'
+POST_CODE_RE = r'^\d{6}$'
+PHONE_RE = r'^\d{3,4}-\d{7,8}(-\d+)?$'
+CELL_RE = r'^1[358]\d{9}$'
+
+# Valid location code used in id card checking algorithm
+CN_LOCATION_CODES = (
+ 11,  # Beijing
+ 12,  # Tianjin
+ 13,  # Hebei
+ 14,  # Shanxi
+ 15,  # Nei Mongol
+ 21,  # Liaoning
+ 22,  # Jilin
+ 23,  # Heilongjiang
+ 31,  # Shanghai
+ 32,  # Jiangsu
+ 33,  # Zhejiang
+ 34,  # Anhui
+ 35,  # Fujian
+ 36,  # Jiangxi
+ 37,  # Shandong
+ 41,  # Henan
+ 42,  # Hubei
+ 43,  # Hunan
+ 44,  # Guangdong
+ 45,  # Guangxi
+ 46,  # Hainan
+ 50,  # Chongqing
+ 51,  # Sichuan
+ 52,  # Guizhou
+ 53,  # Yunnan
+ 54,  # Xizang
+ 61,  # Shaanxi
+ 62,  # Gansu
+ 63,  # Qinghai
+ 64,  # Ningxia
+ 65,  # Xinjiang
+ 71,  # Taiwan
+ 81,  # Hong Kong
+ 91,  # Macao
+)
+
+class CNProvinceSelect(Select):
+"""
+A select widget with list of Chinese provinces as choices.
+"""
+def __init__(self, attrs=None):
+from cn_provinces import CN_PROVINCE_CHOICES
+super(CNProvinceSelect

[Changeset] r16069 - in django/trunk: django/contrib/admin docs/ref/contrib/admin tests/regressiontests/admin_views tests/regressiontests/admin_views/fixtures

2011-04-22 Thread noreply
Author: jezdez
Date: 2011-04-22 05:02:25 -0700 (Fri, 22 Apr 2011)
New Revision: 16069

Modified:
   django/trunk/django/contrib/admin/helpers.py
   django/trunk/django/contrib/admin/options.py
   django/trunk/docs/ref/contrib/admin/index.txt
   django/trunk/tests/regressiontests/admin_views/fixtures/admin-views-users.xml
   django/trunk/tests/regressiontests/admin_views/models.py
   django/trunk/tests/regressiontests/admin_views/tests.py
Log:
Fixed #11639, #13618 -- Added get_prepopulated_fields method to ModelAdmin and 
InlineModelAdmin to be able to handle prepopulated fields on a case-by-case 
basis. Thanks, leanmeandonothingmachine.

Modified: django/trunk/django/contrib/admin/helpers.py
===
--- django/trunk/django/contrib/admin/helpers.py2011-04-22 12:02:14 UTC 
(rev 16068)
+++ django/trunk/django/contrib/admin/helpers.py2011-04-22 12:02:25 UTC 
(rev 16069)
@@ -193,7 +193,8 @@
 """
 A wrapper around an inline formset for use in the admin system.
 """
-def __init__(self, inline, formset, fieldsets, readonly_fields=None, 
model_admin=None):
+def __init__(self, inline, formset, fieldsets, prepopulated_fields=None,
+readonly_fields=None, model_admin=None):
 self.opts = inline
 self.formset = formset
 self.fieldsets = fieldsets
@@ -201,18 +202,21 @@
 if readonly_fields is None:
 readonly_fields = ()
 self.readonly_fields = readonly_fields
+if prepopulated_fields is None:
+prepopulated_fields = {}
+self.prepopulated_fields = prepopulated_fields
 
 def __iter__(self):
 for form, original in zip(self.formset.initial_forms, 
self.formset.get_queryset()):
 yield InlineAdminForm(self.formset, form, self.fieldsets,
-self.opts.prepopulated_fields, original, self.readonly_fields,
+self.prepopulated_fields, original, self.readonly_fields,
 model_admin=self.opts)
 for form in self.formset.extra_forms:
 yield InlineAdminForm(self.formset, form, self.fieldsets,
-self.opts.prepopulated_fields, None, self.readonly_fields,
+self.prepopulated_fields, None, self.readonly_fields,
 model_admin=self.opts)
 yield InlineAdminForm(self.formset, self.formset.empty_form,
-self.fieldsets, self.opts.prepopulated_fields, None,
+self.fieldsets, self.prepopulated_fields, None,
 self.readonly_fields, model_admin=self.opts)
 
 def fields(self):

Modified: django/trunk/django/contrib/admin/options.py
===
--- django/trunk/django/contrib/admin/options.py2011-04-22 12:02:14 UTC 
(rev 16068)
+++ django/trunk/django/contrib/admin/options.py2011-04-22 12:02:25 UTC 
(rev 16069)
@@ -189,8 +189,17 @@
 declared_fieldsets = property(_declared_fieldsets)
 
 def get_readonly_fields(self, request, obj=None):
+"""
+Hook for specifying custom readonly fields.
+"""
 return self.readonly_fields
 
+def get_prepopulated_fields(self, request, obj=None):
+"""
+Hook for specifying custom prepopulated fields.
+"""
+return self.prepopulated_fields
+
 def queryset(self, request):
 """
 Returns a QuerySet of all model instances that can be edited by the
@@ -909,7 +918,8 @@
 formsets.append(formset)
 
 adminForm = helpers.AdminForm(form, list(self.get_fieldsets(request)),
-self.prepopulated_fields, self.get_readonly_fields(request),
+self.get_prepopulated_fields(request),
+self.get_readonly_fields(request),
 model_admin=self)
 media = self.media + adminForm.media
 
@@ -917,8 +927,9 @@
 for inline, formset in zip(self.inline_instances, formsets):
 fieldsets = list(inline.get_fieldsets(request))
 readonly = list(inline.get_readonly_fields(request))
+prepopulated = dict(inline.get_prepopulated_fields(request))
 inline_admin_formset = helpers.InlineAdminFormSet(inline, formset,
-fieldsets, readonly, model_admin=self)
+fieldsets, prepopulated, readonly, model_admin=self)
 inline_admin_formsets.append(inline_admin_formset)
 media = media + inline_admin_formset.media
 
@@ -1000,7 +1011,8 @@
 formsets.append(formset)
 
 adminForm = helpers.AdminForm(form, self.get_fieldsets(request, obj),
-self.prepopulated_fields, self.get_readonly_fields(request, obj),
+self.get_prepopulated_fields(request, obj),
+self.get_readonly_fields(request, obj),
 model_admin=self)
 media = self.media + adminForm.media
 
@@ -1008,8 +1020,9 @@
 for inline, formset in zip(self.inli

[Changeset] r16068 - django/trunk/django/contrib/admin/media/js

2011-04-22 Thread noreply
Author: jezdez
Date: 2011-04-22 05:02:14 -0700 (Fri, 22 Apr 2011)
New Revision: 16068

Removed:
   django/trunk/django/contrib/admin/media/js/dateparse.js
Log:
Fixed #11531 -- Removed unused dateparse.js from admin JavaScript directory.

Deleted: django/trunk/django/contrib/admin/media/js/dateparse.js
===
--- django/trunk/django/contrib/admin/media/js/dateparse.js 2011-04-22 
12:02:07 UTC (rev 16067)
+++ django/trunk/django/contrib/admin/media/js/dateparse.js 2011-04-22 
12:02:14 UTC (rev 16068)
@@ -1,239 +0,0 @@
-/* 'Magic' date parsing, by Simon Willison (6th October 2003)
-   http://simon.incutio.com/archive/2003/10/06/betterDateInput
-   Adapted for 6newslawrence.com, 28th January 2004
-*/
-
-/* Finds the index of the first occurence of item in the array, or -1 if not 
found */
-if (typeof Array.prototype.indexOf == 'undefined') {
-Array.prototype.indexOf = function(item) {
-var len = this.length;
-for (var i = 0; i < len; i++) {
-if (this[i] == item) {
-return i;
-}
-}
-return -1;
-};
-}
-/* Returns an array of items judged 'true' by the passed in test function */
-if (typeof Array.prototype.filter == 'undefined') {
-Array.prototype.filter = function(test) {
-var matches = [];
-var len = this.length;
-for (var i = 0; i < len; i++) {
-if (test(this[i])) {
-matches[matches.length] = this[i];
-}
-}
-return matches;
-};
-}
-
-var monthNames = gettext("January February March April May June July August 
September October November December").split(" ");
-var weekdayNames = gettext("Sunday Monday Tuesday Wednesday Thursday Friday 
Saturday").split(" ");
-
-/* Takes a string, returns the index of the month matching that string, throws
-   an error if 0 or more than 1 matches
-*/
-function parseMonth(month) {
-var matches = monthNames.filter(function(item) { 
-return new RegExp("^" + month, "i").test(item);
-});
-if (matches.length == 0) {
-throw new Error("Invalid month string");
-}
-if (matches.length > 1) {
-throw new Error("Ambiguous month");
-}
-return monthNames.indexOf(matches[0]);
-}
-/* Same as parseMonth but for days of the week */
-function parseWeekday(weekday) {
-var matches = weekdayNames.filter(function(item) {
-return new RegExp("^" + weekday, "i").test(item);
-});
-if (matches.length == 0) {
-throw new Error("Invalid day string");
-}
-if (matches.length > 1) {
-throw new Error("Ambiguous weekday");
-}
-return weekdayNames.indexOf(matches[0]);
-}
-
-/* Array of objects, each has 're', a regular expression and 'handler', a 
-   function for creating a date from something that matches the regular 
-   expression. Handlers may throw errors if string is unparseable. 
-*/
-var dateParsePatterns = [
-// Today
-{   re: /^tod/i,
-handler: function() { 
-return new Date();
-} 
-},
-// Tomorrow
-{   re: /^tom/i,
-handler: function() {
-var d = new Date(); 
-d.setDate(d.getDate() + 1); 
-return d;
-}
-},
-// Yesterday
-{   re: /^yes/i,
-handler: function() {
-var d = new Date();
-d.setDate(d.getDate() - 1);
-return d;
-}
-},
-// 4th
-{   re: /^(\d{1,2})(st|nd|rd|th)?$/i, 
-handler: function(bits) {
-var d = new Date();
-d.setDate(parseInt(bits[1], 10));
-return d;
-}
-},
-// 4th Jan
-{   re: /^(\d{1,2})(?:st|nd|rd|th)? (\w+)$/i, 
-handler: function(bits) {
-var d = new Date();
-d.setDate(1);
-d.setMonth(parseMonth(bits[2]));
-d.setDate(parseInt(bits[1], 10));
-return d;
-}
-},
-// 4th Jan 2003
-{   re: /^(\d{1,2})(?:st|nd|rd|th)? (\w+),? (\d{4})$/i,
-handler: function(bits) {
-var d = new Date();
-d.setDate(1);
-d.setYear(bits[3]);
-d.setMonth(parseMonth(bits[2]));
-d.setDate(parseInt(bits[1], 10));
-return d;
-}
-},
-// Jan 4th
-{   re: /^(\w+) (\d{1,2})(?:st|nd|rd|th)?$/i, 
-handler: function(bits) {
-var d = new Date();
-d.setDate(1);
-d.setMonth(parseMonth(bits[1]));
-d.setDate(parseInt(bits[2], 10));
-return d;
-}
-},
-// Jan 4th 2003
-{   re: /^(\w+) (\d{1,2})(?:st|nd|rd|th)?,? (\d{4})$/i,
-handler: function(bits) {
-var d = new Date();
-d.setDate(1);
-d.setYear(bits[3]);
-d.setMonth(parseMonth(bits[1]));
-d.setDate(parseInt(bits[2], 10));
-return d;
-}
-},
-// n

[Changeset] r16067 - in django/trunk: django/db/models tests/modeltests/get_latest

2011-04-22 Thread noreply
Author: jezdez
Date: 2011-04-22 05:02:07 -0700 (Fri, 22 Apr 2011)
New Revision: 16067

Modified:
   django/trunk/django/db/models/query.py
   django/trunk/tests/modeltests/get_latest/tests.py
Log:
Fixed #11283 -- Made sure that latest() clears previously specified ordering in 
a QuerySet. Thanks to benmoran, punteney, mk and and Julien Phalip.

Modified: django/trunk/django/db/models/query.py
===
--- django/trunk/django/db/models/query.py  2011-04-22 12:01:59 UTC (rev 
16066)
+++ django/trunk/django/db/models/query.py  2011-04-22 12:02:07 UTC (rev 
16067)
@@ -403,6 +403,7 @@
 "Cannot change a query once a slice has been taken."
 obj = self._clone()
 obj.query.set_limits(high=1)
+obj.query.clear_ordering()
 obj.query.add_ordering('-%s' % latest_by)
 return obj.get()
 

Modified: django/trunk/tests/modeltests/get_latest/tests.py
===
--- django/trunk/tests/modeltests/get_latest/tests.py   2011-04-22 12:01:59 UTC 
(rev 16066)
+++ django/trunk/tests/modeltests/get_latest/tests.py   2011-04-22 12:02:07 UTC 
(rev 16067)
@@ -43,6 +43,9 @@
 a3,
 )
 
+# Ensure that latest() overrides any other ordering specified on the 
query. Refs #11283.
+self.assertEqual(Article.objects.order_by('id').latest(), a4)
+
 def test_latest_manual(self):
 # You can still use latest() with a model that doesn't have
 # "get_latest_by" set -- just pass in the field name manually.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r16066 - in django/trunk: django/contrib/localflavor/au docs/ref/contrib tests/regressiontests/localflavor tests/regressiontests/localflavor/au

2011-04-22 Thread noreply
Author: jezdez
Date: 2011-04-22 05:01:59 -0700 (Fri, 22 Apr 2011)
New Revision: 16066

Added:
   django/trunk/django/contrib/localflavor/au/models.py
   django/trunk/tests/regressiontests/localflavor/au/
   django/trunk/tests/regressiontests/localflavor/au/__init__.py
   django/trunk/tests/regressiontests/localflavor/au/forms.py
   django/trunk/tests/regressiontests/localflavor/au/models.py
   django/trunk/tests/regressiontests/localflavor/au/tests.py
Modified:
   django/trunk/django/contrib/localflavor/au/forms.py
   django/trunk/docs/ref/contrib/localflavor.txt
   django/trunk/tests/regressiontests/localflavor/tests.py
Log:
Fixed #11251 -- Extended Australian localflavor to ship a few model fields 
additionally. Thanks, Simon Meers and Julien Phalip.

Modified: django/trunk/django/contrib/localflavor/au/forms.py
===
--- django/trunk/django/contrib/localflavor/au/forms.py 2011-04-22 12:01:48 UTC 
(rev 16065)
+++ django/trunk/django/contrib/localflavor/au/forms.py 2011-04-22 12:01:59 UTC 
(rev 16066)
@@ -1,26 +1,33 @@
 """
 Australian-specific Form helpers
 """
+import re
 
 from django.core.validators import EMPTY_VALUES
 from django.forms import ValidationError
 from django.forms.fields import Field, RegexField, Select
 from django.utils.encoding import smart_unicode
 from django.utils.translation import ugettext_lazy as _
-import re
 
 PHONE_DIGITS_RE = re.compile(r'^(\d{10})$')
 
 class AUPostCodeField(RegexField):
-"""Australian post code field."""
+""" Australian post code field.
+
+Assumed to be 4 digits.
+Northern Territory 3-digit postcodes should have leading zero.
+"""
 default_error_messages = {
-'invalid': _('Enter a 4 digit post code.'),
+'invalid': _('Enter a 4 digit postcode.'),
 }
 
 def __init__(self, *args, **kwargs):
+if 'max_length' in kwargs:
+kwargs.pop('max_length')
 super(AUPostCodeField, self).__init__(r'^\d{4}$',
-max_length=None, min_length=None, *args, **kwargs)
+max_length=4, min_length=None, *args, **kwargs)
 
+
 class AUPhoneNumberField(Field):
 """Australian phone number field."""
 default_error_messages = {
@@ -40,6 +47,7 @@
 return u'%s' % phone_match.group(1)
 raise ValidationError(self.error_messages['invalid'])
 
+
 class AUStateSelect(Select):
 """
 A Select widget that uses a list of Australian states/territories as its

Added: django/trunk/django/contrib/localflavor/au/models.py
===
--- django/trunk/django/contrib/localflavor/au/models.py
(rev 0)
+++ django/trunk/django/contrib/localflavor/au/models.py2011-04-22 
12:01:59 UTC (rev 16066)
@@ -0,0 +1,44 @@
+from django.conf import settings
+from django.utils.translation import ugettext_lazy as _
+from django.db.models.fields import CharField
+
+from django.contrib.localflavor.au.au_states import STATE_CHOICES
+from django.contrib.localflavor.au import forms
+
+class AUStateField(CharField):
+
+description = _("Australian State")
+
+def __init__(self, *args, **kwargs):
+kwargs['choices'] = STATE_CHOICES
+kwargs['max_length'] = 3
+super(AUStateField, self).__init__(*args, **kwargs)
+
+
+class AUPostCodeField(CharField):
+
+description = _("Australian Postcode")
+
+def __init__(self, *args, **kwargs):
+kwargs['max_length'] = 4
+super(AUPostCodeField, self).__init__(*args, **kwargs)
+
+def formfield(self, **kwargs):
+defaults = {'form_class': forms.AUPostCodeField}
+defaults.update(kwargs)
+return super(AUPostCodeField, self).formfield(**defaults)
+
+
+class AUPhoneNumberField(CharField):
+
+description = _("Australian Phone number")
+
+def __init__(self, *args, **kwargs):
+kwargs['max_length'] = 20
+super(AUPhoneNumberField, self).__init__(*args, **kwargs)
+
+def formfield(self, **kwargs):
+defaults = {'form_class': forms.AUPhoneNumberField}
+defaults.update(kwargs)
+return super(AUPhoneNumberField, self).formfield(**defaults)
+

Modified: django/trunk/docs/ref/contrib/localflavor.txt
===
--- django/trunk/docs/ref/contrib/localflavor.txt   2011-04-22 12:01:48 UTC 
(rev 16065)
+++ django/trunk/docs/ref/contrib/localflavor.txt   2011-04-22 12:01:59 UTC 
(rev 16066)
@@ -202,6 +202,21 @@
 A ``Select`` widget that uses a list of Australian states/territories as 
its
 choices.
 
+.. class:: au.models.AUPhoneNumberField
+
+A model field that checks that the value is a valid Australian phone
+number (ten digits).
+
+.. class:: au.models.AUStateField
+
+A model field that forms represent as a ``forms.AUStateField`` field and
+stores the three-letter Australian state abbreviation in the database.
+
+.. cl

[Changeset] r16065 - django/trunk/django/contrib/admin/media/css

2011-04-22 Thread noreply
Author: jezdez
Date: 2011-04-22 05:01:48 -0700 (Fri, 22 Apr 2011)
New Revision: 16065

Modified:
   django/trunk/django/contrib/admin/media/css/rtl.css
Log:
Fixed #11203 -- Stopped some form fields in the admin from rendering 
incorrectly in RTL mode when using Internet Explorer.

Modified: django/trunk/django/contrib/admin/media/css/rtl.css
===
--- django/trunk/django/contrib/admin/media/css/rtl.css 2011-04-22 12:01:41 UTC 
(rev 16064)
+++ django/trunk/django/contrib/admin/media/css/rtl.css 2011-04-22 12:01:48 UTC 
(rev 16065)
@@ -213,9 +213,20 @@
 padding-left: inherit;
 left: 10px;
 right: inherit;
+float:left;
 }
 
 .inline-related h3 span.delete label {
 margin-left: inherit;
 margin-right: 2px;
 }
+
+/* IE7 specific bug fixes */
+
+div.colM {
+position: relative;
+}
+
+.submit-row input {
+float: left;
+}
\ No newline at end of file

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r16064 - in django/trunk: django/utils tests/regressiontests/utils

2011-04-22 Thread noreply
Author: jezdez
Date: 2011-04-22 05:01:41 -0700 (Fri, 22 Apr 2011)
New Revision: 16064

Modified:
   django/trunk/django/utils/http.py
   django/trunk/tests/regressiontests/utils/http.py
Log:
Fixed #9089 -- Correctly handle list values in MultiValueDict instances when 
passed to django.utils.http.urlencode. Thanks, kratorius, guettli and obeattie.

Modified: django/trunk/django/utils/http.py
===
--- django/trunk/django/utils/http.py   2011-04-22 12:01:33 UTC (rev 16063)
+++ django/trunk/django/utils/http.py   2011-04-22 12:01:41 UTC (rev 16064)
@@ -6,6 +6,7 @@
 import urlparse
 from email.Utils import formatdate
 
+from django.utils.datastructures import MultiValueDict
 from django.utils.encoding import smart_str, force_unicode
 from django.utils.functional import allow_lazy
 
@@ -49,7 +50,9 @@
 unicode strings. The parameters are first case to UTF-8 encoded strings and
 then encoded as per normal.
 """
-if hasattr(query, 'items'):
+if isinstance(query, MultiValueDict):
+query = query.lists()
+elif hasattr(query, 'items'):
 query = query.items()
 return urllib.urlencode(
 [(smart_str(k),

Modified: django/trunk/tests/regressiontests/utils/http.py
===
--- django/trunk/tests/regressiontests/utils/http.py2011-04-22 12:01:33 UTC 
(rev 16063)
+++ django/trunk/tests/regressiontests/utils/http.py2011-04-22 12:01:41 UTC 
(rev 16064)
@@ -1,5 +1,6 @@
 from django.utils import http
 from django.utils import unittest
+from django.utils.datastructures import MultiValueDict
 
 class TestUtilsHttp(unittest.TestCase):
 
@@ -21,3 +22,32 @@
 self.assertFalse(http.same_origin('http://foo.com', 
'http://foo.com.evil.com'))
 # Different port
 self.assertFalse(http.same_origin('http://foo.com:8000', 
'http://foo.com:8001'))
+
+def test_urlencode(self):
+# 2-tuples (the norm)
+result = http.urlencode((('a', 1), ('b', 2), ('c', 3)))
+self.assertEqual(result, 'a=1&b=2&c=3')
+# A dictionary
+result = http.urlencode({ 'a': 1, 'b': 2, 'c': 3})
+acceptable_results = [
+# Need to allow all of these as dictionaries have to be treated as
+# unordered
+'a=1&b=2&c=3',
+'a=1&c=3&b=2',
+'b=2&a=1&c=3',
+'b=2&c=3&a=1',
+'c=3&a=1&b=2',
+'c=3&b=2&a=1'
+]
+self.assertTrue(result in acceptable_results)
+# A MultiValueDict
+result = http.urlencode(MultiValueDict({
+'name': ['Adrian', 'Simon'],
+'position': ['Developer']
+}), doseq=True)
+acceptable_results = [
+# MultiValueDicts are similarly unordered
+'name=Adrian&name=Simon&position=Developer',
+'position=Developer&name=Adrian&name=Simon'
+]
+self.assertTrue(result in acceptable_results)

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r16063 - in django/trunk: django/forms tests/modeltests/model_forms

2011-04-22 Thread noreply
Author: jezdez
Date: 2011-04-22 05:01:33 -0700 (Fri, 22 Apr 2011)
New Revision: 16063

Modified:
   django/trunk/django/forms/models.py
   django/trunk/tests/modeltests/model_forms/models.py
Log:
Fixed #6953 -- Correctly sort ManyToMany fields in ModelForms. Thanks, 
dgouldin, mk and Alex.

Modified: django/trunk/django/forms/models.py
===
--- django/trunk/django/forms/models.py 2011-04-21 17:43:22 UTC (rev 16062)
+++ django/trunk/django/forms/models.py 2011-04-22 12:01:33 UTC (rev 16063)
@@ -143,7 +143,7 @@
 field_list = []
 ignored = []
 opts = model._meta
-for f in opts.fields + opts.many_to_many:
+for f in sorted(opts.fields + opts.many_to_many):
 if not f.editable:
 continue
 if fields is not None and not f.name in fields:

Modified: django/trunk/tests/modeltests/model_forms/models.py
===
--- django/trunk/tests/modeltests/model_forms/models.py 2011-04-21 17:43:22 UTC 
(rev 16062)
+++ django/trunk/tests/modeltests/model_forms/models.py 2011-04-22 12:01:33 UTC 
(rev 16063)
@@ -371,7 +371,7 @@
 OddForm is now an Article-related thing, because BadForm.Meta overrides
 CategoryForm.Meta.
 >>> OddForm.base_fields.keys()
-['headline', 'slug', 'pub_date', 'writer', 'article', 'status', 'categories']
+['headline', 'slug', 'pub_date', 'writer', 'article', 'categories', 'status']
 
 >>> class ArticleForm(ModelForm):
 ... class Meta:
@@ -382,7 +382,7 @@
 >>> class BadForm(ArticleForm, CategoryForm):
 ... pass
 >>> OddForm.base_fields.keys()
-['headline', 'slug', 'pub_date', 'writer', 'article', 'status', 'categories']
+['headline', 'slug', 'pub_date', 'writer', 'article', 'categories', 'status']
 
 Subclassing without specifying a Meta on the class will use the parent's Meta
 (or the first parent in the MRO if there are multiple parent classes).
@@ -556,17 +556,17 @@
 Mike Royko
 
 Article:
+Categories:
+Entertainment
+It's a test
+Third test
+ Hold down "Control", or "Command" on a 
Mac, to select more than one.
 Status:
 -
 Draft
 Pending
 Live
 
-Categories:
-Entertainment
-It's a test
-Third test
- Hold down "Control", or "Command" on a 
Mac, to select more than one.
 
 You can restrict a form to a subset of the complete list of fields
 by providing a 'fields' argument. If you try to save a
@@ -612,17 +612,17 @@
 Mike Royko
 
 Article: Hello.
+Categories: 
+Entertainment
+It's a test
+Third test
+  Hold down "Control", or "Command" on a Mac, 
to select more than one.
 Status: 
 -
 Draft
 Pending
 Live
 
-Categories: 
-Entertainment
-It's a test
-Third test
-  Hold down "Control", or "Command" on a Mac, 
to select more than one.
 >>> f = TestArticleForm({'headline': u'Test headline', 'slug': 
 >>> 'test-headline', 'pub_date': u'1984-02-06', 'writer': unicode(w_royko.pk), 
 >>> 'article': 'Hello.'}, instance=art)
 >>> f.errors
 {}
@@ -675,17 +675,17 @@
 Mike Royko
 
 Article: Hello.
+Categories: 
+Entertainment
+It's a test
+Third test
+  Hold down "Control", or "Command" on a Mac, 
to select more than one.
 Status: 
 -
 Draft
 Pending
 Live
 
-Categories: 
-Entertainment
-It's a test
-Third test
-  Hold down "Control", or "Command" on a Mac, 
to select more than one.
 
 Initial values can be provided for model forms
 >>> f = TestArticleForm(auto_id=False, initial={'headline': 'Your headline 
 >>> here', 'categories': [str(c1.id), str(c2.id)]})
@@ -699,17 +699,17 @@
 Mike Royko
 
 Article: 
+Categories: 
+Entertainment
+It's a test
+Third test
+  Hold down "Control", or "Command" on a Mac, 
to select more than one.
 Status: 
 -
 Draft
 Pending
 Live
 
-Categories: 
-Entertainment
-It's a test
-Third test
-  Hold down "Control", or "Command" on a Mac, 
to select more than one.
 
 >>> f = TestArticleForm({'headline': u'New headline', 'slug': u'new-headline', 
 >>> 'pub_date': u'1988-01-04',
 ... 'writer': unicode(w_royko.pk), 'article': u'Hello.', 'categories': 
[unicode(c1.id), unicode(c2.id)]}, instance=new_art)
@@ -818,17 +818,17 @@
 Mike Royko
 
 Article: 
+Categories: 
+Entertainment
+It's a test
+Third
+  Hold down "Control", or "Command" on a Mac, 
to select more than one.
 Status: 
 -
 Draft
 Pending
 Live
 
-Categories: 
-Entertainment
-It's a test
-Third
-  Hold down "Control", or "Command" on a Mac, 
to select more than one.
 >>> c4 = Category.objects.create(name='Fourth', url='4th')
 >>> c4
 
@@ -845,18 +845,18 @@
 Mike Royko
 
 Article: 
+Categories: 
+Entertainment
+It's a test
+Third
+Fourth
+  Hold down "Control", or "Command" on a Mac, 
to select more than one.
 Status: 
 -
 Draft
 Pending
 Live
 
-Categories: 
-Entertainment
-It's a test
-Third
-Fourth
-  Hold down "Control", or "Command" on a Mac, 
to select more than one.
 
 # ModelChoiceField 
 

-- 
You received this message because you are subscribed 

Re: [Django] #10899: easier manipulation of sessions by test client

2011-04-22 Thread Django
#10899: easier manipulation of sessions by test client
---+---
   Reporter:  tallfred |  Owner:  nobody
   Type:  New feature  | Status:  reopened
  Milestone:   |  Component:  Testing framework
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  1
Needs documentation:  1|Needs tests:  0
Patch needs improvement:  1|  Easy pickings:  0
---+---
Changes (by mir):

 * needs_better_patch:  0 => 1
 * easy:   => 0


Comment:

 The patch does not apply to current trunk - do you have an up to date
 patch?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15255: DB Cache table creation (createcachetable) ignores the DB Router

2011-04-22 Thread Django
#15255: DB Cache table creation (createcachetable) ignores the DB Router
+-
   Reporter:  zvikico   |  Owner:  nobody
   Type:  Bug   | Status:  new
  Milestone:  1.4   |  Component:  Core (Cache system)
Version:  1.3-beta  |   Severity:  Normal
 Resolution:|   Keywords:
   Triage Stage:  Accepted  |  Has patch:  1
Needs documentation:  0 |Needs tests:  1
Patch needs improvement:  0 |  Easy pickings:  0
+-
Changes (by jacob):

 * needs_tests:  0 => 1
 * easy:   => 0
 * milestone:   => 1.4


Comment:

 Patch looks correct, but it needs tests.

 And yeah, I really like the idea of `createcachetable` inspecting
 `settings.CACHES`, but please do take that to another ticket.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #12771: Humanize with natural time

2011-04-22 Thread Django
#12771: Humanize with natural time
-+-
   Reporter:  phinpho|  Owner:  djansoft
   Type: | Status:  new
  Uncategorized  |  Component:  contrib.humanize
  Milestone: |   Severity:  Normal
Version: |   Keywords:
 Resolution: |  Has patch:  1
   Triage Stage:  Ready for  |Needs tests:  0
  checkin|  Easy pickings:  0
Needs documentation:  0  |
Patch needs improvement:  0  |
-+-
Changes (by jezdez):

 * component:  Template system => contrib.humanize
 * type:   => Uncategorized
 * severity:   => Normal
 * easy:   => 0


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15819: Admin searches should use distinct, if query involves joins

2011-04-22 Thread Django
#15819: Admin searches should use distinct, if query involves joins
-+-
   Reporter:  Adam   |  Owner:  ryankask
  Kochanowski | Status:  new
   Type:  Bug|  Component:  contrib.admin
  Milestone: |   Severity:  Normal
Version:  1.3|   Keywords:
 Resolution: |  Has patch:  1
   Triage Stage:  Accepted   |Needs tests:  0
Needs documentation:  0  |  Easy pickings:  0
Patch needs improvement:  0  |
-+-

Comment (by ryankask):

 Thanks Carl. I've moved the function the module level and have attached
 the complete patch.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15740: Manipulating the test client session doesn't work as documented

2011-04-22 Thread Django
#15740: Manipulating the test client session doesn't work as documented
-+-
   Reporter: |  Owner:
  prestontimmons | Status:  new
   Type:  Bug|  Component:  Testing framework
  Milestone: |   Severity:  Normal
Version:  1.3|   Keywords:
 Resolution: |  Has patch:  1
   Triage Stage:  Design |Needs tests:  0
  decision needed|  Easy pickings:  0
Needs documentation:  0  |
Patch needs improvement:  0  |
-+-
Changes (by mir):

 * owner:  mir =>


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15875: F() example in db queries topic guide has an error

2011-04-22 Thread Django
#15875: F() example in db queries topic guide has an error
+---
   Reporter:  jblaine   |  Owner:  nobody
   Type:  Bug   | Status:  new
  Milestone:|  Component:  Documentation
Version:  1.3   |   Severity:  Normal
 Resolution:|   Keywords:
   Triage Stage:  Accepted  |  Has patch:  1
Needs documentation:  0 |Needs tests:  0
Patch needs improvement:  0 |  Easy pickings:  1
+---
Changes (by koen.biermans@…):

 * has_patch:  0 => 1


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15840: [patch] wrap the inner function of the condition decorator

2011-04-22 Thread Django
#15840: [patch] wrap the inner function of the condition decorator
-+-
   Reporter:  portante   |  Owner:  nobody
   Type: | Status:  new
  Cleanup/optimization   |  Component:  Core (Other)
  Milestone: |   Severity:  Normal
Version: |   Keywords:
 Resolution: |  Has patch:  1
   Triage Stage:  Accepted   |Needs tests:  0
Needs documentation:  0  |  Easy pickings:  1
Patch needs improvement:  0  |
-+-
Changes (by emulbreh):

 * needs_better_patch:   => 0
 * component:  Uncategorized => Core (Other)
 * needs_tests:   => 0
 * easy:   => 1
 * needs_docs:   => 0
 * stage:  Unreviewed => Accepted


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15883: Error in tutorial 01 models.py when defining was_published_today()

2011-04-22 Thread Django
#15883: Error in tutorial 01 models.py when defining was_published_today()
-+-
   Reporter:  anonymous  |  Owner:  nobody
   Type:  Bug| Status:  closed
  Milestone: |  Component:  Djangoproject.com
Version:  1.3|  Web site
 Resolution:  invalid|   Severity:  Normal
   Triage Stage: |   Keywords:  tutorial, custo
  Unreviewed |  method
Needs documentation:  0  |  Has patch:  0
Patch needs improvement:  0  |Needs tests:  0
 |  Easy pickings:  0
-+-
Changes (by emulbreh):

 * status:  new => closed
 * severity:  Release blocker => Normal
 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0
 * resolution:   => invalid


Comment:

 `pub_date` is defined as a `DateTimeField`, thus `self.pub_date` is a
 `datetime.datetime` instance, not a `datetime.date` instance.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Django] #15883: Error in tutorial 01 models.py when defining was_published_today()

2011-04-22 Thread Django
#15883: Error in tutorial 01 models.py when defining was_published_today()
--+
 Reporter:  anonymous |  Owner:  nobody
 Type:  Bug   | Status:  new
Milestone:|  Component:  Djangoproject.com Web site
  Version:  1.3   |   Severity:  Release blocker
 Keywords:  tutorial, custo   |   Triage Stage:  Unreviewed
  method  |  Easy pickings:  0
Has patch:  0 |
--+
 http://docs.djangoproject.com/en/dev/intro/tutorial01/

 This custom method is exposed as a example:

 ''import datetime
 # ...
 class Poll(models.Model):
 # ...
 def was_published_today(self):
 return self.pub_date.date() == datetime.date.today()
 ''

 The return clause of this method should be: return self.pub_date ==
 datetime.date.today()

 Regards !

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15835: middleware.process_response(): TemplateResponse.render() isn't called

2011-04-22 Thread Django
#15835: middleware.process_response(): TemplateResponse.render() isn't called
--+--
   Reporter:  wkornewald  |  Owner:  nobody
   Type:  Bug | Status:  closed
  Milestone:  |  Component:  Core (Other)
Version:  SVN |   Severity:  Normal
 Resolution:  invalid |   Keywords:
   Triage Stage:  Unreviewed  |  Has patch:  0
Needs documentation:  0   |Needs tests:  0
Patch needs improvement:  0   |  Easy pickings:  0
--+--

Comment (by aaugustin):

 I am not sure I understand your point. "template response" and "response"
 phases happen at different points in the request-response cycle;
 middlewares obviously get different possibilities at each step.

 Anyway, if you want to discuss the general design of Django's middleware,
 you should propose a better alternative on django-developers.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15835: middleware.process_response(): TemplateResponse.render() isn't called

2011-04-22 Thread Django
#15835: middleware.process_response(): TemplateResponse.render() isn't called
--+--
   Reporter:  wkornewald  |  Owner:  nobody
   Type:  Bug | Status:  closed
  Milestone:  |  Component:  Core (Other)
Version:  SVN |   Severity:  Normal
 Resolution:  invalid |   Keywords:
   Triage Stage:  Unreviewed  |  Has patch:  0
Needs documentation:  0   |Needs tests:  0
Patch needs improvement:  0   |  Easy pickings:  0
--+--

Comment (by wkornewald):

 I'd argue that this is not well designed, then. Why should we have
 different behavior in response middleware?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15842: Silent Failure of InlineAdmin Class With a DateTimeField on the Model if Only a "time with timezone" Column in the Database

2011-04-22 Thread Django
#15842: Silent Failure of InlineAdmin Class With a DateTimeField on the Model if
Only a "time with timezone" Column in the Database
-+-
   Reporter: |  Owner:  nobody
  vincitveritas  | Status:  closed
   Type:  Bug|  Component:  Database layer
  Milestone: |  (models, ORM)
Version:  1.2|   Severity:  Normal
 Resolution:  wontfix|   Keywords:
   Triage Stage: |  Has patch:  0
  Unreviewed |Needs tests:  0
Needs documentation:  0  |  Easy pickings:  0
Patch needs improvement:  0  |
-+-
Changes (by aaugustin):

 * status:  new => closed
 * resolution:   => wontfix
 * easy:   => 0


Comment:

 Generally Django does not attempt anything to warn you of inconsistencies
 between your models and your database.

 Even something as gross as replacing a !TextField by an !IntegerField will
 only result in exceptions at runtime, possibly in unexpected places.

 It is hard to debug, but I think it is a consequence of (1) Python's type
 handling and (2) Django's choice not to use database introspection.

 Solving this problem would require some database introspection. I think
 the core devs will reject the idea, but you can always bring it on django-
 developers to be sure.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15819: Admin searches should use distinct, if query involves joins

2011-04-22 Thread Django
#15819: Admin searches should use distinct, if query involves joins
-+-
   Reporter:  Adam   |  Owner:  ryankask
  Kochanowski | Status:  new
   Type:  Bug|  Component:  contrib.admin
  Milestone: |   Severity:  Normal
Version:  1.3|   Keywords:
 Resolution: |  Has patch:  1
   Triage Stage:  Accepted   |Needs tests:  0
Needs documentation:  0  |  Easy pickings:  0
Patch needs improvement:  0  |
-+-

Comment (by aaugustin):

 #15839 is probably a duplicate.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15839: search_fields: duplicated search results when following relationships "backward"

2011-04-22 Thread Django
#15839: search_fields: duplicated search results when following relationships
"backward"
--+---
   Reporter:  while0pass  |  Owner:  nobody
   Type:  Bug | Status:  closed
  Milestone:  |  Component:  contrib.admin
Version:  1.3 |   Severity:  Normal
 Resolution:  duplicate   |   Keywords:
   Triage Stage:  Unreviewed  |  Has patch:  0
Needs documentation:  0   |Needs tests:  0
Patch needs improvement:  0   |  Easy pickings:  0
--+---
Changes (by aaugustin):

 * status:  new => closed
 * resolution:   => duplicate
 * easy:   => 0


Comment:

 This ticket looks very much like #15819, where a discussion has already
 started.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #13091: admin list_editable with unique_together raises Integrity Error

2011-04-22 Thread Django
#13091: admin list_editable with unique_together raises Integrity Error
-+-
   Reporter:  slafs  |  Owner:  nobody
   Type:  Bug| Status:  new
  Milestone:  1.3|  Component:  contrib.admin
Version:  SVN|   Severity:  Normal
 Resolution: |   Keywords:  list_editable
   Triage Stage:  Design |  unique_together IntegrityError
  decision needed|  Has patch:  1
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
-+-
Changes (by legutierr):

 * easy:   => 0


Comment:

 Some relevant points about this are raised in #13249, and there is a
 discussion in the news group regarding this here:

 As noted in the google-group thread, the current patch may break the fixes
 to #12521 and #12901, as discussed here: http://groups.google.com/group
 /django-developers/browse_thread/thread/cee43f109e0cf6b.  It seems to me
 that a proper fix would focus only on how exclusions are used in deciding
 whether to ignore `unique_together` constraints in model validation, in
 the manner I propose in the thread.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15835: middleware.process_response(): TemplateResponse.render() isn't called

2011-04-22 Thread Django
#15835: middleware.process_response(): TemplateResponse.render() isn't called
--+--
   Reporter:  wkornewald  |  Owner:  nobody
   Type:  Bug | Status:  closed
  Milestone:  |  Component:  Core (Other)
Version:  SVN |   Severity:  Normal
 Resolution:  invalid |   Keywords:
   Triage Stage:  Unreviewed  |  Has patch:  0
Needs documentation:  0   |Needs tests:  0
Patch needs improvement:  0   |  Easy pickings:  0
--+--
Changes (by aaugustin):

 * status:  new => closed
 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * easy:   => 0
 * needs_docs:   => 0
 * resolution:   => invalid


Comment:

 It think this works as designed.

 From http://docs.djangoproject.com/en/dev/ref/template-response/:

 

 There are three circumstances under which a !TemplateResponse will be
 rendered:

 - When the !TemplateResponse instance is explicitly rendered, using the
 !SimpleTemplateResponse.render() method.
 - When the content of the response is explicitly set by assigning
 response.content.
 - After passing through template response middleware, but before passing
 through response middleware.

 

 If you are using it in the response middleware, you bypass the third item
 which usually ensures that the rendering happens. You should call render()
 on the TemplateResponse object before returning it.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15832: Use Babel instead of xgettext for handling .po files.

2011-04-22 Thread Django
#15832: Use Babel instead of xgettext for handling .po files.
-+-
   Reporter:  lrekucki   |  Owner:  nobody
   Type:  New| Status:  new
  feature|  Component:
  Milestone: |  Internationalization
Version: |   Severity:  Normal
 Resolution: |   Keywords:
   Triage Stage:  Accepted   |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
-+-

Comment (by claudep):

 I must say that after reading the corresponding thread on django-
 developers list, I am seduced by Ned Batchelder approach with his jslex
 project. I'm a bit uncomfortable with ditching away the gettext
 infrastructure, but it may also be related with my unfamiliarity with
 babel.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15860: modelform.is_valid() and modelform.errors fail to anticipate database integrity errors, allow exceptions to reach the user

2011-04-22 Thread Django
#15860: modelform.is_valid() and modelform.errors fail to anticipate database
integrity errors, allow exceptions to reach the user
--+
   Reporter:  legutierr   |  Owner:  nobody
   Type:  Bug | Status:  closed
  Milestone:  |  Component:  Forms
Version:  1.3 |   Severity:  Normal
 Resolution:  duplicate   |   Keywords:
   Triage Stage:  Unreviewed  |  Has patch:  0
Needs documentation:  0   |Needs tests:  0
Patch needs improvement:  0   |  Easy pickings:  0
--+

Comment (by legutierr):

 The way I described this is too broad.  Really, the issue is with regards
 to the validate_unique exclusions being used improperly when evaluating
 `unique_together`.  Specifically, the current implementation ignores any
 unique_together constraints where *any* member field is among the
 exclusions; the correct implementation should ignore only those
 unique_together constraints where *all* member fields are amone the
 exclusions.

 #13091 describes the manifestation of this problem with regards to the
 admin; #12028 describes the manifestation of this problem with regards to
 contenttypes; the underlying issue is best described in #15326.  Given
 that this issue seems to have come up a number of times in a variety of
 contexts since model validation was added, I hope very much that this is
 not "won't fix".

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15836: Raw query documentation indicates wrong type for params

2011-04-22 Thread Django
#15836: Raw query documentation indicates wrong type for params
-+---
   Reporter:  riverfr0zen@…  |  Owner:  nobody
   Type:  Bug| Status:  new
  Milestone: |  Component:  Documentation
Version:  1.3|   Severity:  Normal
 Resolution: |   Keywords:
   Triage Stage:  Accepted   |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
-+---
Changes (by aaugustin):

 * needs_better_patch:   => 0
 * needs_docs:   => 0
 * needs_tests:   => 0
 * easy:   => 0
 * stage:  Unreviewed => Accepted


Comment:

 There are two ways to fix this:
 - accept both lists and tuples: I think that is what Django does in
 several places, attached patch implements this
 - change the docs

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #13249: Feature request: ModelForm validation error handling after commit=False

2011-04-22 Thread Django
#13249: Feature request: ModelForm validation error handling after commit=False
--+
   Reporter:  orokusaki   |  Owner:  nobody
   Type:  Bug | Status:  closed
  Milestone:  |  Component:  Forms
Version:  SVN |   Severity:  Normal
 Resolution:  duplicate   |   Keywords:
   Triage Stage:  Design decision needed  |  Has patch:  0
Needs documentation:  0   |Needs tests:  0
Patch needs improvement:  0   |  Easy pickings:  0
--+
Changes (by legutierr):

 * status:  reopened => closed
 * resolution:   => duplicate


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #13249: Feature request: ModelForm validation error handling after commit=False

2011-04-22 Thread Django
#13249: Feature request: ModelForm validation error handling after commit=False
-+-
   Reporter:  orokusaki  |  Owner:  nobody
   Type:  Bug| Status:  reopened
  Milestone: |  Component:  Forms
Version:  SVN|   Severity:  Normal
 Resolution: |   Keywords:
   Triage Stage:  Design |  Has patch:  0
  decision needed|Needs tests:  0
Needs documentation:  0  |  Easy pickings:  0
Patch needs improvement:  0  |
-+-
Changes (by legutierr):

 * status:  closed => reopened
 * severity:   => Normal
 * resolution:  wontfix =>
 * easy:   => 0
 * type:   => Bug
 * stage:  Unreviewed => Design decision needed


Comment:

 I agree with orokusaki that although there is a better approach to that
 described in the original ticket (i.e. the use of
 `form.save(commit=False`)), there is, nonetheless, a problem in the way
 that form.is_valid() and model validation validates `unique_together`.
 Currently, model validation ignores all `unique_together` tuples where
 *any* of the referenced fields are excluded; instead, model validation
 should only ignore those `unique_together` tuples where *all* of the
 referenced fields are excluded.

 I am reopening this ticket with the purpose of marking it as a duplicate
 of #13091.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15838: assertFieldOutput should be integrated to the general test framework

2011-04-22 Thread Django
#15838: assertFieldOutput should be integrated to the general test framework
---+---
   Reporter:  julien   |  Owner:  nobody
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  Testing framework
Version:  1.3  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  0
Needs documentation:  1|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
---+---
Changes (by aaugustin):

 * version:  1.2 => 1.3
 * easy:   => 0
 * stage:  Unreviewed => Accepted


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.