[Changeset] r12020 - django/branches/soc2009/model-validation/tests/modeltests/validation

2009-12-28 Thread noreply
Author: Honza_Kral
Date: 2009-12-28 22:05:33 -0600 (Mon, 28 Dec 2009)
New Revision: 12020

Removed:
   
django/branches/soc2009/model-validation/tests/modeltests/validation/test_messages.py
Log:
[soc2009/model-validation] removed some unused tests

This behavior is covered by existing form tests

Deleted: 
django/branches/soc2009/model-validation/tests/modeltests/validation/test_messages.py
===
--- 
django/branches/soc2009/model-validation/tests/modeltests/validation/test_messages.py
   2009-12-29 04:05:17 UTC (rev 12019)
+++ 
django/branches/soc2009/model-validation/tests/modeltests/validation/test_messages.py
   2009-12-29 04:05:33 UTC (rev 12020)
@@ -1,8 +0,0 @@
-import unittest
-
-from django.db import models
-
-class CustomMessagesTests(unittest.TestCase):
-def test_custom_message_is_used_when_present(self):
-pass
-

--

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] r12019 - django/branches/soc2009/model-validation/tests/modeltests/validation

2009-12-28 Thread noreply
Author: Honza_Kral
Date: 2009-12-28 22:05:17 -0600 (Mon, 28 Dec 2009)
New Revision: 12019

Modified:
   
django/branches/soc2009/model-validation/tests/modeltests/validation/test_unique.py
Log:
[soc2009/model-validation] Added some comments to explain why I set DEBUG in 
tests

Modified: 
django/branches/soc2009/model-validation/tests/modeltests/validation/test_unique.py
===
--- 
django/branches/soc2009/model-validation/tests/modeltests/validation/test_unique.py
 2009-12-29 04:04:59 UTC (rev 12018)
+++ 
django/branches/soc2009/model-validation/tests/modeltests/validation/test_unique.py
 2009-12-29 04:05:17 UTC (rev 12019)
@@ -29,10 +29,12 @@
 
 class PerformUniqueChecksTest(unittest.TestCase):
 def setUp(self):
+# set debug to True to gain access to connection.queries
 self._old_debug, settings.DEBUG = settings.DEBUG, True
 super(PerformUniqueChecksTest, self).setUp()
 
 def tearDown(self):
+# restore old debug value
 settings.DEBUG = self._old_debug
 super(PerformUniqueChecksTest, self).tearDown()
 

--

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] r12018 - in django/branches/soc2009/model-validation: django/forms tests/regressiontests/forms tests/regressiontests/forms/localflavor

2009-12-28 Thread noreply
Author: Honza_Kral
Date: 2009-12-28 22:04:59 -0600 (Mon, 28 Dec 2009)
New Revision: 12018

Modified:
   django/branches/soc2009/model-validation/django/forms/fields.py
   
django/branches/soc2009/model-validation/tests/regressiontests/forms/error_messages.py
   
django/branches/soc2009/model-validation/tests/regressiontests/forms/fields.py
   
django/branches/soc2009/model-validation/tests/regressiontests/forms/localflavor/ar.py
   
django/branches/soc2009/model-validation/tests/regressiontests/forms/localflavor/is_.py
Log:
[soc2009/model-validation] Migrated CharField to use validators

Modified: django/branches/soc2009/model-validation/django/forms/fields.py
===
--- django/branches/soc2009/model-validation/django/forms/fields.py 
2009-12-29 04:04:36 UTC (rev 12017)
+++ django/branches/soc2009/model-validation/django/forms/fields.py 
2009-12-29 04:04:59 UTC (rev 12018)
@@ -170,19 +170,13 @@
 return result
 
 class CharField(Field):
-default_error_messages = {
-'max_length': _(u'Ensure this value has at most %(max)d characters (it 
has %(length)d).'),
-'min_length': _(u'Ensure this value has at least %(min)d characters 
(it has %(length)d).'),
-}
-
 def __init__(self, max_length=None, min_length=None, *args, **kwargs):
 self.max_length, self.min_length = max_length, min_length
 super(CharField, self).__init__(*args, **kwargs)
-# TODO: use this as soon as you make regex validator and use it in 
RegexField
-#if min_length is not None:
-#self.validators.append(validators.MinLengthValidator(min_length))
-#if max_length is not None:
-#self.validators.append(validators.MaxLengthValidator(max_length))
+if min_length is not None:
+self.validators.append(validators.MinLengthValidator(min_length))
+if max_length is not None:
+self.validators.append(validators.MaxLengthValidator(max_length))
 
 def to_python(self, value):
 "Returns a Unicode object."
@@ -190,18 +184,6 @@
 return u''
 return smart_unicode(value)
 
-def validate(self, value):
-"Validates max_length and min_length."
-super(CharField, self).validate(value)
-if value in validators.EMPTY_VALUES:
-# non-required field, no need for further validation
-return
-value_length = len(value)
-if self.max_length is not None and value_length > self.max_length:
-raise ValidationError(self.error_messages['max_length'] % {'max': 
self.max_length, 'length': value_length})
-if self.min_length is not None and value_length < self.min_length:
-raise ValidationError(self.error_messages['min_length'] % {'min': 
self.min_length, 'length': value_length})
-
 def widget_attrs(self, widget):
 if self.max_length is not None and isinstance(widget, (TextInput, 
PasswordInput)):
 # The HTML attribute is maxlength, not max_length.

Modified: 
django/branches/soc2009/model-validation/tests/regressiontests/forms/error_messages.py
===
--- 
django/branches/soc2009/model-validation/tests/regressiontests/forms/error_messages.py
  2009-12-29 04:04:36 UTC (rev 12017)
+++ 
django/branches/soc2009/model-validation/tests/regressiontests/forms/error_messages.py
  2009-12-29 04:04:59 UTC (rev 12018)
@@ -6,8 +6,8 @@
 # CharField ###
 
 >>> e = {'required': 'REQUIRED'}
->>> e['min_length'] = 'LENGTH %(length)s, MIN LENGTH %(min)s'
->>> e['max_length'] = 'LENGTH %(length)s, MAX LENGTH %(max)s'
+>>> e['min_length'] = 'LENGTH %(show_value)s, MIN LENGTH %(limit_value)s'
+>>> e['max_length'] = 'LENGTH %(show_value)s, MAX LENGTH %(limit_value)s'
 >>> f = CharField(min_length=5, max_length=10, error_messages=e)
 >>> f.clean('')
 Traceback (most recent call last):
@@ -156,8 +156,8 @@
 
 >>> e = {'required': 'REQUIRED'}
 >>> e['invalid'] = 'INVALID'
->>> e['min_length'] = 'LENGTH %(length)s, MIN LENGTH %(min)s'
->>> e['max_length'] = 'LENGTH %(length)s, MAX LENGTH %(max)s'
+>>> e['min_length'] = 'LENGTH %(show_value)s, MIN LENGTH %(limit_value)s'
+>>> e['max_length'] = 'LENGTH %(show_value)s, MAX LENGTH %(limit_value)s'
 >>> f = RegexField(r'^\d+$', min_length=5, max_length=10, error_messages=e)
 >>> f.clean('')
 Traceback (most recent call last):
@@ -180,8 +180,8 @@
 
 >>> e = {'required': 'REQUIRED'}
 >>> e['invalid'] = 'INVALID'
->>> e['min_length'] = 'LENGTH %(length)s, MIN LENGTH %(min)s'
->>> e['max_length'] = 'LENGTH %(length)s, MAX LENGTH %(max)s'
+>>> e['min_length'] = 'LENGTH %(show_value)s, MIN LENGTH %(limit_value)s'
+>>> e['max_length'] = 'LENGTH %(show_value)s, MAX LENGTH %(limit_value)s'
 >>> f = EmailField(min_length=8, max_length=10, error_messages=e)
 >>> f.clean('')
 Traceback (most recent cal

[Changeset] r12017 - django/branches/soc2009/model-validation/django/forms

2009-12-28 Thread noreply
Author: Honza_Kral
Date: 2009-12-28 22:04:36 -0600 (Mon, 28 Dec 2009)
New Revision: 12017

Modified:
   django/branches/soc2009/model-validation/django/forms/models.py
Log:
[soc2009/model-validation] Removing some unused code

Modified: django/branches/soc2009/model-validation/django/forms/models.py
===
--- django/branches/soc2009/model-validation/django/forms/models.py 
2009-12-29 02:53:26 UTC (rev 12016)
+++ django/branches/soc2009/model-validation/django/forms/models.py 
2009-12-29 04:04:36 UTC (rev 12017)
@@ -12,9 +12,9 @@
 from django.core.exceptions import ValidationError, NON_FIELD_ERRORS
 from django.core.validators import EMPTY_VALUES
 from util import ErrorList
-from forms import BaseForm, get_declared_fields, NON_FIELD_ERRORS
-from fields import Field, ChoiceField, IntegerField
-from widgets import Select, SelectMultiple, HiddenInput, MultipleHiddenInput
+from forms import BaseForm, get_declared_fields
+from fields import Field, ChoiceField
+from widgets import SelectMultiple, HiddenInput, MultipleHiddenInput
 from widgets import media_property
 from formsets import BaseFormSet, formset_factory, DELETION_FIELD_NAME
 
@@ -131,7 +131,7 @@
 the ``fields`` argument.
 """
 # avoid a circular import
-from django.db.models.fields.related import ManyToManyField, OneToOneField
+from django.db.models.fields.related import ManyToManyField
 opts = instance._meta
 data = {}
 for f in opts.fields + opts.many_to_many:
@@ -260,163 +260,6 @@
 
 return self.cleaned_data
 
-def validate_unique(self):
-unique_checks, date_checks = self._get_unique_checks()
-form_errors = []
-bad_fields = set()
-
-field_errors, global_errors = 
self._perform_unique_checks(unique_checks)
-bad_fields.union(field_errors)
-form_errors.extend(global_errors)
-
-field_errors, global_errors = self._perform_date_checks(date_checks)
-bad_fields.union(field_errors)
-form_errors.extend(global_errors)
-
-for field_name in bad_fields:
-del self.cleaned_data[field_name]
-if form_errors:
-# Raise the unique together errors since they are considered
-# form-wide.
-raise ValidationError(form_errors)
-
-def _get_unique_checks(self):
-from django.db.models.fields import FieldDoesNotExist, Field as 
ModelField
-
-# Gather a list of checks to perform. We only perform unique checks
-# for fields present and not None in cleaned_data.  Since this is a
-# ModelForm, some fields may have been excluded; we can't perform a 
unique
-# check on a form that is missing fields involved in that check.  It 
also does
-# not make sense to check data that didn't validate, and since NULL 
does not
-# equal NULL in SQL we should not do any unique checking for NULL 
values.
-unique_checks = []
-# these are checks for the unique_for_
-date_checks = []
-for check in self.instance._meta.unique_together[:]:
-fields_on_form = [field for field in check if 
self.cleaned_data.get(field) is not None]
-if len(fields_on_form) == len(check):
-unique_checks.append(check)
-
-# Gather a list of checks for fields declared as unique and add them to
-# the list of checks. Again, skip empty fields and any that did not 
validate.
-for name in self.fields:
-try:
-f = self.instance._meta.get_field_by_name(name)[0]
-except FieldDoesNotExist:
-# This is an extra field that's not on the ModelForm, ignore it
-continue
-if not isinstance(f, ModelField):
-# This is an extra field that happens to have a name that 
matches,
-# for example, a related object accessor for this model.  So
-# get_field_by_name found it, but it is not a Field so do not 
proceed
-# to use it as if it were.
-continue
-if self.cleaned_data.get(name) is None:
-continue
-if f.unique:
-unique_checks.append((name,))
-if f.unique_for_date and self.cleaned_data.get(f.unique_for_date) 
is not None:
-date_checks.append(('date', name, f.unique_for_date))
-if f.unique_for_year and self.cleaned_data.get(f.unique_for_year) 
is not None:
-date_checks.append(('year', name, f.unique_for_year))
-if f.unique_for_month and 
self.cleaned_data.get(f.unique_for_month) is not None:
-date_checks.append(('month', name, f.unique_for_month))
-return unique_checks, date_checks
-
-
-def _perform_unique_checks(self, unique_checks):
-bad_fields = set()
-form_errors = []
-
-for unique_check in unique_checks:
-   

[Changeset] r12016 - in django/branches/soc2009/model-validation: django/conf/locale/pl/LC_MESSAGES django/contrib/gis/db/models/sql docs/ref/models docs/ref/templates

2009-12-28 Thread noreply
Author: jkocherhans
Date: 2009-12-28 20:53:26 -0600 (Mon, 28 Dec 2009)
New Revision: 12016

Modified:
   
django/branches/soc2009/model-validation/django/conf/locale/pl/LC_MESSAGES/django.po
   
django/branches/soc2009/model-validation/django/contrib/gis/db/models/sql/query.py
   django/branches/soc2009/model-validation/docs/ref/models/querysets.txt
   django/branches/soc2009/model-validation/docs/ref/templates/builtins.txt
Log:
[soc2009/model-validation] Fixed some merge issues from [12014].

Modified: 
django/branches/soc2009/model-validation/django/conf/locale/pl/LC_MESSAGES/django.po
===
--- 
django/branches/soc2009/model-validation/django/conf/locale/pl/LC_MESSAGES/django.po
2009-12-28 17:41:56 UTC (rev 12015)
+++ 
django/branches/soc2009/model-validation/django/conf/locale/pl/LC_MESSAGES/django.po
2009-12-29 02:53:26 UTC (rev 12016)
@@ -5,11 +5,7 @@
 msgstr ""
 "Project-Id-Version: Django\n"
 "Report-Msgid-Bugs-To: \n"
-<<< HEAD
-"POT-Creation-Date: 2009-10-25 20:56+0100\n"
-===
 "POT-Creation-Date: 2009-12-23 12:55+0100\n"
->>> master
 "PO-Revision-Date: 2008-02-25 15:53+0100\n"
 "Last-Translator: Jarek Zgoda \n"
 "MIME-Version: 1.0\n"
@@ -227,11 +223,7 @@
 msgid "Successfully deleted %(count)d %(items)s."
 msgstr "Usunięto %(count)d %(items)s."
 
-<<< HEAD
-#: contrib/admin/actions.py:67 contrib/admin/options.py:1027
-===
 #: contrib/admin/actions.py:67 contrib/admin/options.py:1073
->>> master
 msgid "Are you sure?"
 msgstr "Jesteś pewien?"
 
@@ -274,17 +266,6 @@
 msgid "This year"
 msgstr "Ten rok"
 
-<<< HEAD
-#: contrib/admin/filterspecs.py:147 forms/widgets.py:435
-msgid "Yes"
-msgstr "Tak"
-
-#: contrib/admin/filterspecs.py:147 forms/widgets.py:435
-msgid "No"
-msgstr "Nie"
-
-#: contrib/admin/filterspecs.py:154 forms/widgets.py:435
-===
 #: contrib/admin/filterspecs.py:147 forms/widgets.py:431
 msgid "Yes"
 msgstr "Tak"
@@ -294,7 +275,6 @@
 msgstr "Nie"
 
 #: contrib/admin/filterspecs.py:154 forms/widgets.py:431
->>> master
 msgid "Unknown"
 msgstr "Nieznany"
 
@@ -339,15 +319,9 @@
 msgid "Changed %s."
 msgstr "Zmieniono %s"
 
-<<< HEAD
-#: contrib/admin/options.py:519 contrib/admin/options.py:529
-#: contrib/comments/templates/comments/preview.html:16 forms/models.py:384
-#: forms/models.py:596
-===
 #: contrib/admin/options.py:540 contrib/admin/options.py:550
 #: contrib/comments/templates/comments/preview.html:16 forms/models.py:385
 #: forms/models.py:598
->>> master
 msgid "and"
 msgstr "i"
 
@@ -370,57 +344,33 @@
 msgid "No fields changed."
 msgstr "Żadne pole nie zmienione."
 
-<<< HEAD
-#: contrib/admin/options.py:599 contrib/auth/admin.py:67
-===
 #: contrib/admin/options.py:620 contrib/auth/admin.py:68
->>> master
 #, python-format
 msgid "The %(name)s \"%(obj)s\" was added successfully."
 msgstr "%(name)s \"%(obj)s\" dodany pomyślnie."
 
-<<< HEAD
-#: contrib/admin/options.py:603 contrib/admin/options.py:636
-#: contrib/auth/admin.py:75
-msgid "You may edit it again below."
-msgstr "Możesz ponownie edytować wpis poniżej."
-
-#: contrib/admin/options.py:613 contrib/admin/options.py:646
-===
 #: contrib/admin/options.py:624 contrib/admin/options.py:657
 #: contrib/auth/admin.py:77
 msgid "You may edit it again below."
 msgstr "Możesz ponownie edytować wpis poniżej."
 
 #: contrib/admin/options.py:634 contrib/admin/options.py:667
->>> master
 #, python-format
 msgid "You may add another %s below."
 msgstr "Możesz dodać nowy wpis %s poniżej."
 
-<<< HEAD
-#: contrib/admin/options.py:634
-===
 #: contrib/admin/options.py:655
->>> master
 #, python-format
 msgid "The %(name)s \"%(obj)s\" was changed successfully."
 msgstr "%(name)s \"%(obj)s\" zostało pomyślnie zmienione."
 
-<<< HEAD
-#: contrib/admin/options.py:642
-===
 #: contrib/admin/options.py:663
->>> master
 #, python-format
 msgid ""
 "The %(name)s \"%(obj)s\" was added successfully. You may edit it again below."
 msgstr ""
 "%(name)s \"%(obj)s\" dodane pomyślnie. Możesz edytować ponownie wpis poniżej."
 
-<<< HEAD
-#: contrib/admin/options.py:773
-===
 #: contrib/admin/options.py:714
 msgid ""
 "Items must be selected in order to perform actions on them. No items have "
@@ -433,42 +383,25 @@
 msgstr "Nie wybrano akcji."
 
 #: contrib/admin/options.py:808
->>> master
 #, python-format
 msgid "Add %s"
 msgstr "Dodaj %s"
 
-<<< HEAD
-#: contrib/admin/options.py:804 contrib/admin/options.py:1005
-===
 #: contrib/admin/options.py:840 contrib/admin/options.py:1051
->>> master
 #, python-format
 msgid "%(name)s object with primary key %(key)r does not exist."
 msgstr "Obiekt %(name)s o kluczu głównym %(key)r nie istnieje."
 
-<<< HEAD
-#: contrib/admin/options.py:861
-===
 #: contrib/admin/options.py:905
->>> master
 #, python-format
 msgid "Change %s"
 msgstr "Zmień %s"
 
-<<< HEAD
-#: contrib/admin/options.py:905
-msgi

Re: [Django] #12455: admin_order_field for Admin list_display not working for callable

2009-12-28 Thread Django
#12455: admin_order_field for Admin list_display not working for callable
---+
  Reporter:  kegan | Owner:  brosner
   
Status:  assigned  | Milestone:  1.2
   
 Component:  django.contrib.admin  |   Version:  SVN
   
Resolution:|  Keywords:  list_display 
admin_order_field
 Stage:  Accepted  | Has_patch:  0  
   
Needs_docs:  0 |   Needs_tests:  0  
   
Needs_better_patch:  0 |  
---+
Comment (by kegan):

 Thanks Brian. Looking forward to the 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-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] #12430: Error mentioned in Understanding the ManagementForm section should link to solution

2009-12-28 Thread Django
#12430: Error mentioned in Understanding the ManagementForm section should link 
to
solution
+---
  Reporter:  Andrew | Owner:  nobody
Status:  closed | Milestone:
 Component:  Documentation  |   Version:  1.1   
Resolution:  duplicate  |  Keywords:
 Stage:  Accepted   | Has_patch:  0 
Needs_docs:  1  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by timo):

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

Comment:

 this is quite similar to #11908

-- 
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] #5335: Add an append method to ErrorDict

2009-12-28 Thread Django
#5335: Add an append method to ErrorDict
---+
  Reporter:  Thomas Güttler   | Owner:  
nobody 
Status:  reopened  | Milestone:  1.2

 Component:  Forms |   Version:  SVN

Resolution:|  Keywords:  append 
errodict
 Stage:  Design decision needed| Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  0 |  
---+
Comment (by Honza_Kral):

 This approach is in conflict with #4752 ([6142]).

 The method would either have to be on the Form class (not entirely
 insane). Another way how to propagate your error onto a field is using
 ComplexValidators present in model-validation branch, that way you don't
 have to worry about the internals of ErrorDict...

-- 
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] #2495: db.models.TextField cannot be marked unique when using mysql backend

2009-12-28 Thread Django
#2495: db.models.TextField cannot be marked unique when using mysql backend
---+
  Reporter:  anonymous | Owner:  Honza_Kral 

Status:  new   | Milestone:  1.2

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:|  Keywords:  mysql 
TextField
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  0 |  
---+
Changes (by Honza_Kral):

  * milestone:  => 1.2

Comment:

 Marking for 1.2 to get some attention. I am happy to rewrite the
 patch/tests if something is missing on inadequate.

-- 
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] #2495: db.models.TextField cannot be marked unique when using mysql backend

2009-12-28 Thread Django
#2495: db.models.TextField cannot be marked unique when using mysql backend
---+
  Reporter:  anonymous | Owner:  Honza_Kral 

Status:  new   | Milestone: 

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:|  Keywords:  mysql 
TextField
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  0 |  
---+
Comment (by Honza_Kral):

 Replying to [comment:17 danny...@toldme.com]:
 > Hello,
 >
 > How do I replace the constraint with ALTER TABLE?
 > mysql> alter table events_tag add primary key(name);
 > ERROR 1170 (42000): BLOB/TEXT column 'name' used in key specification
 without a key length

 well, specify a key length:
 mysql> alter table events_tag add primary key(name(255));
 should work

-- 
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] #12456: Make `django.forms.util.ValidationError` and `django.core.exceptions.ValidationError` share ancestry

2009-12-28 Thread Django
#12456: Make `django.forms.util.ValidationError` and
`django.core.exceptions.ValidationError` share ancestry
+---
  Reporter:  obeattie   | Owner:  Honza_Kral
Status:  new| Milestone:
 Component:  Forms  |   Version:  SVN   
Resolution: |  Keywords:
 Stage:  Fixed on a branch  | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by Honza_Kral):

  * stage:  Unreviewed => Fixed on a branch

-- 
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] #12456: Make `django.forms.util.ValidationError` and `django.core.exceptions.ValidationError` share ancestry

2009-12-28 Thread Django
#12456: Make `django.forms.util.ValidationError` and
`django.core.exceptions.ValidationError` share ancestry
-+--
  Reporter:  obeattie| Owner:  Honza_Kral
Status:  new | Milestone:
 Component:  Forms   |   Version:  SVN   
Resolution:  |  Keywords:
 Stage:  Unreviewed  | Has_patch:  0 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Changes (by Honza_Kral):

  * owner:  nobody => Honza_Kral
  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 This is fixed in the model-validation branch (#6845) where there is only
 one ValidationError used throughout Django.

-- 
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] #12457: "IOError: Too many open files" when pulling height and width values from a long list of ImageField containing Model objects.

2009-12-28 Thread Django
#12457: "IOError: Too many open files" when pulling height and width values 
from a
long list of ImageField containing Model objects.
---+
  Reporter:  legutierr | Owner:  nobody 
  
Status:  closed| Milestone: 
  
 Component:  Database layer (models, ORM)  |   Version:  1.0
  
Resolution:  duplicate |  Keywords:  "Too many 
open files"
 Stage:  Unreviewed| Has_patch:  0  
  
Needs_docs:  0 |   Needs_tests:  0  
  
Needs_better_patch:  0 |  
---+
Changes (by Alex):

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

Comment:

 Dupe of #8817.

-- 
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] #12457: "IOError: Too many open files" when pulling height and width values from a long list of ImageField containing Model objects.

2009-12-28 Thread Django
#12457: "IOError: Too many open files" when pulling height and width values 
from a
long list of ImageField containing Model objects.
--+-
 Reporter:  legutierr |   Owner:  nobody
   Status:  new   |   Milestone:
Component:  Database layer (models, ORM)  | Version:  1.0   
 Keywords:  "Too many open files" |   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 It appears as if !ImageField.width and !ImageField.height both open the
 referenced image file without closing it, resulting in the above mentioned
 IOError.

 The behavior is induced as follows: I have a long list of objects, and I
 am trying to pull out the size of the images that they reference.  After a
 certain point is reached, the IOError is raised when
 model_object.image_field.width is accessed and assigned.


 This is taking place in OSX Server Leopard running fastcgi and apache, but
 I am sure that it would occur in other configurations as well.

 I determined the nature of the problem by stepping through the code using
 pdb.  In fastcgi the exeption is caught and obfuscated.  Instead of the
 IOError being displayed, the following message is printed out directly by
 fastcgi, without any further information:

 "An unhandled exception was thrown by the application."

-- 
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] #12455: admin_order_field for Admin list_display not working for callable

2009-12-28 Thread Django
#12455: admin_order_field for Admin list_display not working for callable
---+
  Reporter:  kegan | Owner:  brosner
   
Status:  assigned  | Milestone:  1.2
   
 Component:  django.contrib.admin  |   Version:  SVN
   
Resolution:|  Keywords:  list_display 
admin_order_field
 Stage:  Accepted  | Has_patch:  0  
   
Needs_docs:  0 |   Needs_tests:  0  
   
Needs_better_patch:  0 |  
---+
Changes (by brosner):

  * owner:  nobody => brosner
  * status:  new => assigned

Comment:

 Hmm, this looks to be an oversight on the final review before committing.
 I think I see where things broke down. I'll re-review tonight and get a
 fix in.

-- 
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] #12456: Make `django.forms.util.ValidationError` and `django.core.exceptions.ValidationError` share ancestry

2009-12-28 Thread Django
#12456: Make `django.forms.util.ValidationError` and
`django.core.exceptions.ValidationError` share ancestry
--+-
 Reporter:  obeattie  |   Owner:  nobody
   Status:  new   |   Milestone:
Component:  Forms | Version:  SVN   
 Keywords:|   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 There appears to be two (similarly named) `ValidationError`s in Django
 — one living in `django.core`, and a form-specific one living in
 `django.forms.util`. I can appreciate that they have slightly differing
 uses, but it does seem like they have a lot in common. So, there would be
 a few routes one could take here:-

 1. Alias `django.forms.util.ValidationError` to the `django.core` one

 2. Make the forms version a subclass of the `django.core` one

 3. Make each share a common base exception

 Given how the exceptions are used, I'd say #2 would seem to make the most
 sense here, and wouldn't break anything. It's already rather confusing
 having two similarly-named exceptions, so I couldn't really see it being
 any more confusing to do 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.




[Changeset] r12015 - django/branches/soc2009/model-validation/django/forms

2009-12-28 Thread noreply
Author: Honza_Kral
Date: 2009-12-28 11:41:56 -0600 (Mon, 28 Dec 2009)
New Revision: 12015

Modified:
   django/branches/soc2009/model-validation/django/forms/models.py
Log:
[soc2009/model-validation] Fixed #12078 ValidationError(s) from specific fields 
not rendered on admin add/change form.

Thanks to Killarny for detailed report

Modified: django/branches/soc2009/model-validation/django/forms/models.py
===
--- django/branches/soc2009/model-validation/django/forms/models.py 
2009-12-28 16:35:23 UTC (rev 12014)
+++ django/branches/soc2009/model-validation/django/forms/models.py 
2009-12-28 17:41:56 UTC (rev 12015)
@@ -248,7 +248,7 @@
 except ValidationError, e:
 for k, v in e.message_dict.items():
 if k != NON_FIELD_ERRORS:
-self._errors.setdefault(k, []).extend(v)
+self._errors.setdefault(k, ErrorList()).extend(v)
 
 # Remove the data from the cleaned_data dict since it was 
invalid
 if k in self.cleaned_data:

--

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] r12013 - django/trunk/django/conf/locale/it

2009-12-28 Thread noreply
Author: tekNico
Date: 2009-12-28 08:17:51 -0600 (Mon, 28 Dec 2009)
New Revision: 12013

Modified:
   django/trunk/django/conf/locale/it/formats.py
Log:
Updated italian translation of formats.py

Modified: django/trunk/django/conf/locale/it/formats.py
===
--- django/trunk/django/conf/locale/it/formats.py   2009-12-28 14:15:34 UTC 
(rev 12012)
+++ django/trunk/django/conf/locale/it/formats.py   2009-12-28 14:17:51 UTC 
(rev 12013)
@@ -2,17 +2,40 @@
 # This file is distributed under the same license as the Django package.
 #
 
-DATE_FORMAT = 'd F Y'
-TIME_FORMAT = 'H.i.s'
-# DATETIME_FORMAT = 
-YEAR_MONTH_FORMAT = 'F Y'
-MONTH_DAY_FORMAT = 'j F'
-SHORT_DATE_FORMAT = 'd/M/Y'
-# SHORT_DATETIME_FORMAT = 
-# FIRST_DAY_OF_WEEK = 
-# DATE_INPUT_FORMATS = 
-# TIME_INPUT_FORMATS = 
-# DATETIME_INPUT_FORMATS = 
+DATE_FORMAT = 'd F Y' # 25 Ottobre 2006
+TIME_FORMAT = 'H:i:s' # 14:30:59
+DATETIME_FORMAT = 'w d F Y H:i:s' # Mercoledì 25 Ottobre 2006 14:30:59
+YEAR_MONTH_FORMAT = 'F Y' # Ottobre 2006
+MONTH_DAY_FORMAT = 'j/F' # 10/2006
+SHORT_DATE_FORMAT = 'd/M/Y' # 25/12/2009
+SHORT_DATETIME_FORMAT = 'd/M/Y H:i:s' # 25/10/2009 14:30:59
+FIRST_DAY_OF_WEEK = 1 # Lunedì
+DATE_INPUT_FORMATS = (
+'%Y-%m-%d', '%Y/%m/%d',  # '2008-10-25', '2008/10/25'
+'%d-%m-%Y', '%d/%m/%Y',  # '25-10-2006', '25/10/2006'
+'%d-%m-%y', '%d/%m/%y',  # '25-10-06', '25/10/06'
+)
+TIME_INPUT_FORMATS = (
+'%H:%M:%S', # '14:30:59'
+'%H:%M',# '14:30'
+)
+DATETIME_INPUT_FORMATS = (
+'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
+'%Y-%m-%d %H:%M',# '2006-10-25 14:30'
+'%Y-%m-%d',  # '2006-10-25'
+'%d-%m-%Y %H:%M:%S', # '25-10-2006 14:30:59'
+'%d-%m-%Y %H:%M',# '25-10-2006 14:30'
+'%d-%m-%Y',  # '25-10-2006'
+'%d-%m-%y %H:%M:%S', # '25-10-06 14:30:59'
+'%d-%m-%y %H:%M',# '25-10-06 14:30'
+'%d-%m-%y',  # '25-10-06'
+'%d/%m/%Y %H:%M:%S', # '25/10/2006 14:30:59'
+'%d/%m/%Y %H:%M',# '25/10/2006 14:30'
+'%d/%m/%Y',  # '25/10/2006'
+'%d/%m/%y %H:%M:%S', # '25/10/06 14:30:59'
+'%d/%m/%y %H:%M',# '25/10/06 14:30'
+'%d/%m/%y',  # '25/10/06'
+)
 DECIMAL_SEPARATOR = ','
 THOUSAND_SEPARATOR = '.'
-# NUMBER_GROUPING = 
+NUMBER_GROUPING = 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-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] r12012 - in django/branches/releases/1.1.X: . django/contrib/admin tests/regressiontests/admin_views

2009-12-28 Thread noreply
Author: lukeplant
Date: 2009-12-28 08:15:34 -0600 (Mon, 28 Dec 2009)
New Revision: 12012

Modified:
   django/branches/releases/1.1.X/
   django/branches/releases/1.1.X/django/contrib/admin/options.py
   django/branches/releases/1.1.X/tests/regressiontests/admin_views/tests.py
Log:
[1.1.X] Fixed #11191 - Admin throws 500 instead of 404 for PK of incorrect type
  
Thanks to mmachine for report and test, and Chris Beaven for the patch

Backport of r12011 from trunk




Property changes on: django/branches/releases/1.1.X
___
Name: svnmerge-integrated
   - 
/django/trunk:1-11500,11523,11527-11528,11531-11552,11554,11577,11579-11581,11588-11589,11591-11592,11596-11599,11601-11617,11619-11626,11628-11635,11637-11638,11643-11644,11648-11653,11656,11670,11678,11681,11684,11686,11688,11691,11693,11695,11697,11699,11701,11703,11705,11707,11714,11719,11732,11734,11740,11748,11751,11753,11756,11760,11800,11802,11808,11815,11817,11820,11822,11824,11826,11828,11831,11833,11835,11837,11839,11841,11844,11857,11864,11874,11876,11878,11885,11898,11901,11905,11909,11912,11914,11917,11938,11961
   + 
/django/trunk:1-11500,11523,11527-11528,11531-11552,11554,11577,11579-11581,11588-11589,11591-11592,11596-11599,11601-11617,11619-11626,11628-11635,11637-11638,11643-11644,11648-11653,11656,11670,11678,11681,11684,11686,11688,11691,11693,11695,11697,11699,11701,11703,11705,11707,11714,11719,11732,11734,11740,11748,11751,11753,11756,11760,11800,11802,11808,11815,11817,11820,11822,11824,11826,11828,11831,11833,11835,11837,11839,11841,11844,11857,11864,11874,11876,11878,11885,11898,11901,11905,11909,11912,11914,11917,11938,11961,12011

Modified: django/branches/releases/1.1.X/django/contrib/admin/options.py
===
--- django/branches/releases/1.1.X/django/contrib/admin/options.py  
2009-12-28 14:08:11 UTC (rev 12011)
+++ django/branches/releases/1.1.X/django/contrib/admin/options.py  
2009-12-28 14:15:34 UTC (rev 12012)
@@ -6,7 +6,7 @@
 from django.contrib.admin import widgets
 from django.contrib.admin import helpers
 from django.contrib.admin.util import unquote, flatten_fieldsets, 
get_deleted_objects, model_ngettext, model_format_dict
-from django.core.exceptions import PermissionDenied
+from django.core.exceptions import PermissionDenied, ValidationError
 from django.db import models, transaction
 from django.db.models.fields import BLANK_CHOICE_DASH
 from django.http import Http404, HttpResponse, HttpResponseRedirect
@@ -347,6 +347,20 @@
 defaults.update(kwargs)
 return modelform_factory(self.model, **defaults)
 
+def get_object(self, request, object_id):
+"""
+Returns an instance matching the primary key provided. ``None``  is
+returned if no match is found (or the object_id failed validation
+against the primary key field).
+"""
+queryset = self.queryset(request)
+model = queryset.model
+try:
+object_id = model._meta.pk.to_python(object_id)
+return queryset.get(pk=object_id)
+except (model.DoesNotExist, ValidationError):
+return None
+
 def get_changelist_form(self, request, **kwargs):
 """
 Returns a Form class for use in the Formset on the changelist page.
@@ -795,13 +809,7 @@
 model = self.model
 opts = model._meta
 
-try:
-obj = self.queryset(request).get(pk=unquote(object_id))
-except model.DoesNotExist:
-# Don't raise Http404 just yet, because we haven't checked
-# permissions yet. We don't want an unauthenticated user to be able
-# to determine whether a given object exists.
-obj = None
+obj = self.get_object(request, unquote(object_id))
 
 if not self.has_change_permission(request, obj):
 raise PermissionDenied
@@ -996,13 +1004,7 @@
 opts = self.model._meta
 app_label = opts.app_label
 
-try:
-obj = self.queryset(request).get(pk=unquote(object_id))
-except self.model.DoesNotExist:
-# Don't raise Http404 just yet, because we haven't checked
-# permissions yet. We don't want an unauthenticated user to be able
-# to determine whether a given object exists.
-obj = None
+obj = self.get_object(request, unquote(object_id))
 
 if not self.has_delete_permission(request, obj):
 raise PermissionDenied

Modified: 
django/branches/releases/1.1.X/tests/regressiontests/admin_views/tests.py
===
--- django/branches/releases/1.1.X/tests/regressiontests/admin_views/tests.py   
2009-12-28 14:08:11 UTC (rev 12011)
+++ django/branches/releases/1.1.X/tests/regressiontests/admin_views/tests.py   
2009-12-28 14:15:34 UTC (rev 12012)
@@ -65,11 +65,20 @@
 
 def test

Re: [Django] #12455: admin_order_field for Admin list_display not working for callable

2009-12-28 Thread Django
#12455: admin_order_field for Admin list_display not working for callable
---+
  Reporter:  kegan | Owner:  nobody 
   
Status:  new   | Milestone:  1.2
   
 Component:  django.contrib.admin  |   Version:  SVN
   
Resolution:|  Keywords:  list_display 
admin_order_field
 Stage:  Accepted  | Has_patch:  0  
   
Needs_docs:  0 |   Needs_tests:  0  
   
Needs_better_patch:  0 |  
---+
Comment (by kegan):

 Replying to ramiro: `submitted_date()` is a ModelAdmin method.

 NOTE: I am using trunk [11965].

-- 
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] #12455: admin_order_field for Admin list_display not working for callable

2009-12-28 Thread Django
#12455: admin_order_field for Admin list_display not working for callable
---+
  Reporter:  kegan | Owner:  nobody 
   
Status:  new   | Milestone:  1.2
   
 Component:  django.contrib.admin  |   Version:  SVN
   
Resolution:|  Keywords:  list_display 
admin_order_field
 Stage:  Accepted  | Has_patch:  0  
   
Needs_docs:  0 |   Needs_tests:  0  
   
Needs_better_patch:  0 |  
---+
Comment (by kmtracey):

 Replying to [comment:1 ramiro]:
 > Replying to [ticket:12455 kegan]:
 > > In the Admin, when using
 
[http://docs.djangoproject.com/en/1.1/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_display
 list_display], we should be able to make a sort callable
 >
 > What kind of callable is `submitted_date()`?. A a standalone function?
 ModelAdmin method? a model method?.

 I don't believe it matters which of these the callable is. The one I tried
 happened to be a !ModelAdmin method, but the whole block that used to set
 attr for all these different cases is now gone.  It's still there (and
 working) on the 1.1.X branch:

 
http://code.djangoproject.com/browser/django/branches/releases/1.1.X/django/contrib/admin/templatetags/admin_list.py?rev=11965#L87

-- 
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] r12011 - in django/trunk: django/contrib/admin tests/regressiontests/admin_views

2009-12-28 Thread noreply
Author: lukeplant
Date: 2009-12-28 08:08:11 -0600 (Mon, 28 Dec 2009)
New Revision: 12011

Modified:
   django/trunk/django/contrib/admin/options.py
   django/trunk/tests/regressiontests/admin_views/tests.py
Log:
Fixed #11191 - Admin throws 500 instead of 404 for PK of incorrect type

Thanks to mmachine for report and test, and Chris Beaven for the patch



Modified: django/trunk/django/contrib/admin/options.py
===
--- django/trunk/django/contrib/admin/options.py2009-12-28 13:13:04 UTC 
(rev 12010)
+++ django/trunk/django/contrib/admin/options.py2009-12-28 14:08:11 UTC 
(rev 12011)
@@ -8,7 +8,7 @@
 from django.contrib.admin.util import unquote, flatten_fieldsets, 
get_deleted_objects, model_ngettext, model_format_dict
 from django.contrib import messages
 from django.views.decorators.csrf import csrf_protect
-from django.core.exceptions import PermissionDenied
+from django.core.exceptions import PermissionDenied, ValidationError
 from django.db import models, transaction
 from django.db.models.fields import BLANK_CHOICE_DASH
 from django.http import Http404, HttpResponse, HttpResponseRedirect
@@ -368,6 +368,20 @@
 from django.contrib.admin.views.main import ChangeList
 return ChangeList
 
+def get_object(self, request, object_id):
+"""
+Returns an instance matching the primary key provided. ``None``  is
+returned if no match is found (or the object_id failed validation
+against the primary key field).
+"""
+queryset = self.queryset(request)
+model = queryset.model
+try:
+object_id = model._meta.pk.to_python(object_id)
+return queryset.get(pk=object_id)
+except (model.DoesNotExist, ValidationError):
+return None
+
 def get_changelist_form(self, request, **kwargs):
 """
 Returns a Form class for use in the Formset on the changelist page.
@@ -825,13 +839,7 @@
 model = self.model
 opts = model._meta
 
-try:
-obj = self.queryset(request).get(pk=unquote(object_id))
-except model.DoesNotExist:
-# Don't raise Http404 just yet, because we haven't checked
-# permissions yet. We don't want an unauthenticated user to be able
-# to determine whether a given object exists.
-obj = None
+obj = self.get_object(request, unquote(object_id))
 
 if not self.has_change_permission(request, obj):
 raise PermissionDenied
@@ -1036,13 +1044,7 @@
 opts = self.model._meta
 app_label = opts.app_label
 
-try:
-obj = self.queryset(request).get(pk=unquote(object_id))
-except self.model.DoesNotExist:
-# Don't raise Http404 just yet, because we haven't checked
-# permissions yet. We don't want an unauthenticated user to be able
-# to determine whether a given object exists.
-obj = None
+obj = self.get_object(request, unquote(object_id))
 
 if not self.has_delete_permission(request, obj):
 raise PermissionDenied

Modified: django/trunk/tests/regressiontests/admin_views/tests.py
===
--- django/trunk/tests/regressiontests/admin_views/tests.py 2009-12-28 
13:13:04 UTC (rev 12010)
+++ django/trunk/tests/regressiontests/admin_views/tests.py 2009-12-28 
14:08:11 UTC (rev 12011)
@@ -63,11 +63,20 @@
 
 def testBasicEditGet(self):
 """
-A smoke test to ensureGET on the change_view works.
+A smoke test to ensure GET on the change_view works.
 """
 response = self.client.get('/test_admin/%s/admin_views/section/1/' % 
self.urlbit)
 self.failUnlessEqual(response.status_code, 200)
 
+def testBasicEditGetStringPK(self):
+"""
+A smoke test to ensure GET on the change_view works (returns an HTTP
+404 error, see #11191) when passing a string as the PK argument for a
+model with an integer PK field.
+"""
+response = self.client.get('/test_admin/%s/admin_views/section/abc/' % 
self.urlbit)
+self.failUnlessEqual(response.status_code, 404)
+
 def testBasicAddPost(self):
 """
 A smoke test to ensure POST on add_view works.

--

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] #12455: admin_order_field for Admin list_display not working for callable

2009-12-28 Thread Django
#12455: admin_order_field for Admin list_display not working for callable
---+
  Reporter:  kegan | Owner:  nobody 
   
Status:  new   | Milestone:  1.2
   
 Component:  django.contrib.admin  |   Version:  SVN
   
Resolution:|  Keywords:  list_display 
admin_order_field
 Stage:  Accepted  | Has_patch:  0  
   
Needs_docs:  0 |   Needs_tests:  0  
   
Needs_better_patch:  0 |  
---+
Changes (by kmtracey):

  * stage:  Unreviewed => Accepted
  * milestone:  => 1.2

Comment:

 This was broken by r11965 (added support for readonly fields), which
 removed a big ugly block of code that had the effect of setting attr for
 non-field columns in change list. It appears that the actual sorting still
 works on trunk, just the column header is not set properly -- if you
 manually construct the url to specify sorting, the results come back
 properly sorted. But the column header line no longer contains the link
 with the appropriate query string to sort on that column. There is a test
 for sorting on a callable in admin_views, but it apparently just checks
 that things sort properly when a query string that specifies sorting is
 received, it does not verify that the column header contains the correct
 link to specify sorting.

-- 
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] #12455: admin_order_field for Admin list_display not working for callable

2009-12-28 Thread Django
#12455: admin_order_field for Admin list_display not working for callable
---+
  Reporter:  kegan | Owner:  nobody 
   
Status:  new   | Milestone: 
   
 Component:  django.contrib.admin  |   Version:  SVN
   
Resolution:|  Keywords:  list_display 
admin_order_field
 Stage:  Unreviewed| Has_patch:  0  
   
Needs_docs:  0 |   Needs_tests:  0  
   
Needs_better_patch:  0 |  
---+
Changes (by ramiro):

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

Comment:

 Replying to [ticket:12455 kegan]:
 > In the Admin, when using
 
[http://docs.djangoproject.com/en/1.1/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_display
 list_display], we should be able to make a sort callable

 What kind of callable is `submitted_date()`?. A a standalone function?
 ModelAdmin method? a model method?.

-- 
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] #11666: Fixed an incorrect Dutch translation

2009-12-28 Thread Django
#11666: Fixed an incorrect Dutch translation
---+
  Reporter:  joeri | Owner:  nobody  
Status:  new   | Milestone:  
 Component:  Translations  |   Version:  SVN 
Resolution:|  Keywords:  dutch nl translation
 Stage:  Accepted  | Has_patch:  1   
Needs_docs:  0 |   Needs_tests:  0   
Needs_better_patch:  0 |  
---+
Changes (by tinodb):

 * cc: tin...@gmail.com (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] #11666: Fixed an incorrect Dutch translation

2009-12-28 Thread Django
#11666: Fixed an incorrect Dutch translation
---+
  Reporter:  joeri | Owner:  nobody  
Status:  new   | Milestone:  
 Component:  Translations  |   Version:  SVN 
Resolution:|  Keywords:  dutch nl translation
 Stage:  Accepted  | Has_patch:  1   
Needs_docs:  0 |   Needs_tests:  0   
Needs_better_patch:  0 |  
---+
Comment (by tinodb):

 I opened a post about this on Django I18N and uploaded a new (clean)
 patch.
 Should be good to go unless somebody had objections agains the
 translation.

 see http://groups.google.com/group/django-
 i18n/browse_thread/thread/b7b8d50e31a38fdb

-- 
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] #12455: admin_order_field for Admin list_display not working for callable

2009-12-28 Thread Django
#12455: admin_order_field for Admin list_display not working for callable
+---
 Reporter:  kegan   |   Owner:  nobody
   Status:  new |   Milestone:
Component:  django.contrib.admin| Version:  SVN   
 Keywords:  list_display admin_order_field  |   Stage:  Unreviewed
Has_patch:  0   |  
+---
 In the Admin, when using
 
[http://docs.djangoproject.com/en/1.1/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_display
 list_display], we should be able to make a sort callable if it is
 associated with certain database field through the use of attribute
 ''admin_order_field''. Example:

 {{{
 def submitted_date(self, obj):
 return obj.created_at.strftime('%d %b %Y')
 submitted_date.short_description = 'Submitted Date'
 submitted_date.admin_order_field = 'created_at'
 }}}

 ''NOTE: created_at is a DB field in the model.''

 This is currently not working.

 Searching through the code, I believe the bug is located in
 
[http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/templatetags/admin_list.py?rev=11965#L75
 the following Django code]. The ''attr'' variable seems will always be
 ''None''.

-- 
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] r12010 - django/trunk/docs/ref

2009-12-28 Thread noreply
Author: lukeplant
Date: 2009-12-28 07:13:04 -0600 (Mon, 28 Dec 2009)
New Revision: 12010

Modified:
   django/trunk/docs/ref/settings.txt
Log:
Corrected bad example for DATABASES setting



Modified: django/trunk/docs/ref/settings.txt
===
--- django/trunk/docs/ref/settings.txt  2009-12-28 06:48:47 UTC (rev 12009)
+++ django/trunk/docs/ref/settings.txt  2009-12-28 13:13:04 UTC (rev 12010)
@@ -219,7 +219,7 @@
 
 DATABASES = {
 'default': {
-'BACKEND': 'django.db.backends.sqlite3',
+'ENGINE': 'django.db.backends.sqlite3',
 'NAME': 'mydatabase'
 }
 }

--

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] #12454: Admin calendar widgets don't work

2009-12-28 Thread Django
#12454: Admin calendar widgets don't work
---+
  Reporter:  jezdez| Owner:  jezdez
Status:  new   | Milestone:  1.2   
 Component:  Internationalization  |   Version:  1.1   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by Bernd Schlapsi ):

 * cc: b...@gmx.info (added)
  * needs_better_patch:  => 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-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.