Re: [Django] #2594: Template system should handle whitespace better

2010-12-13 Thread Django
#2594: Template system should handle whitespace better
--+-
  Reporter:  Gary Wilson   | Owner:  
jshedd
Status:  new  | Milestone:  
  
 Component:  Template system  |   Version:  SVN 
  
Resolution:   |  Keywords:  
  
 Stage:  Accepted | Has_patch:  1   
  
Needs_docs:  1|   Needs_tests:  0   
  
Needs_better_patch:  1|  
--+-
Changes (by mrmachine):

 * cc: mrmachine (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-upda...@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] r14914 - django/trunk/tests/modeltests/fixtures

2010-12-13 Thread noreply
Author: SmileyChris
Date: 2010-12-13 18:37:42 -0600 (Mon, 13 Dec 2010)
New Revision: 14914

Modified:
   django/trunk/tests/modeltests/fixtures/models.py
Log:
Tiny doc fix. Thanks kizzo.

Modified: django/trunk/tests/modeltests/fixtures/models.py
===
--- django/trunk/tests/modeltests/fixtures/models.py2010-12-13 19:37:48 UTC 
(rev 14913)
+++ django/trunk/tests/modeltests/fixtures/models.py2010-12-14 00:37:42 UTC 
(rev 14914)
@@ -4,7 +4,7 @@
 Fixtures are a way of loading data into the database in bulk. Fixure data
 can be stored in any serializable format (including JSON and XML). Fixtures
 are identified by name, and are stored in either a directory named 'fixtures'
-in the application directory, on in one of the directories named in the
+in the application directory, or in one of the directories named in the
 ``FIXTURE_DIRS`` setting.
 """
 

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@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] #14902: Won't delete files with accents (or other unicode characters)

2010-12-13 Thread Django
#14902: Won't delete files with accents (or other unicode characters)
-+--
  Reporter:  typeshige   | Owner:  nobody 
Status:  new | Milestone: 
 Component:  Core framework  |   Version:  1.2
Resolution:  |  Keywords:  unicode
 Stage:  Unreviewed  | Has_patch:  0  
Needs_docs:  0   |   Needs_tests:  0  
Needs_better_patch:  0   |  
-+--
Changes (by typeshige):

  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 I've been doing more testing and it seems to fail on 'normal' filenames
 sometimes too.

 It seem to fail on the same filename whenever doing something like:
 {{{
 Image.objects.all().delete()
 }}}
 or
 {{{

 import os
 for i in Image.objects.all():
 print i.image.path
 os.stat(i.image.path)

 }}}

 It fails on the same file each time, so if I isolate the offending object
 like this:
 {{{
 t = Image.objects.all(title='the problem file')
 os.stat(t.image.path)
 }}}
 there is no problem.  How can this be?  Are the loops too fast?

 My model Image looks like this:
 {{{
 class Image(models.Model):
 title = models.CharField(max_length=255)
 image = models.ImageField(upload_to=get_file_path)
 }}}

-- 
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-upda...@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] #9964: Transaction middleware closes the transaction only when it's marked as dirty

2010-12-13 Thread Django
#9964: Transaction middleware closes the transaction only when it's marked as
dirty
---+
  Reporter:  ishirav   | Owner:  
mtredinnick 
Status:  assigned  | Milestone:  1.3
 
 Component:  Database layer (models, ORM)  |   Version:  1.0-beta-1 
 
Resolution:|  Keywords:  
transactions
 Stage:  Accepted  | Has_patch:  1  
 
Needs_docs:  0 |   Needs_tests:  0  
 
Needs_better_patch:  0 |  
---+
Comment (by shai):

 Hi,

 I just updated both patches -- the bugfix approach (earlier version was
 named "v2") and the deprecation approach ("v3") -- to apply cleanly
 against r14913. In view of today's post on the Django Blog, I really want
 to get these fixes in this time.

 Should we change the triage stage to "Design decision needed"? On one
 hand, "Accepted" is more advanced; on the other hand, someone needs to
 pick one of the patches...

 Until a committer can make this choice, I urge all interested parties to
 review the patches. If we aren't stepping back in the triaging process, we
 should step forward, and this requires someone -- not a committer, but not
 me (as the patch author), to say the patch is ready for checkin. Both
 patches include tests and documentation.

 Thanks,
 Shai.

-- 
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-upda...@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] #14902: Won't delete files with accents (or other unicode characters)

2010-12-13 Thread Django
#14902: Won't delete files with accents (or other unicode characters)
+---
 Reporter:  typeshige   |   Owner:  nobody
   Status:  new |   Milestone:
Component:  Core framework  | Version:  1.2   
 Keywords:  unicode |   Stage:  Unreviewed
Has_patch:  0   |  
+---
 I did some searches and didn't find it.  I have a model with an
 ImageField.  When I try to delete, it fails whenever the filename has
 accents.  I'm using Linux.


 /home/django/.virtualenvs/astrobiology/lib/python2.6/site-
 packages/django/core/files/storage.pyc in delete(self, name)
 190 name = self.path(name)
 191 # If the file exists, delete it from the filesystem.

 --> 192 if os.path.exists(name):
 193 os.remove(name)
 194

 /home/django/.virtualenvs/astrobiology/lib/python2.6/genericpath.pyc in
 exists(path)
  16 """Test whether a path exists.  Returns False for broken
 symbolic links"""
  17 try:
 ---> 18 st = os.stat(path)
  19 except os.error:
  20 return False

 UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in
 position 103: ordinal not in range(128)

-- 
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-upda...@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] #14901: Typo in class-based views paginator doc.

2010-12-13 Thread Django
#14901: Typo in class-based views paginator doc.
---+
 Reporter:  adamv  |   Owner:  nobody
   Status:  new|   Milestone:
Component:  Documentation  | Version:  SVN   
 Keywords: |   Stage:  Unreviewed
Has_patch:  1  |  
---+
 The attached patch fixes a typo in the method signature in the class-
 based-views 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-upda...@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] #14900: Allow override of Admin paginator.

2010-12-13 Thread Django
#14900: Allow override of Admin paginator.
--+-
 Reporter:  adamv |   Owner:  nobody
   Status:  new   |   Milestone:
Component:  django.contrib.admin  | Version:  SVN   
 Keywords:  admin pagination  |   Stage:  Unreviewed
Has_patch:  1 |  
--+-
 This patch allows the user to override the Paginator object used by the
 Admin changelist view. It is based on r14828 which adds this support to
 generic views. It also partially addresses #4065, in the sense that the
 user can now add a custom paginator that "disables" pagination, or always
 shows everything on page 1, 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-upda...@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] #11716: Various methods in django.db.models.fields don't wrap ValueErrors and allow them to escape

2010-12-13 Thread Django
#11716: Various methods in django.db.models.fields don't wrap ValueErrors and 
allow
them to escape
---+
  Reporter:  Leo   | Owner:  Leo
Status:  assigned  | Milestone:  1.3
 Component:  Database layer (models, ORM)  |   Version:  SVN
Resolution:|  Keywords: 
 Stage:  Accepted  | Has_patch:  1  
Needs_docs:  1 |   Needs_tests:  0  
Needs_better_patch:  0 |  
---+
Comment (by Leo):

 timo, thanks for pointing that out. r13751 fixes the initial problem that
 I posted, however it changes the behavior of the to_python function in the
 same way as my proposed patch - which means that according to the
 discussion in this ticket it requires the same backwards incompatible
 documentation. Code that caught `ValueError` on that field before will now
 not catch it.

 The patch for this ticket makes the same fix across several other models
 and makes the API here consistent. @kmtracey, I don't think that there's a
 backward compatible solution here, precisely because it's trying to fix
 behavior that's broken. Having ValidationError extend from ValueError is a
 bad idea that's going to affect a LOT more of the codebase and client
 code.

 @lukeplant all of the test changes were necessary because the tests were
 testing the broken API, just like they were in r13751. The expected
 exception is a `ValidationError` not a `ValueError`.

 I will spend time this week to add a note to the backwards compatibility
 for this patch. Hopefully it's not too late for 1.3.

-- 
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-upda...@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] #14899: 'ModelFormOptions' object has no attribute 'many_to_many'

2010-12-13 Thread Django
#14899: 'ModelFormOptions' object has no attribute 'many_to_many'
--+-
 Reporter:  silent1mezzo  |   Owner:  nobody
   Status:  new   |   Milestone:
Component:  Forms | Version:  1.2   
 Keywords:|   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 When trying to use the modelformset_factory I get the following error.

 {{{
 Environment:
 Request Method: GET
 Django Version: 1.2.3
 Python Version: 2.6.6

 Traceback:
 File "/home/webdev/web/virtualenvs/polaris/lib/python2.6/site-
 packages/django/core/handlers/base.py" in get_response
   100. response = callback(request, *callback_args,
 **callback_kwargs)
 File "/home/webdev/web/virtualenvs/polaris/lib/python2.6/site-
 packages/django/views/decorators/cache.py" in _wrapped_view_func
   69. response = view_func(request, *args, **kwargs)
 File
 "/home/webdev/web/virtualenvs/polaris/polaris/apps/smart_project/views.py"
 in update
   46. ServiceFormSet = modelformset_factory(ServiceForm)
 File "/home/webdev/web/virtualenvs/polaris/lib/python2.6/site-
 packages/django/forms/models.py" in modelformset_factory
   675.  formfield_callback=formfield_callback)
 File "/home/webdev/web/virtualenvs/polaris/lib/python2.6/site-
 packages/django/forms/models.py" in modelform_factory
   413. return ModelFormMetaclass(class_name, (form,),
 form_class_attrs)
 File "/home/webdev/web/virtualenvs/polaris/lib/python2.6/site-
 packages/django/forms/models.py" in __new__
   226.   opts.exclude, opts.widgets,
 formfield_callback)
 File "/home/webdev/web/virtualenvs/polaris/lib/python2.6/site-
 packages/django/forms/models.py" in fields_for_model
   167. for f in opts.fields + opts.many_to_many:

 Exception Type: AttributeError at /smart/update/awefawf/
 Exception Value: 'ModelFormOptions' object has no attribute 'many_to_many'
 }}}

 Here's my model
 {{{
 class Services(models.Model):
 departure_id = models.ForeignKey(Departures)
 service_name = models.TextField()
 service_code = models.CharField(max_length=20)
 service_date = models.DateField()
 service_type = models.CharField(max_length=40)
 paid_by = models.CharField(max_length=40)
 cost = models.DecimalField(max_digits=10, decimal_places=2)
 cost_currency = models.CharField(max_length=6)
 deleted = models.BooleanField()
 deleted_by = models.IntegerField()
 deleted_reason = models.TextField()
 validated = models.BooleanField()
 validated_by = models.IntegerField()
 updated = models.DateField(auto_now=True)
 }}}

 Here's my form
 {{{
 class ServiceForm(forms.ModelForm):
 class Meta:
 model = Services
 exclude = ('departure_id',)
 }}}

 Here's my initialization
 {{{
 ServiceFormSet = modelformset_factory(ServiceForm)
 }}}

-- 
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-upda...@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] #4065: Ability to disable admin pagination

2010-12-13 Thread Django
#4065: Ability to disable admin pagination
--+-
  Reporter:  Marek Kubica   | Owner:  
adamv 
Status:  new  | Milestone:  
  
 Component:  django.contrib.admin |   Version:  SVN 
  
Resolution:   |  Keywords:  
nfa-changelist
 Stage:  Someday/Maybe| Has_patch:  0   
  
Needs_docs:  0|   Needs_tests:  0   
  
Needs_better_patch:  0|  
--+-
Changes (by adamv):

  * owner:  xian => adamv

Comment:

 I'm working on a patch for this, basically, the same thing done in r14828,
 allow custom Paginators, but for the Admin app.

 (Possibly there could be a "NullPaginator" class that always put
 everything on Page 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-upda...@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] #14898: Move validate_sql functionality into backend

2010-12-13 Thread Django
#14898: Move validate_sql functionality into backend
--+-
 Reporter:  Xof   |   Owner:  nobody
   Status:  new   |   Milestone:
Component:  Database layer (models, ORM)  | Version:  1.3-alpha 
 Keywords:|   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 Right now, RawQuery.validate_sql does one thing: It statically checks to
 see if the query begins with "SELECT". In the case of some backends (such
 as PostgreSQL), other statements can return sets, like FETCH (from a
 cursor) and DO. It would be great to use those in raw queries as well.
 Rather than just building up a large list in the function, I suggest that
 the list be moved into the backend, or the actual guts of validate_sql be
 delegated to 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-upda...@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] #5833: Custom FilterSpecs

2010-12-13 Thread Django
#5833: Custom FilterSpecs
---+
  Reporter:  Honza_Kral| Owner:  jkocherhans
 
Status:  assigned  | Milestone: 
 
 Component:  django.contrib.admin  |   Version:  SVN
 
Resolution:|  Keywords:  nfa-someday 
list_filter filterspec nfa-changelist ep2008
 Stage:  Accepted  | Has_patch:  1  
 
Needs_docs:  1 |   Needs_tests:  1  
 
Needs_better_patch:  0 |  
---+
Comment (by subsume):

 Definitely happy with this. 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-upda...@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] #5833: Custom FilterSpecs

2010-12-13 Thread Django
#5833: Custom FilterSpecs
---+
  Reporter:  Honza_Kral| Owner:  jkocherhans
 
Status:  assigned  | Milestone: 
 
 Component:  django.contrib.admin  |   Version:  SVN
 
Resolution:|  Keywords:  nfa-someday 
list_filter filterspec nfa-changelist ep2008
 Stage:  Accepted  | Has_patch:  1  
 
Needs_docs:  1 |   Needs_tests:  1  
 
Needs_better_patch:  0 |  
---+
Comment (by bendavis78):

 @subsume, I see what you're getting at.  I still, however, think that
 yours is a rare use-case.  In the case of the Comapnies/Locations example,
 I think it would make more sense to just have a !LocationAdmin to filter
 on locations.  While I still think most developers would want the default
 behavior to work like a normal queryset chain,  I can see the benefit of
 having the option open,  so as a compromise I propose we move the querset
 processing code out into a different function so that the default behavior
 can be overidden:

 (from django/contrib/admin/views/main.py, near line 178)
 {{{
 #!python

 def apply_filter_specs(self, qs, lookup_params):
 # Let every filter spec modify the qs and params to its liking
 for filter_spec in self.filter_specs:
 new_qs = filter_spec.get_query_set(self, qs)
 if new_qs is not None and new_qs is not False:
 qs = new_qs
 # Only consume params if we got a new queryset
 for param in filter_spec.consumed_params():
 try:
 del lookup_params[param]
 except KeyError:
 pass
 return qs

 def get_query_set(self):
 qs = self.root_query_set
 lookup_params = self.params.copy() # a dictionary of the query
 string
 for i in (ALL_VAR, ORDER_VAR, ORDER_TYPE_VAR, SEARCH_VAR,
 IS_POPUP_VAR):
 if i in lookup_params:
 del lookup_params[i]
 key = ''
 for key, value in lookup_params.items():
 if not isinstance(key, str):
 # 'key' will be used as a keyword argument later, so
 Python
 # requires it to be a string.
 del lookup_params[key]
 lookup_params[smart_str(key)] = value

 # if key ends with __in, split parameter into separate values
 if key.endswith('__in'):
 lookup_params[key] = value.split(',')

 # if key ends with __isnull, special case '' and false
 if key.endswith('__isnull'):
 if value.lower() in ('', 'false'):
 lookup_params[key] = False
 else:
 lookup_params[key] = True

 qs = self.apply_filter_specs(qs, lookup_params)

 # Apply lookup parameters from the query string.
 }}}

 In your case, you would be able to override apply_filter_specs in to
 change that behavior.  By no means am i the authority on this ticket, so
 if anyone else can chime with their opinion please do.

-- 
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-upda...@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] r14913 - django/branches/releases/1.2.X/docs/topics/forms

2010-12-13 Thread noreply
Author: Alex
Date: 2010-12-13 13:37:48 -0600 (Mon, 13 Dec 2010)
New Revision: 14913

Modified:
   django/branches/releases/1.2.X/docs/topics/forms/formsets.txt
Log:
[1.2.X] Fixed #14897 -- fixed some synax highlighting in the formset 
documentation.  Thanks to marcusf for the patch.  Backport of [14912].

Modified: django/branches/releases/1.2.X/docs/topics/forms/formsets.txt
===
--- django/branches/releases/1.2.X/docs/topics/forms/formsets.txt   
2010-12-13 19:37:18 UTC (rev 14912)
+++ django/branches/releases/1.2.X/docs/topics/forms/formsets.txt   
2010-12-13 19:37:48 UTC (rev 14913)
@@ -376,6 +376,7 @@
 formset = ArticleFormSet(request.POST, request.FILES)
 if formset.is_valid():
 # do something with the formset.cleaned_data
+pass
 else:
 formset = ArticleFormSet()
 return render_to_response('manage_articles.html', {'formset': formset})
@@ -425,6 +426,7 @@
 book_formset = BookFormSet(request.POST, request.FILES, 
prefix='books')
 if article_formset.is_valid() and book_formset.is_valid():
 # do something with the cleaned_data on the formsets.
+pass
 else:
 article_formset = ArticleFormSet(prefix='articles')
 book_formset = BookFormSet(prefix='books')

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@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] r14912 - django/trunk/docs/topics/forms

2010-12-13 Thread noreply
Author: Alex
Date: 2010-12-13 13:37:18 -0600 (Mon, 13 Dec 2010)
New Revision: 14912

Modified:
   django/trunk/docs/topics/forms/formsets.txt
Log:
Fixed #14897 -- fixed some synax highlighting in the formset documentation.  
Thanks to marcusf for the patch.

Modified: django/trunk/docs/topics/forms/formsets.txt
===
--- django/trunk/docs/topics/forms/formsets.txt 2010-12-13 13:58:38 UTC (rev 
14911)
+++ django/trunk/docs/topics/forms/formsets.txt 2010-12-13 19:37:18 UTC (rev 
14912)
@@ -381,6 +381,7 @@
 formset = ArticleFormSet(request.POST, request.FILES)
 if formset.is_valid():
 # do something with the formset.cleaned_data
+pass
 else:
 formset = ArticleFormSet()
 return render_to_response('manage_articles.html', {'formset': formset})
@@ -430,6 +431,7 @@
 book_formset = BookFormSet(request.POST, request.FILES, 
prefix='books')
 if article_formset.is_valid() and book_formset.is_valid():
 # do something with the cleaned_data on the formsets.
+pass
 else:
 article_formset = ArticleFormSet(prefix='articles')
 book_formset = BookFormSet(prefix='books')

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@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] #5425: Incorrect plurals in admin pagination template

2010-12-13 Thread Django
#5425: Incorrect plurals in admin pagination template
+---
  Reporter:  Petr Marhoun   | Owner:  
nobody 
Status:  closed | Milestone:
 
 Component:  django.contrib.admin   |   Version:
 
Resolution:  duplicate  |  Keywords:  
admin, internationalization
 Stage:  Accepted   | Has_patch:  1 
 
Needs_docs:  0  |   Needs_tests:  0 
 
Needs_better_patch:  0  |  
+---
Changes (by lukeplant):

  * status:  reopened => closed
  * resolution:  => duplicate
  * stage:  Ready for checkin => Accepted

Comment:

 Closing this as a duplicate of #14844, because that has more discussion
 about how to correctly fix this.

-- 
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-upda...@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] #8647: Add support for user password encryption algorithm selection

2010-12-13 Thread Django
#8647: Add support for user password encryption algorithm selection
-+--
  Reporter:  sammyrulez  | Owner:   
  
Status:  new | Milestone:   
  
 Component:  Authentication  |   Version:  SVN  
  
Resolution:  |  Keywords:  password 
encryption
 Stage:  Design decision needed  | Has_patch:  1
  
Needs_docs:  0   |   Needs_tests:  1
  
Needs_better_patch:  0   |  
-+--
Changes (by adamnelson):

  * owner:  sammyrulez =>
  * status:  assigned => new

Comment:

 Is this an inactive 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-upda...@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] #14886: GeoModelAdmin forms cannot be used with WMS in formats other than image/jpeg

2010-12-13 Thread Django
#14886: GeoModelAdmin forms cannot be used with WMS in formats other than
image/jpeg
-+--
  Reporter:  slinkp  | Owner:  nobody
Status:  new | Milestone:
 Component:  GIS |   Version:  1.2   
Resolution:  |  Keywords:
 Stage:  Unreviewed  | Has_patch:  1 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Changes (by slinkp):

  * needs_better_patch:  => 0
  * has_patch:  0 => 1
  * 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-upda...@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] #4976: The contrib.humanize templatetags fail when given None.

2010-12-13 Thread Django
#4976: The contrib.humanize templatetags fail when given None.
+---
  Reporter:  anonymous  | Owner: 
Status:  new| Milestone: 
 Component:  Contrib apps   |   Version:  SVN
Resolution: |  Keywords: 
 Stage:  Ready for checkin  | Has_patch:  1  
Needs_docs:  0  |   Needs_tests:  0  
Needs_better_patch:  0  |  
+---
Changes (by jezdez):

  * 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-upda...@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] #14897: Formset examples lack syntax highlighting

2010-12-13 Thread Django
#14897: Formset examples lack syntax highlighting
+---
 Reporter:  marcusf |   Owner:  nobody  
  
   Status:  new |   Milestone:  1.3 
  
Component:  Documentation   | Version:  SVN 
  
 Keywords:  formset, code example, syntax highlighting  |   Stage:  
Unreviewed
Has_patch:  1   |  
+---
 Two of the examples in the formset documentation doesn't get highlighted
 due to the lack of if-statement bodies.

 The patch adds two pass-statements to trigger the highlighting.

-- 
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-upda...@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] #14896: Delete leads to IntegrityError : bad cascading rule when there's a ManyToManyField pointing to a class having subclasses.

2010-12-13 Thread Django
#14896: Delete leads to IntegrityError : bad cascading rule when there's a
ManyToManyField pointing to a class having subclasses.
--+-
 Reporter:  tbrizzi   |   Owner:  nobody
   Status:  new   |   Milestone:  1.3   
Component:  Database layer (models, ORM)  | Version:  1.3-alpha 
 Keywords:|   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 I'm working on a scientific Django based application. One of its features
 is to store all researchers of a laboratory and relative contacts like
 addresses, phones, faxes, websites or emails :

 {{{
 class Contact(Cast):
 """Base class of all type of contacts like Address, Phone, Fax, E-mail
 or Website."""
 label = models.CharField(max_length=100)

 def __unicode__(self):
 return self.label

 class Meta :
 ordering = ['label']

 class EMail(Contact):
 """A subclass of Contact to store an EMail address."""
 identifier = models.EmailField(verbose_name="address", max_length=256)

 def __unicode__(self):
 st = "%s : %s" % (self.label, self.identifier)
 return st

 class Meta:
 verbose_name = "e-mail"

 class Researcher(models.Model):
 """Anybody working in a ScientificStructure."""
 first_name = models.CharField(max_length=30)
 last_name = models.CharField(max_length=30)
 photo = models.ImageField(upload_to="uploads/images/photos",
 null=True, blank=True)
 db_user = models.OneToOneField(User, null=True, blank=True,
 verbose_name="database user")
 contacts = models.ManyToManyField(Contact, null=True, blank=True)
 notes = models.TextField(null=True, blank=True)

 def get_full_name(self):
 """Get the full name of a Researcher, i.e. the combination between
 its first and last names."""
 return "%s %s" % (self.first_name, self.last_name)

 def __unicode__(self):
 return self.get_full_name()

 class Meta:
 ordering = ['last_name', 'first_name']
 }}}

 From IPython, I create and link together a Researcher and an EMail address
 :

 {{{

 In [1]: from helmholtz.people.models import EMail, Researcher

 In [2]: researcher = Researcher.objects.create(first_name='Django',
 last_name='Reinhardt')

 In [3]: email = EMail.objects.create(label='django reinhardt email',
 identifier='django.reinha...@gmail.com')

 In [4]: researcher.contacts.add(email)

 }}}

 When I execute the following piece of code from IPython, the interpreter
 returns this :

 {{{


 In [5]: email.delete()
 ---
 IntegrityErrorTraceback (most recent call
 last)

 C:\Users\Thierry.NeuroInf-DB_2\ in ()

 D:\Thierry\Projects\django-svn\django\db\models\base.pyc in delete(self,
 using)
 577 collector = Collector(using=using)
 578 collector.collect([self])
 --> 579 collector.delete()
 580
 581 delete.alters_data = True

 D:\Thierry\Projects\django-svn\django\db\models\deletion.pyc in
 decorated(self, *args, **kwargs)
  48 func(self, *args, **kwargs)
  49 if forced_managed:
 ---> 50 transaction.commit(using=self.using)
  51 else:
  52
 transaction.commit_unless_managed(using=self.using)

 D:\Thierry\Projects\django-svn\django\db\transaction.pyc in commit(using)
 199 using = DEFAULT_DB_ALIAS
 200 connection = connections[using]
 --> 201 connection._commit()
 202 set_clean(using=using)
 203

 D:\Thierry\Projects\django-
 svn\django\db\backends\postgresql_psycopg2\base.pyc in _commit(self)
 198 if self.connection is not None:
 199 try:
 --> 200 return self.connection.commit()
 201 except Database.IntegrityError, e:
 202 raise utils.IntegrityError,
 utils.IntegrityError(*tuple(e)), sys.exc_info()[2]

 IntegrityError: ERROR:  UPDATE or DELETE on table "people_contact"
 violates foreign key constraint
 "people_researcher_contacts_contact_id_fkey" on table
 "people_researcher_contacts"
 DETAIL:  key (id)=(5) is still referenced from table
 "people_researcher_contacts".

 }}}

 Seems there's a bad cascading rule when there's a many to many field
 pointing to a class having subclasses.

 This error has never happened before Django 1.3 alpha.

-- 
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-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
d

Re: [Django] #2445: [patch] allow callable values for limit_choices_to

2010-12-13 Thread Django
#2445: [patch] allow callable values for limit_choices_to
+---
  Reporter:  mich...@actrix.gen.nz  | Owner:  nobody
Status:  new| Milestone:
 Component:  Core framework |   Version:
Resolution: |  Keywords:
 Stage:  Accepted   | Has_patch:  1 
Needs_docs:  1  |   Needs_tests:  1 
Needs_better_patch:  1  |  
+---
Changes (by chrischambers):

 * cc: chrischambers (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-upda...@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] #5425: Incorrect plurals in admin pagination template

2010-12-13 Thread Django
#5425: Incorrect plurals in admin pagination template
+---
  Reporter:  Petr Marhoun   | Owner:  
nobody 
Status:  reopened   | Milestone:
 
 Component:  django.contrib.admin   |   Version:
 
Resolution: |  Keywords:  
admin, internationalization
 Stage:  Ready for checkin  | Has_patch:  1 
 
Needs_docs:  0  |   Needs_tests:  0 
 
Needs_better_patch:  0  |  
+---
Changes (by lukeplant):

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

-- 
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-upda...@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] r14911 - in django/branches/releases/1.2.X: django/views tests/regressiontests/views tests/regressiontests/views/app0 tests/regressiontests/views/app0/locale tests/regressiontests/views/ap

2010-12-13 Thread noreply
Author: jezdez
Date: 2010-12-13 07:58:38 -0600 (Mon, 13 Dec 2010)
New Revision: 14911

Added:
   django/branches/releases/1.2.X/tests/regressiontests/views/app0/
   django/branches/releases/1.2.X/tests/regressiontests/views/app0/__init__.py
   django/branches/releases/1.2.X/tests/regressiontests/views/app0/locale/
   django/branches/releases/1.2.X/tests/regressiontests/views/app0/locale/en/
   
django/branches/releases/1.2.X/tests/regressiontests/views/app0/locale/en/LC_MESSAGES/
   
django/branches/releases/1.2.X/tests/regressiontests/views/app0/locale/en/LC_MESSAGES/djangojs.mo
   
django/branches/releases/1.2.X/tests/regressiontests/views/app0/locale/en/LC_MESSAGES/djangojs.po
Modified:
   django/branches/releases/1.2.X/django/views/i18n.py
   django/branches/releases/1.2.X/tests/regressiontests/views/tests/i18n.py
   django/branches/releases/1.2.X/tests/regressiontests/views/urls.py
Log:
[1.2.X] Fixed #13726 -- Further refine changes made in r12384 and r13069 for 
using non-English source languages in JavaScript translation catalogues. 
Thanks, Ramiro.

Backport from trunk.

Modified: django/branches/releases/1.2.X/django/views/i18n.py
===
--- django/branches/releases/1.2.X/django/views/i18n.py 2010-12-13 13:58:09 UTC 
(rev 14910)
+++ django/branches/releases/1.2.X/django/views/i18n.py 2010-12-13 13:58:38 UTC 
(rev 14911)
@@ -177,7 +177,8 @@
 locale = to_locale(get_language())
 t = {}
 paths = []
-en_catalog_missing = False
+en_selected = locale.startswith('en')
+en_catalog_missing = True
 # first load all english languages files for defaults
 for package in packages:
 p = importlib.import_module(package)
@@ -187,13 +188,12 @@
 catalog = gettext_module.translation(domain, path, ['en'])
 t.update(catalog._catalog)
 except IOError:
-# 'en' catalog was missing.
-if locale.startswith('en'):
-# If 'en' is the selected language this would cause issues
-# later on if default_locale is something other than 'en'.
-en_catalog_missing = True
-# Otherwise it is harmless.
 pass
+else:
+# 'en' is the selected language and at least one of the packages
+# listed in `packages` has an 'en' catalog
+if en_selected:
+en_catalog_missing = False
 # next load the settings.LANGUAGE_CODE translations if it isn't english
 if default_locale != 'en':
 for path in paths:
@@ -205,12 +205,11 @@
 t.update(catalog._catalog)
 # last load the currently selected language, if it isn't identical to the 
default.
 if locale != default_locale:
-# If the flag en_catalog_missing has been set, the currently
-# selected language is English but it doesn't have a translation
-# catalog (presumably due to being the language translated from).
-# If that is the case, a wrong language catalog might have been
-# loaded in the previous step. It needs to be discarded.
-if en_catalog_missing:
+# If the currently selected language is English but it doesn't have a
+# translation catalog (presumably due to being the language translated
+# from) then a wrong language catalog might have been loaded in the
+# previous step. It needs to be discarded.
+if en_selected and en_catalog_missing:
 t = {}
 else:
 locale_t = {}

Added: 
django/branches/releases/1.2.X/tests/regressiontests/views/app0/__init__.py
===
--- django/branches/releases/1.2.X/tests/regressiontests/views/app0/__init__.py 
(rev 0)
+++ django/branches/releases/1.2.X/tests/regressiontests/views/app0/__init__.py 
2010-12-13 13:58:38 UTC (rev 14911)
@@ -0,0 +1 @@
+#

Added: 
django/branches/releases/1.2.X/tests/regressiontests/views/app0/locale/en/LC_MESSAGES/djangojs.mo
===
--- 
django/branches/releases/1.2.X/tests/regressiontests/views/app0/locale/en/LC_MESSAGES/djangojs.mo
   (rev 0)
+++ 
django/branches/releases/1.2.X/tests/regressiontests/views/app0/locale/en/LC_MESSAGES/djangojs.mo
   2010-12-13 13:58:38 UTC (rev 14911)
@@ -0,0 +1,10 @@
+Þ  •,   <   P   5   Q   5   ‡   $   ½  
  il faut traduire cette chaîne de caractères de app0 Project-Id-Version: 
PACKAGE VERSION
+Report-Msgid-Bugs-To: 
+POT-Creation-Date: 2007-09-15 19:15+0200
+PO-Revision-Date: 2010-05-12 12:41-0300
+Last-Translator: FULL NAME 
+Language-Team: LANGUAGE 
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+ this app0 string is to be translated 
\ No newline at end of file

Added: 
django/branches/releases/1.2.X/tests/regressiontest

Re: [Django] #14848: model verbose name

2010-12-13 Thread Django
#14848: model verbose name
+---
  Reporter:  madisv | Owner:  nobody
Status:  new| Milestone:
 Component:  Documentation  |   Version:  1.2   
Resolution: |  Keywords:
 Stage:  Accepted   | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by timo):

  * needs_better_patch:  => 0
  * stage:  Unreviewed => Accepted
  * component:  Uncategorized => Documentation
  * 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-upda...@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] r14910 - django/branches/releases/1.2.X/django/core/management/commands

2010-12-13 Thread noreply
Author: jezdez
Date: 2010-12-13 07:58:09 -0600 (Mon, 13 Dec 2010)
New Revision: 14910

Modified:
   django/branches/releases/1.2.X/django/core/management/commands/shell.py
Log:
[1.2.X] Fixed #12735 and #14892 -- Fixed support for the latest IPython 
(development) version in the shell management command.

Backport from trunk (r14895).

Modified: 
django/branches/releases/1.2.X/django/core/management/commands/shell.py
===
--- django/branches/releases/1.2.X/django/core/management/commands/shell.py 
2010-12-13 13:57:54 UTC (rev 14909)
+++ django/branches/releases/1.2.X/django/core/management/commands/shell.py 
2010-12-13 13:58:09 UTC (rev 14910)
@@ -23,11 +23,21 @@
 if use_plain:
 # Don't bother loading IPython, because the user wants plain 
Python.
 raise ImportError
-import IPython
-# Explicitly pass an empty list as arguments, because otherwise 
IPython
-# would use sys.argv from this script.
-shell = IPython.Shell.IPShell(argv=[])
-shell.mainloop()
+try:
+from IPython.frontend.terminal.embed import 
TerminalInteractiveShell
+shell = TerminalInteractiveShell()
+shell.mainloop()
+except ImportError:
+# IPython < 0.11
+# Explicitly pass an empty list as arguments, because otherwise
+# IPython would use sys.argv from this script.
+try:
+from IPython.Shell import IPShell
+shell = IPShell(argv=[])
+shell.mainloop()
+except ImportError:
+# IPython not found at all, raise ImportError
+raise
 except ImportError:
 import code
 # Set up a dictionary to serve as the environment for the shell, so

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@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] r14909 - django/branches/releases/1.2.X/django/contrib/auth

2010-12-13 Thread noreply
Author: jezdez
Date: 2010-12-13 07:57:54 -0600 (Mon, 13 Dec 2010)
New Revision: 14909

Modified:
   django/branches/releases/1.2.X/django/contrib/auth/views.py
Log:
[1.2.X] Fixed #14446 -- Prevented the password reset confirmation view to be 
cached. Thanks, Paul and Gabriel.

Backport from trunk (r14890).

Modified: django/branches/releases/1.2.X/django/contrib/auth/views.py
===
--- django/branches/releases/1.2.X/django/contrib/auth/views.py 2010-12-13 
13:57:38 UTC (rev 14908)
+++ django/branches/releases/1.2.X/django/contrib/auth/views.py 2010-12-13 
13:57:54 UTC (rev 14909)
@@ -129,7 +129,7 @@
 def password_reset_done(request, 
template_name='registration/password_reset_done.html'):
 return render_to_response(template_name, 
context_instance=RequestContext(request))
 
-# Doesn't need csrf_protect since no-one can guess the URL
+...@never_cache
 def password_reset_confirm(request, uidb36=None, token=None, 
template_name='registration/password_reset_confirm.html',
token_generator=default_token_generator, 
set_password_form=SetPasswordForm,
post_reset_redirect=None):

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@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] r14908 - in django/branches/releases/1.2.X: django/contrib/admin/views tests/regressiontests/admin_changelist

2010-12-13 Thread noreply
Author: jezdez
Date: 2010-12-13 07:57:38 -0600 (Mon, 13 Dec 2010)
New Revision: 14908

Modified:
   django/branches/releases/1.2.X/django/contrib/admin/views/main.py
   
django/branches/releases/1.2.X/tests/regressiontests/admin_changelist/tests.py
Log:
[1.2.X] Fixed #14312 -- Raising an ``IncorrectLookupParameters`` if the page 
number given to an admin change list exceeds the number of the last page. 
Thanks, mk.

Backport from trunk (r14889).

Modified: django/branches/releases/1.2.X/django/contrib/admin/views/main.py
===
--- django/branches/releases/1.2.X/django/contrib/admin/views/main.py   
2010-12-13 13:57:15 UTC (rev 14907)
+++ django/branches/releases/1.2.X/django/contrib/admin/views/main.py   
2010-12-13 13:57:38 UTC (rev 14908)
@@ -116,7 +116,7 @@
 try:
 result_list = paginator.page(self.page_num+1).object_list
 except InvalidPage:
-result_list = ()
+raise IncorrectLookupParameters
 
 self.result_count = result_count
 self.full_result_count = full_result_count

Modified: 
django/branches/releases/1.2.X/tests/regressiontests/admin_changelist/tests.py
===
--- 
django/branches/releases/1.2.X/tests/regressiontests/admin_changelist/tests.py  
2010-12-13 13:57:15 UTC (rev 14907)
+++ 
django/branches/releases/1.2.X/tests/regressiontests/admin_changelist/tests.py  
2010-12-13 13:57:38 UTC (rev 14908)
@@ -1,4 +1,5 @@
 from django.contrib import admin
+from django.contrib.admin.options import IncorrectLookupParameters
 from django.contrib.admin.views.main import ChangeList
 from django.template import Context, Template
 from django.test import TransactionTestCase
@@ -71,6 +72,28 @@
 self.assertFalse('%s' % editable_name_field == -1,
 'Failed to find "name" list_editable field in: %s' % table_output)
 
+def test_result_list_editable(self):
+"""
+Regression test for #14312: list_editable with pagination
+"""
+
+new_parent = Parent.objects.create(name='parent')
+for i in range(200):
+new_child = Child.objects.create(name='name %s' % i, 
parent=new_parent)
+request = MockRequest()
+request.GET['p'] = -1 # Anything outside range
+m = ChildAdmin(Child, admin.site)
+
+# Test with list_editable fields
+m.list_display = ['id', 'name', 'parent']
+m.list_display_links = ['id']
+m.list_editable = ['name']
+self.assertRaises(IncorrectLookupParameters, lambda: \
+ChangeList(request, Child, 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))
+
+
 class ChildAdmin(admin.ModelAdmin):
 list_display = ['name', 'parent']
 def queryset(self, request):

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@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] r14907 - in django/branches/releases/1.2.X: django/forms tests/regressiontests/forms/tests

2010-12-13 Thread noreply
Author: jezdez
Date: 2010-12-13 07:57:15 -0600 (Mon, 13 Dec 2010)
New Revision: 14907

Modified:
   django/branches/releases/1.2.X/django/forms/widgets.py
   django/branches/releases/1.2.X/tests/regressiontests/forms/tests/widgets.py
Log:
[1.2.X] Fixed #14158 -- Fixed SelectMultiple._has_changed to not assume same 
order of data anymore. Thanks, akaariai and dmoisset.

Backport from trunk (r14887).

Modified: django/branches/releases/1.2.X/django/forms/widgets.py
===
--- django/branches/releases/1.2.X/django/forms/widgets.py  2010-12-13 
13:56:55 UTC (rev 14906)
+++ django/branches/releases/1.2.X/django/forms/widgets.py  2010-12-13 
13:57:15 UTC (rev 14907)
@@ -527,10 +527,9 @@
 data = []
 if len(initial) != len(data):
 return True
-for value1, value2 in zip(initial, data):
-if force_unicode(value1) != force_unicode(value2):
-return True
-return False
+initial_set = set([force_unicode(value) for value in initial])
+data_set = set([force_unicode(value) for value in data])
+return data_set != initial_set
 
 class RadioInput(StrAndUnicode):
 """

Modified: 
django/branches/releases/1.2.X/tests/regressiontests/forms/tests/widgets.py
===
--- django/branches/releases/1.2.X/tests/regressiontests/forms/tests/widgets.py 
2010-12-13 13:56:55 UTC (rev 14906)
+++ django/branches/releases/1.2.X/tests/regressiontests/forms/tests/widgets.py 
2010-12-13 13:57:15 UTC (rev 14907)
@@ -830,6 +830,7 @@
 self.assertFalse(w._has_changed([1, 2], [u'1', u'2']))
 self.assertTrue(w._has_changed([1, 2], [u'1']))
 self.assertTrue(w._has_changed([1, 2], [u'1', u'3']))
+self.assertFalse(w._has_changed([2, 1], [u'1', u'2']))
 
 # Unicode choices are correctly rendered as HTML
 self.assertEqual(w.render('nums', ['ŠĐĆŽćžšđ'], choices=[('ŠĐĆŽćžšđ', 
'ŠĐabcĆŽćžšđ'), ('ćžšđ', 'abcćžšđ')]), u'\n 1\n 2\n 3\n 
\u0160\u0110abc\u0106\u017d\u0107\u017e\u0161\u0111\n 
abc\u0107\u017e\u0161\u0111\n')

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@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] r14906 - in django/branches/releases/1.2.X: django/forms tests/regressiontests/model_forms_regress

2010-12-13 Thread noreply
Author: jezdez
Date: 2010-12-13 07:56:55 -0600 (Mon, 13 Dec 2010)
New Revision: 14906

Modified:
   django/branches/releases/1.2.X/django/forms/models.py
   
django/branches/releases/1.2.X/tests/regressiontests/model_forms_regress/tests.py
Log:
[1.2.X] Fixed #14144 -- Made sure custom validators are called in 
ModelMultipleChoiceFields. Thanks, matiasb.

Backport from trunk (r14886).

Modified: django/branches/releases/1.2.X/django/forms/models.py
===
--- django/branches/releases/1.2.X/django/forms/models.py   2010-12-13 
13:56:38 UTC (rev 14905)
+++ django/branches/releases/1.2.X/django/forms/models.py   2010-12-13 
13:56:55 UTC (rev 14906)
@@ -1035,6 +1035,9 @@
 for val in value:
 if force_unicode(val) not in pks:
 raise ValidationError(self.error_messages['invalid_choice'] % 
val)
+# Since this overrides the inherited ModelChoiceField.clean
+# we run custom validators here
+self.run_validators(value)
 return qs
 
 def prepare_value(self, value):

Modified: 
django/branches/releases/1.2.X/tests/regressiontests/model_forms_regress/tests.py
===
--- 
django/branches/releases/1.2.X/tests/regressiontests/model_forms_regress/tests.py
   2010-12-13 13:56:38 UTC (rev 14905)
+++ 
django/branches/releases/1.2.X/tests/regressiontests/model_forms_regress/tests.py
   2010-12-13 13:56:55 UTC (rev 14906)
@@ -31,6 +31,22 @@
 selected = f.clean([1, 3, 5, 7, 9])
 self.assertEquals(len(db.connection.queries), 1)
 
+def test_model_multiple_choice_run_validators(self):
+"""
+Test that ModelMultipleChoiceField run given validators (#14144).
+"""
+for i in range(30):
+Person.objects.create(name="Person %s" % i)
+
+self._validator_run = False
+def my_validator(value):
+self._validator_run = True
+
+f = forms.ModelMultipleChoiceField(queryset=Person.objects.all(),
+   validators=[my_validator])
+f.clean([1,2])
+self.assertTrue(self._validator_run)
+
 class TripleForm(forms.ModelForm):
 class Meta:
 model = Triple

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@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] r14905 - in django/branches/releases/1.2.X: django/contrib/sitemaps/management/commands docs/ref/contrib

2010-12-13 Thread noreply
Author: jezdez
Date: 2010-12-13 07:56:38 -0600 (Mon, 13 Dec 2010)
New Revision: 14905

Modified:
   
django/branches/releases/1.2.X/django/contrib/sitemaps/management/commands/ping_google.py
   django/branches/releases/1.2.X/docs/ref/contrib/sitemaps.txt
Log:
[1.2.X] Fixed #14805 -- Capitalize "Google" in sitemaps docs. Thanks, Adam.

Backport from trunk (r14884).

Modified: 
django/branches/releases/1.2.X/django/contrib/sitemaps/management/commands/ping_google.py
===
--- 
django/branches/releases/1.2.X/django/contrib/sitemaps/management/commands/ping_google.py
   2010-12-13 13:56:18 UTC (rev 14904)
+++ 
django/branches/releases/1.2.X/django/contrib/sitemaps/management/commands/ping_google.py
   2010-12-13 13:56:38 UTC (rev 14905)
@@ -3,7 +3,7 @@
 
 
 class Command(BaseCommand):
-help = "Ping google with an updated sitemap, pass optional url of sitemap"
+help = "Ping Google with an updated sitemap, pass optional url of sitemap"
 
 def execute(self, *args, **options):
 if len(args) == 1:

Modified: django/branches/releases/1.2.X/docs/ref/contrib/sitemaps.txt
===
--- django/branches/releases/1.2.X/docs/ref/contrib/sitemaps.txt
2010-12-13 13:56:18 UTC (rev 14904)
+++ django/branches/releases/1.2.X/docs/ref/contrib/sitemaps.txt
2010-12-13 13:56:38 UTC (rev 14905)
@@ -346,6 +346,6 @@
 .. versionadded:: 1.0
 
 Once the sitemaps application is added to your project, you may also
-ping the Google server's through the command line manage.py interface::
+ping Google using the ``ping_google`` management command::
 
 python manage.py ping_google [/sitemap.xml]

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@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] r14904 - django/branches/releases/1.2.X/django/contrib/admin/media/css

2010-12-13 Thread noreply
Author: jezdez
Date: 2010-12-13 07:56:18 -0600 (Mon, 13 Dec 2010)
New Revision: 14904

Modified:
   django/branches/releases/1.2.X/django/contrib/admin/media/css/rtl.css
Log:
[1.2.X] Fixed #13856 -- Float admin's top links on the right for RTL languages.

Backport from trunk (r14881).

Modified: django/branches/releases/1.2.X/django/contrib/admin/media/css/rtl.css
===
--- django/branches/releases/1.2.X/django/contrib/admin/media/css/rtl.css   
2010-12-13 13:56:02 UTC (rev 14903)
+++ django/branches/releases/1.2.X/django/contrib/admin/media/css/rtl.css   
2010-12-13 13:56:18 UTC (rev 14904)
@@ -82,6 +82,10 @@
 
 /* changelists styles */
 
+.change-list ul.toplinks li {
+float: right;
+}
+
 .change-list .filtered {
 background: white url(../img/admin/changelist-bg_rtl.gif) top left 
repeat-y !important;
 }

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@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] r14903 - django/branches/releases/1.2.X/django/db/models/fields

2010-12-13 Thread noreply
Author: jezdez
Date: 2010-12-13 07:56:02 -0600 (Mon, 13 Dec 2010)
New Revision: 14903

Modified:
   django/branches/releases/1.2.X/django/db/models/fields/files.py
Log:
[1.2.X] Fixed #12955 -- Use the size attribute of the file instead of len() to 
support uploads larger than 2GB. Thanks, swiedenroth and isagalaev.

Backport from trunk (r14878).

Modified: django/branches/releases/1.2.X/django/db/models/fields/files.py
===
--- django/branches/releases/1.2.X/django/db/models/fields/files.py 
2010-12-13 13:55:46 UTC (rev 14902)
+++ django/branches/releases/1.2.X/django/db/models/fields/files.py 
2010-12-13 13:56:02 UTC (rev 14903)
@@ -73,7 +73,7 @@
 def _get_size(self):
 self._require_file()
 if not self._committed:
-return len(self.file)
+return self.file.size
 return self.storage.size(self.name)
 size = property(_get_size)
 
@@ -93,7 +93,7 @@
 setattr(self.instance, self.field.name, self.name)
 
 # Update the filesize cache
-self._size = len(content)
+self._size = content.size
 self._committed = True
 
 # Save the object because it has changed, unless save is 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-upda...@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] r14902 - django/branches/releases/1.2.X/django/views

2010-12-13 Thread noreply
Author: jezdez
Date: 2010-12-13 07:55:46 -0600 (Mon, 13 Dec 2010)
New Revision: 14902

Modified:
   django/branches/releases/1.2.X/django/views/debug.py
Log:
[1.2.X] Fixed #11990 -- Show the correct URLconf in the technical 404 template 
even if it was overridden, e.g. in a middleware. Thanks, mattbennett.

Backport from trunk (r14877).

Modified: django/branches/releases/1.2.X/django/views/debug.py
===
--- django/branches/releases/1.2.X/django/views/debug.py2010-12-13 
13:52:52 UTC (rev 14901)
+++ django/branches/releases/1.2.X/django/views/debug.py2010-12-13 
13:55:46 UTC (rev 14902)
@@ -2,6 +2,7 @@
 import os
 import re
 import sys
+import types
 
 from django.conf import settings
 from django.http import HttpResponse, HttpResponseServerError, 
HttpResponseNotFound
@@ -275,8 +276,13 @@
 # tried exists but is an empty list. The URLconf must've been 
empty.
 return empty_urlconf(request)
 
+urlconf = getattr(request, 'urlconf', settings.ROOT_URLCONF)
+if isinstance(urlconf, types.ModuleType):
+urlconf = urlconf.__name__
+
 t = Template(TECHNICAL_404_TEMPLATE, name='Technical 404 template')
 c = Context({
+'urlconf': urlconf,
 'root_urlconf': settings.ROOT_URLCONF,
 'request_path': request.path_info[1:], # Trim leading slash
 'urlpatterns': tried,
@@ -773,7 +779,7 @@
   
 {% if urlpatterns %}
   
-  Using the URLconf defined in {{ settings.ROOT_URLCONF }},
+  Using the URLconf defined in {{ urlconf }},
   Django tried these URL patterns, in this order:
   
   

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@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] r14901 - in django/trunk: django/views tests/regressiontests/views tests/regressiontests/views/app0 tests/regressiontests/views/app0/locale tests/regressiontests/views/app0/locale/en tests

2010-12-13 Thread noreply
Author: jezdez
Date: 2010-12-13 07:52:52 -0600 (Mon, 13 Dec 2010)
New Revision: 14901

Added:
   django/trunk/tests/regressiontests/views/app0/
   django/trunk/tests/regressiontests/views/app0/__init__.py
   django/trunk/tests/regressiontests/views/app0/locale/
   django/trunk/tests/regressiontests/views/app0/locale/en/
   django/trunk/tests/regressiontests/views/app0/locale/en/LC_MESSAGES/
   
django/trunk/tests/regressiontests/views/app0/locale/en/LC_MESSAGES/djangojs.mo
   
django/trunk/tests/regressiontests/views/app0/locale/en/LC_MESSAGES/djangojs.po
Modified:
   django/trunk/django/views/i18n.py
   django/trunk/tests/regressiontests/views/tests/i18n.py
   django/trunk/tests/regressiontests/views/urls.py
Log:
Fixed #13726 -- Further refine changes made in r12384 and r13069 for using 
non-English source languages in JavaScript translation catalogues. Thanks, 
Ramiro.

Modified: django/trunk/django/views/i18n.py
===
--- django/trunk/django/views/i18n.py   2010-12-13 13:52:21 UTC (rev 14900)
+++ django/trunk/django/views/i18n.py   2010-12-13 13:52:52 UTC (rev 14901)
@@ -194,7 +194,8 @@
 locale = to_locale(get_language())
 t = {}
 paths = []
-en_catalog_missing = False
+en_selected = locale.startswith('en')
+en_catalog_missing = True
 # first load all english languages files for defaults
 for package in packages:
 p = importlib.import_module(package)
@@ -204,13 +205,12 @@
 catalog = gettext_module.translation(domain, path, ['en'])
 t.update(catalog._catalog)
 except IOError:
-# 'en' catalog was missing.
-if locale.startswith('en'):
-# If 'en' is the selected language this would cause issues
-# later on if default_locale is something other than 'en'.
-en_catalog_missing = True
-# Otherwise it is harmless.
 pass
+else:
+# 'en' is the selected language and at least one of the packages
+# listed in `packages` has an 'en' catalog
+if en_selected:
+en_catalog_missing = False
 # next load the settings.LANGUAGE_CODE translations if it isn't english
 if default_locale != 'en':
 for path in paths:
@@ -222,12 +222,11 @@
 t.update(catalog._catalog)
 # last load the currently selected language, if it isn't identical to the 
default.
 if locale != default_locale:
-# If the flag en_catalog_missing has been set, the currently
-# selected language is English but it doesn't have a translation
-# catalog (presumably due to being the language translated from).
-# If that is the case, a wrong language catalog might have been
-# loaded in the previous step. It needs to be discarded.
-if en_catalog_missing:
+# If the currently selected language is English but it doesn't have a
+# translation catalog (presumably due to being the language translated
+# from) then a wrong language catalog might have been loaded in the
+# previous step. It needs to be discarded.
+if en_selected and en_catalog_missing:
 t = {}
 else:
 locale_t = {}

Added: django/trunk/tests/regressiontests/views/app0/__init__.py
===
--- django/trunk/tests/regressiontests/views/app0/__init__.py   
(rev 0)
+++ django/trunk/tests/regressiontests/views/app0/__init__.py   2010-12-13 
13:52:52 UTC (rev 14901)
@@ -0,0 +1 @@
+#

Added: 
django/trunk/tests/regressiontests/views/app0/locale/en/LC_MESSAGES/djangojs.mo
===
--- 
django/trunk/tests/regressiontests/views/app0/locale/en/LC_MESSAGES/djangojs.mo 
(rev 0)
+++ 
django/trunk/tests/regressiontests/views/app0/locale/en/LC_MESSAGES/djangojs.mo 
2010-12-13 13:52:52 UTC (rev 14901)
@@ -0,0 +1,10 @@
+Þ  •,   <   P   5   Q   5   ‡   $   ½  
  il faut traduire cette chaîne de caractères de app0 Project-Id-Version: 
PACKAGE VERSION
+Report-Msgid-Bugs-To: 
+POT-Creation-Date: 2007-09-15 19:15+0200
+PO-Revision-Date: 2010-05-12 12:41-0300
+Last-Translator: FULL NAME 
+Language-Team: LANGUAGE 
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+ this app0 string is to be translated 
\ No newline at end of file

Added: 
django/trunk/tests/regressiontests/views/app0/locale/en/LC_MESSAGES/djangojs.po
===
--- 
django/trunk/tests/regressiontests/views/app0/locale/en/LC_MESSAGES/djangojs.po 
(rev 0)
+++ 
django/trunk/tests/regressiontests/views/app0/locale/en/LC_MESSAGES/djangojs.po 
2010-12-13 13:52:52 UTC (rev 14901)
@@ -0,0 +1,20 @@
+#

[Changeset] r14899 - in django/trunk: django/utils docs/ref/templates

2010-12-13 Thread noreply
Author: jezdez
Date: 2010-12-13 07:51:28 -0600 (Mon, 13 Dec 2010)
New Revision: 14899

Modified:
   django/trunk/django/utils/dateformat.py
   django/trunk/django/utils/dates.py
   django/trunk/docs/ref/templates/builtins.txt
Log:
Fixed #14570 -- Added new date format character for alternative month names 
using the new context capabilities. Also add context to Associated Press style 
month names (refs #9988). Thanks to Claude and shell_dweller.

Modified: django/trunk/django/utils/dateformat.py
===
--- django/trunk/django/utils/dateformat.py 2010-12-13 13:41:12 UTC (rev 
14898)
+++ django/trunk/django/utils/dateformat.py 2010-12-13 13:51:28 UTC (rev 
14899)
@@ -14,12 +14,12 @@
 import re
 import time
 import calendar
-from django.utils.dates import MONTHS, MONTHS_3, MONTHS_AP, WEEKDAYS, 
WEEKDAYS_ABBR
+from django.utils.dates import MONTHS, MONTHS_3, MONTHS_ALT, MONTHS_AP, 
WEEKDAYS, WEEKDAYS_ABBR
 from django.utils.tzinfo import LocalTimezone
 from django.utils.translation import ugettext as _
 from django.utils.encoding import force_unicode
 
-re_formatchars = 
re.compile(r'(?http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #14894: translation is not threadsafe

2010-12-13 Thread Django
#14894: translation is not threadsafe
-+--
  Reporter:  maxbublis   | Owner:  nobody  
Status:  new | Milestone:  1.3 
 Component:  Core framework  |   Version:  1.2 
Resolution:  |  Keywords:  threadsafety translation
 Stage:  Accepted| Has_patch:  1   
Needs_docs:  0   |   Needs_tests:  0   
Needs_better_patch:  0   |  
-+--
Changes (by jezdez):

  * needs_better_patch:  => 0
  * stage:  Unreviewed => Accepted
  * 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-upda...@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] r14898 - django/branches/releases/1.2.X/django/contrib/admin/templates/admin

2010-12-13 Thread noreply
Author: lukeplant
Date: 2010-12-13 07:41:12 -0600 (Mon, 13 Dec 2010)
New Revision: 14898

Modified:
   
django/branches/releases/1.2.X/django/contrib/admin/templates/admin/pagination.html
Log:
[1.2.X] Reverted [13998] because it never worked.

Refs #5425, #14844

Backport of [14897] from trunk.

Modified: 
django/branches/releases/1.2.X/django/contrib/admin/templates/admin/pagination.html
===
--- 
django/branches/releases/1.2.X/django/contrib/admin/templates/admin/pagination.html
 2010-12-13 13:20:02 UTC (rev 14897)
+++ 
django/branches/releases/1.2.X/django/contrib/admin/templates/admin/pagination.html
 2010-12-13 13:41:12 UTC (rev 14898)
@@ -6,7 +6,7 @@
 {% paginator_number cl i %}
 {% endfor %}
 {% endif %}
-{% blocktrans with cl.opts.verbose_name as verbose_name and 
cl.opts.verbose_name_plural as verbose_name_plural count cl.result_count as 
count %}{{ count }} {{ verbose_name }}{% plural %}{{ count }} {{ 
verbose_name_plural }}{% endblocktrans %}
+{{ cl.result_count }} {% ifequal cl.result_count 1 %}{{ cl.opts.verbose_name 
}}{% else %}{{ cl.opts.verbose_name_plural }}{% endifequal %}
 {% if show_all_url %}  {% trans 'Show all' %}{% endif %}
 {% if cl.formset and cl.result_count %}{% endif %}
 

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@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] #14895: USE_THOUSAND_SEPARATOR causes error on group admin operations

2010-12-13 Thread Django
#14895: USE_THOUSAND_SEPARATOR causes error on group admin operations
-+--
 Reporter:  Tuttle   |   Owner:  nobody
   Status:  new  |   Milestone:
Component:  django.contrib.admin | Version:  SVN   
 Keywords:  l10n localization thousands  |   Stage:  Unreviewed
Has_patch:  0|  
-+--
 Line in
 `django/contrib/admin/templates/admin/delete_selected_confirmation.html`:
 {{{
 
 }}}

 obj.pk is rendered with thousands separated (if such localization is
 enabled), results in exception like

 {{{
 ValueError: invalid literal for int() with base 10: '1 307'
 }}}

 on submit.

-- 
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-upda...@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] #14750: ILPostalCodeField doesn't handle EMPTY_VALUES correctly

2010-12-13 Thread Django
#14750: ILPostalCodeField doesn't handle EMPTY_VALUES correctly
-+--
  Reporter:  idangazit   | Owner:  idangazit
Status:  assigned| Milestone:  1.3  
 Component:  django.contrib.localflavor  |   Version:  1.2  
Resolution:  |  Keywords:   
 Stage:  Ready for checkin   | Has_patch:  1
Needs_docs:  0   |   Needs_tests:  0
Needs_better_patch:  0   |  
-+--
Changes (by claudep):

  * stage:  Unreviewed => Ready for checkin
  * milestone:  => 1.3

-- 
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-upda...@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] r14897 - django/trunk/django/contrib/admin/templates/admin

2010-12-13 Thread noreply
Author: lukeplant
Date: 2010-12-13 07:20:02 -0600 (Mon, 13 Dec 2010)
New Revision: 14897

Modified:
   django/trunk/django/contrib/admin/templates/admin/pagination.html
Log:
Reverted [13998] because it never worked.

Refs #5425, #14844

Modified: django/trunk/django/contrib/admin/templates/admin/pagination.html
===
--- django/trunk/django/contrib/admin/templates/admin/pagination.html   
2010-12-12 23:03:24 UTC (rev 14896)
+++ django/trunk/django/contrib/admin/templates/admin/pagination.html   
2010-12-13 13:20:02 UTC (rev 14897)
@@ -6,7 +6,7 @@
 {% paginator_number cl i %}
 {% endfor %}
 {% endif %}
-{% blocktrans with cl.opts.verbose_name as verbose_name and 
cl.opts.verbose_name_plural as verbose_name_plural count cl.result_count as 
count %}{{ count }} {{ verbose_name }}{% plural %}{{ count }} {{ 
verbose_name_plural }}{% endblocktrans %}
+{{ cl.result_count }} {% ifequal cl.result_count 1 %}{{ cl.opts.verbose_name 
}}{% else %}{{ cl.opts.verbose_name_plural }}{% endifequal %}
 {% if show_all_url %}  {% trans 'Show all' %}{% endif %}
 {% if cl.formset and cl.result_count %}{% endif %}
 

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@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] #14894: translation is not threadsafe

2010-12-13 Thread Django
#14894: translation is not threadsafe
--+-
 Reporter:  maxbublis |   Owner:  nobody
   Status:  new   |   Milestone:  1.3   
Component:  Core framework| Version:  1.2   
 Keywords:  threadsafety translation  |   Stage:  Unreviewed
Has_patch:  1 |  
--+-
 I've got the following error in my multithreading application:
 {{{
 Traceback (most recent call last):
  File "/usr/local/lib/python2.6/site-
 packages/django/core/handlers/base.py", line 80, in get_response
response = middleware_method(request)
  File "/usr/local/lib/python2.6/site-
 packages/django/middleware/locale.py", line 17, in process_request
translation.activate(language)
  File "/usr/local/lib/python2.6/site-
 packages/django/utils/translation/__init__.py", line 66, in activate
return real_activate(language)
  File "/usr/local/lib/python2.6/site-packages/django/utils/functional.py",
 line 55, in _curried
return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs))
  File "/usr/local/lib/python2.6/site-
 packages/django/utils/translation/__init__.py", line 36, in delayed_loader
return getattr(trans, real_name)(*args, **kwargs)
  File "/usr/local/lib/python2.6/site-
 packages/django/utils/translation/trans_real.py", line 193, in activate
_active[currentThread()] = translation(language)
  File "/usr/local/lib/python2.6/site-
 packages/django/utils/translation/trans_real.py", line 177, in translation
current_translation = _fetch(language, fallback=default_translation)
  File "/usr/local/lib/python2.6/site-
 packages/django/utils/translation/trans_real.py", line 141, in _fetch
if base_lang(lang) in [base_lang(trans) for trans in _translations]:

 RuntimeError: dictionary changed size during iteration
 }}}

 The reason is not threadsafe global _translations dictionary in
 django.utils.translation.trans_real module. In one thread you could
 iterate
 
[http://code.djangoproject.com/browser/django/trunk/django/utils/translation/trans_real.py#L148
 over it] and change it
 
[http://code.djangoproject.com/browser/django/trunk/django/utils/translation/trans_real.py#L180
 in another one], that could lead to the above RuntimeError.

 Patch attached.

-- 
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-upda...@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.