Re: [Django] #12177: Error in part 4 of the tutorial?

2010-01-12 Thread Django
#12177: Error in part 4 of the tutorial?
+---
  Reporter:  simon_k| Owner:  nobody
Status:  closed | Milestone:
 Component:  Documentation  |   Version:  SVN   
Resolution:  duplicate  |  Keywords:
 Stage:  Unreviewed | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Comment (by datakid):

 I apologise for being a pedant - please ignore this last comment.

-- 
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] #12177: Error in part 4 of the tutorial?

2010-01-12 Thread Django
#12177: Error in part 4 of the tutorial?
+---
  Reporter:  simon_k| Owner:  nobody
Status:  closed | Milestone:
 Component:  Documentation  |   Version:  SVN   
Resolution:  duplicate  |  Keywords:
 Stage:  Unreviewed | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Comment (by datakid):

 fwiw, the tutorial _doesn't_ work. Feel free to test yourself. I have been
 advised by #django irc to move back to stable.

-- 
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] #12578: multipartparser.Parser does not accept non-canonical bare CR and bare LF

2010-01-12 Thread Django
#12578: multipartparser.Parser does not accept non-canonical bare CR and bare LF
+---
  Reporter:  jfenwick   | Owner:  nobody
Status:  closed | Milestone:
 Component:  HTTP handling  |   Version:  1.1   
Resolution:  invalid|  Keywords:  jython
 Stage:  Unreviewed | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Comment (by kmtracey):

 Ah, so it's not some client that is sending LF-only in the POST data,
 since I gather the clients in use here are standard browsers, which will
 be sending CRLFs. Interesting it only happens on Windows, where CRLF is
 the "normal" line ending. It sounds like some code that is passing along
 the post data is translating CRLFs to just LFs. Besides causing this
 problem that behavior has the potential for corrupting binary files
 uploaded to a Django server. All the code touching this data before
 feeding it to the Django code needs to be treating it as binary, not text,
 and not doing any type of line normalization.

-- 
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] #12578: multipartparser.Parser does not accept non-canonical bare CR and bare LF

2010-01-12 Thread Django
#12578: multipartparser.Parser does not accept non-canonical bare CR and bare LF
+---
  Reporter:  jfenwick   | Owner:  nobody
Status:  closed | Milestone:
 Component:  HTTP handling  |   Version:  1.1   
Resolution:  invalid|  Keywords:  jython
 Stage:  Unreviewed | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Comment (by leosoto):

 The problem occurs on deployments of Django 1.1 on Jython 2.5.1 with
 Tomcat as the application server on Windows systems.

 The full thread on the observed problem is on
 . It may be a Jython bug, though
 but we haven't be able to confirm it yet.

-- 
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] #12598: somefield__isnull=False produce wrong SQL

2010-01-12 Thread Django
#12598: somefield__isnull=False produce wrong SQL
--+-
  Reporter:  benc | Owner: 
Status:  closed   | Milestone: 
 Component:  ORM aggregation  |   Version:  1.1
Resolution:  duplicate|  Keywords: 
 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 #12567.

-- 
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] #12597: somefield__isnull=False produce wrong SQL

2010-01-12 Thread Django
#12597: somefield__isnull=False produce wrong SQL
--+-
  Reporter:  benc | Owner: 
Status:  closed   | Milestone: 
 Component:  ORM aggregation  |   Version:  1.1
Resolution:  duplicate|  Keywords: 
 Stage:  Unreviewed   | Has_patch:  0  
Needs_docs:  0|   Needs_tests:  0  
Needs_better_patch:  0|  
--+-
Changes (by russellm):

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

Comment:

 Duplicate of #12598

-- 
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] #12598: somefield__isnull=False produce wrong SQL

2010-01-12 Thread Django
#12598: somefield__isnull=False produce wrong SQL
-+--
 Reporter:  benc |   Owner:
   Status:  new  |   Milestone:
Component:  ORM aggregation  | Version:  1.1   
 Keywords:   |   Stage:  Unreviewed
Has_patch:  0|  
-+--
 Hi

 I have two models Model1 Model2, extending another model Model0(not
 abstract).
 I'm trying query Model0 and to filter only the models that have relation
 to Model1


 {{{
 objects = list(Model0.objects.filter(model2__isnull=False)
 }}}

 which result with a SQL

 {{{
 WHERE "myapp_model0"."id" IS NOT NULL
 }}}



 {{{
 objects = list(Model0.objects.filter(model2__isnull=True)
 }}}

 which result with a SQL

 {{{
 WHERE "myapp_model2"."model0_ptr_id" IS NULL'
 }}}


 The first SQL and the second is right.
 When using ~Q to negate the second I get what I want.

 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.




[Django] #12597: somefield__isnull=False produce wrong SQL

2010-01-12 Thread Django
#12597: somefield__isnull=False produce wrong SQL
-+--
 Reporter:  benc |   Owner:
   Status:  new  |   Milestone:
Component:  ORM aggregation  | Version:  1.1   
 Keywords:   |   Stage:  Unreviewed
Has_patch:  0|  
-+--
 Hi

 I have two models Model1 Model2, extending another model Model0(not
 abstract).
 I'm trying query Model0 and to filter only the models that have relation
 to Model1

 objects = list(Model0.objects.filter(model2__isnull=False)
 which result with a SQL
 WHERE "myapp_model0"."id" IS NOT NULL

 objects = list(Model0.objects.filter(model2__isnull=True)
 which result with a SQL
 WHERE "myapp_model2"."model0_ptr_id" IS NULL'

 The first SQL and the second is right.
 When using ~Q to negate the second I get what I want.

 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] #12596: Calling ModelForm.clean() is no longer optional

2010-01-12 Thread Django
#12596: Calling ModelForm.clean() is no longer optional
-+--
  Reporter:  carljm  | Owner:  carljm
Status:  assigned| Milestone:
 Component:  Forms   |   Version:  1.1   
Resolution:  |  Keywords:
 Stage:  Unreviewed  | Has_patch:  1 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Comment (by carljm):

 Oh, and I made Form.full_clean return a boolean signifying whether this
 form instance requires validation, in order to avoid duplicating the
 checks for is_bound, empty_permitted etc that cause it to bail out early.

-- 
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] #12596: Calling ModelForm.clean() is no longer optional

2010-01-12 Thread Django
#12596: Calling ModelForm.clean() is no longer optional
-+--
  Reporter:  carljm  | Owner:  carljm
Status:  assigned| Milestone:
 Component:  Forms   |   Version:  1.1   
Resolution:  |  Keywords:
 Stage:  Unreviewed  | Has_patch:  1 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Changes (by carljm):

  * has_patch:  0 => 1

Comment:

 Comments on the patch:

 - I removed the documentation about validate_unique happening in
 ModelForm.clean, as that is no longer the case.

 - Is it necessary to document the existence of ModelForm.clean_instance?

 - There's some extra rigmarole necessary at the beginning and end of
 ModelForm.clean_instance to re-add an empty self.cleaned_data if
 Form.full_clean removed it, and re-remove it if there are errors when
 done. These extra lines could be removed if we just move the last two
 lines of Form.full_clean (the removal of cleaned_data if there are errors)
 into Form._get_errors; but jkocherhans notes that might surprise people
 who overrode full_clean in order to modify or get rid of the cleaned_data
 removal.

-- 
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] #12339: ContentType update could cascade deletes to generic foreign keys, causing data loss

2010-01-12 Thread Django
#12339: ContentType update could cascade deletes to generic foreign keys, 
causing
data loss
---+
  Reporter:  kcarnold  | Owner:  nobody 
 
Status:  reopened  | Milestone:  1.2
 
 Component:  Contrib apps  |   Version:  1.1
 
Resolution:|  Keywords:  contenttype, delete, 
cascade
 Stage:  Accepted  | Has_patch:  1  
 
Needs_docs:  0 |   Needs_tests:  0  
 
Needs_better_patch:  0 |  
---+
Changes (by kcarnold):

  * has_patch:  0 => 1

Comment:

 I also prefer interactive; the attached patch is an (untested) shot.

 It would be nice to only ask for confirmation if the {{{.delete}}} will
 actually delete something. (Arguably it should ask for confirmation even
 if it's just a permission entry, because you might forget to transfer
 permissions to the new model. Agh, this really needs migration support to
 do correctly!) I looked briefly at the delete confirmation code in admin,
 but it looks too tightly woven into admin to use. Might make a feature
 request for a more reusable "what else will this delete?" query, if there
 isn't one already.

-- 
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] #12339: ContentType update could cascade deletes to generic foreign keys, causing data loss

2010-01-12 Thread Django
#12339: ContentType update could cascade deletes to generic foreign keys, 
causing
data loss
---+
  Reporter:  kcarnold  | Owner:  nobody 
 
Status:  reopened  | Milestone:  1.2
 
 Component:  Contrib apps  |   Version:  1.1
 
Resolution:|  Keywords:  contenttype, delete, 
cascade
 Stage:  Accepted  | Has_patch:  0  
 
Needs_docs:  0 |   Needs_tests:  0  
 
Needs_better_patch:  0 |  
---+
Changes (by russellm):

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

Comment:

 I can't say I'm a fan of either current patch. Leaving content types
 dangling like that doesn't strike me as a particularly friendly behavior,
 especially given how easy it is to end up with stale content types during
 initial development. I think a confirmation message is the way to go -
 Yes, we need to be careful in the wording of the confirmation prompt, but
 a broad "This is potentially destructive - If you're not sure, say 'NO'"
 should be enough to prevent accidental damage.
 So - I'd like see the contenttypes syncdb signal handler do the following:
   * Gather a list of stale content types
   * Print that list to the user
   * Ask the user to confirm that the content types should be deleted
   * on YES, delete the content types
   * on NO, print a helpful message on how to manually purge.

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

2010-01-12 Thread noreply
Author: jezdez
Date: 2010-01-12 17:37:07 -0600 (Tue, 12 Jan 2010)
New Revision: 1

Modified:
   django/trunk/docs/ref/models/instances.txt
Log:
Fixed #9326 - Use decorator syntax in get_absolute_url example. Thanks, timo.

Modified: django/trunk/docs/ref/models/instances.txt
===
--- django/trunk/docs/ref/models/instances.txt  2010-01-12 23:36:43 UTC (rev 
12221)
+++ django/trunk/docs/ref/models/instances.txt  2010-01-12 23:37:07 UTC (rev 
1)
@@ -508,9 +508,9 @@
 
 from django.db.models import permalink
 
+@models.permalink
 def get_absolute_url(self):
 return ('people_view', [str(self.id)])
-get_absolute_url = permalink(get_absolute_url)
 
 More details on named URL patterns are in the :ref:`URL dispatch documentation
 `.

-- 
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] r12221 - django/trunk/docs/topics/db

2010-01-12 Thread noreply
Author: jezdez
Date: 2010-01-12 17:36:43 -0600 (Tue, 12 Jan 2010)
New Revision: 12221

Modified:
   django/trunk/docs/topics/db/managers.txt
Log:
Fixed #11794 - Typo in model manager documentation. Thanks, timo.

Modified: django/trunk/docs/topics/db/managers.txt
===
--- django/trunk/docs/topics/db/managers.txt2010-01-12 23:36:19 UTC (rev 
12220)
+++ django/trunk/docs/topics/db/managers.txt2010-01-12 23:36:43 UTC (rev 
12221)
@@ -333,7 +333,7 @@
 As already suggested by the `django.contrib.gis` example, above, the
 ``use_for_related_fields`` feature is primarily for managers that need to
 return a custom ``QuerySet`` subclass. In providing this functionality in your
-manager, there are a couple of things to be remember.
+manager, there are a couple of things to remember.
 
 Do not filter away any results in this type of manager subclass
 ~~~

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

2010-01-12 Thread noreply
Author: jezdez
Date: 2010-01-12 17:36:19 -0600 (Tue, 12 Jan 2010)
New Revision: 12220

Modified:
   django/trunk/docs/ref/templates/builtins.txt
Log:
Fixed #12496 - Added code examples to built-in filter documentation. Thanks, 
Arthur Koziel.

Modified: django/trunk/docs/ref/templates/builtins.txt
===
--- django/trunk/docs/ref/templates/builtins.txt2010-01-12 23:35:54 UTC 
(rev 12219)
+++ django/trunk/docs/ref/templates/builtins.txt2010-01-12 23:36:19 UTC 
(rev 12220)
@@ -1017,6 +1017,12 @@
 
 Adds slashes before quotes. Useful for escaping strings in CSV, for example.
 
+For example::
+
+{{ value|addslashes }}
+
+If ``value`` is ``"I'm using Django"``, the output will be ``"I\'m using 
Django"``.
+
 .. templatefilter:: capfirst
 
 capfirst
@@ -1024,6 +1030,12 @@
 
 Capitalizes the first character of the value.
 
+For example::
+
+{{ value|capfirst }}
+
+If ``value`` is ``"django"``, the output will be ``"Django"``.
+
 .. templatefilter:: center
 
 center
@@ -1031,6 +1043,12 @@
 
 Centers the value in a field of a given width.
 
+For example::
+
+"{{ value|center:"15" }}"
+
+If ``value`` is ``"Django"``, the output will be ``" Django"``.
+
 .. templatefilter:: cut
 
 cut
@@ -1194,6 +1212,13 @@
 string safe for use in HTML, but does protect you from syntax errors when using
 templates to generate JavaScript/JSON.
 
+For example::
+
+{{ value|escapejs }}
+
+If ``value`` is ``"testing\r\njavascript \'string" escaping"``,
+the output will be ``"testing\\x0D\\x0Ajavascript \\x27string\\x22 
\\x3Cb\\x3Eescaping\\x3C/b\\x3E"``.
+
 .. templatefilter:: filesizeformat
 
 filesizeformat
@@ -1320,6 +1345,12 @@
 It's safe to use this filter on a string that has already gone through the
 ``urlencode`` filter.
 
+For example::
+
+{{ value|iriencode }}
+
+If ``value`` is ``"?test=1&me=2"``, the output will be ``"?test=1&me=2"``.
+
 .. templatefilter:: join
 
 join
@@ -1400,6 +1431,13 @@
 Converts all newlines in a piece of plain text to HTML line breaks
 ().
 
+For example::
+
+{{ value|linebreaksbr }}
+
+If ``value`` is ``Joel\nis a slug``, the output will be ``Joelis a
+slug``.
+
 .. templatefilter:: linenumbers
 
 linenumbers
@@ -1407,6 +1445,22 @@
 
 Displays text with line numbers.
 
+For example::
+
+{{ value|linenumbers }}
+
+If ``value`` is::
+
+one
+two
+three
+
+the output will be::
+
+1. one
+2. two
+3. three
+
 .. templatefilter:: ljust
 
 ljust
@@ -1416,6 +1470,12 @@
 
 **Argument:** field size
 
+For example::
+
+"{{ value|ljust:"10" }}"
+
+If ``value`` is ``Django``, the output will be ``"Django"``.
+
 .. templatefilter:: lower
 
 lower
@@ -1451,12 +1511,17 @@
 ~
 
 Converts a phone number (possibly containing letters) to its numerical
-equivalent. For example, ``'800-COLLECT'`` will be converted to
-``'800-2655328'``.
+equivalent.
 
 The input doesn't have to be a valid phone number. This will happily convert
 any string.
 
+For example::
+
+{{ value|phone2numeric }}
+
+If ``value`` is ``800-COLLECT``, the output will be ``800-2655328``.
+
 .. templatefilter:: pluralize
 
 pluralize
@@ -1468,6 +1533,9 @@
 
 You have {{ num_messages }} message{{ num_messages|pluralize }}.
 
+If ``num_messages`` is ``1``, the output will be ``You have 1 message.``
+If ``num_messages`` is ``2``  the output will be ``You have 2 messages.``
+
 For words that require a suffix other than ``'s'``, you can provide an 
alternate
 suffix as a parameter to the filter.
 
@@ -1527,6 +1595,12 @@
 
 **Argument:** field size
 
+For example::
+
+"{{ value|rjust:"10" }}"
+
+If ``value`` is ``Django``, the output will be ``"Django"``.
+
 .. templatefilter:: safe
 
 safe
@@ -1565,6 +1639,8 @@
 
 {{ some_list|slice:":2" }}
 
+If ``some_list`` is ``['a', 'b', 'c']``, the output will be ``['a', 'b']``.
+
 .. templatefilter:: slugify
 
 slugify
@@ -1684,6 +1760,12 @@
 
 Converts a string into titlecase.
 
+For example::
+
+{{ value|title }}
+
+If ``value`` is ``"my first post"``, the output will be ``"My First Post"``.
+
 .. templatefilter:: truncatewords
 
 truncatewords
@@ -1711,6 +1793,13 @@
 This is less efficient than ``truncatewords``, so should only be used when it
 is being passed HTML text.
 
+For example::
+
+{{ value|truncatewords_html:2 }}
+
+If ``value`` is ``"Joel is a slug"``, the output will be
+``"Joel is ..."``.
+
 .. templatefilter:: unordered_list
 
 unordered_list
@@ -1761,6 +1850,13 @@
 
 Escapes a value for use in a URL.
 
+For example::
+
+{{ value|urlencode }}
+
+If ``value`` is ``"http://www.example.org/foo?a=b&c=d"``, the output will be
+``"http%3A//www.example.org/foo%3Fa%3Db%26c%3Dd"``.
+
 .. templatefilter:: urlize
 
 urlize
@@ -1806,6 +1902,12 @@
 
 Returns the number of words.
 
+For example::
+
+{{ value|wordcount }}
+
+If ``value`` is ``"Joel is a slug"``, the output will be ``4``.
+
 .. templatefilter:: wordwrap
 
 w

[Changeset] r12219 - django/trunk/django/contrib/auth

2010-01-12 Thread noreply
Author: jezdez
Date: 2010-01-12 17:35:54 -0600 (Tue, 12 Jan 2010)
New Revision: 12219

Modified:
   django/trunk/django/contrib/auth/models.py
Log:
Fixed #11796 - Tweaked ordering of permissions a little more to be even nicer.

Modified: django/trunk/django/contrib/auth/models.py
===
--- django/trunk/django/contrib/auth/models.py  2010-01-12 23:35:29 UTC (rev 
12218)
+++ django/trunk/django/contrib/auth/models.py  2010-01-12 23:35:54 UTC (rev 
12219)
@@ -72,7 +72,7 @@
 verbose_name = _('permission')
 verbose_name_plural = _('permissions')
 unique_together = (('content_type', 'codename'),)
-ordering = ('content_type__app_label', 'codename')
+ordering = ('content_type__app_label', 'content_type__model', 
'codename')
 
 def __unicode__(self):
 return u"%s | %s | %s" % (

-- 
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] r12218 - in django/trunk: django/contrib/admin/templates/admin/auth/user django/contrib/admin/templates/registration django/contrib/auth tests/regressiontests/admin_views

2010-01-12 Thread noreply
Author: jezdez
Date: 2010-01-12 17:35:29 -0600 (Tue, 12 Jan 2010)
New Revision: 12218

Modified:
   django/trunk/django/contrib/admin/templates/admin/auth/user/add_form.html
   
django/trunk/django/contrib/admin/templates/registration/password_change_form.html
   django/trunk/django/contrib/auth/admin.py
   django/trunk/django/contrib/auth/forms.py
   django/trunk/tests/regressiontests/admin_views/tests.py
Log:
Make use of new ability to override admin add form templates and removed a 
litle bit of redundancy in the templates.

Modified: 
django/trunk/django/contrib/admin/templates/admin/auth/user/add_form.html
===
--- django/trunk/django/contrib/admin/templates/admin/auth/user/add_form.html   
2010-01-12 23:34:46 UTC (rev 12217)
+++ django/trunk/django/contrib/admin/templates/admin/auth/user/add_form.html   
2010-01-12 23:35:29 UTC (rev 12218)
@@ -1,33 +1,11 @@
 {% extends "admin/change_form.html" %}
 {% load i18n %}
 
-{% block after_field_sets %}
+{% block form_top %}
+{% trans "First, enter a username and password. Then, you'll be able to 
edit more user options." %}
+
+{% endblock %}
 
-{% trans "First, enter a username and password. Then, you'll be able to 
edit more user options." %}
-
-
-
-
-  {{ form.username.errors }}
-  {# TODO: get required class on label_tag #}
-  {% trans 'Username' %}: {{ 
form.username }}
-  {{ form.username.help_text }}
-
-
-
-  {{ form.password1.errors }}
-  {# TODO: get required class on label_tag #}
-  {% trans 'Password' %}: 
{{ form.password1 }}
-
-
-
-  {{ form.password2.errors }}
-  {# TODO: get required class on label_tag #}
-  {% trans 'Password (again)' 
%}: {{ form.password2 }}
-  {% trans 'Enter the same password as above, for 
verification.' %}
-
-
+{% block after_field_sets %}
 document.getElementById("id_username").focus();
-
-
 {% endblock %}

Modified: 
django/trunk/django/contrib/admin/templates/registration/password_change_form.html
===
--- 
django/trunk/django/contrib/admin/templates/registration/password_change_form.html
  2010-01-12 23:34:46 UTC (rev 12217)
+++ 
django/trunk/django/contrib/admin/templates/registration/password_change_form.html
  2010-01-12 23:35:29 UTC (rev 12218)
@@ -1,26 +1,50 @@
 {% extends "admin/base_site.html" %}
-{% load i18n %}
+{% load i18n adminmedia %}
+{% block extrastyle %}{{ block.super }}{% endblock %}
 {% block userlinks %}{% url django-admindocs-docroot as docsroot %}{% if 
docsroot %}{% trans 'Documentation' %} / {% endif 
%} {% trans 'Change password' %} / {% trans 'Log out' 
%}{% endblock %}
 {% block breadcrumbs %}{% trans 'Home' 
%} › {% trans 'Password change' %}{% endblock %}
 
 {% block title %}{% trans 'Password change' %}{% endblock %}
 
-{% block content %}
+{% block content %}
 
+{% csrf_token %}
+
+{% if form.errors %}
+
+{% blocktrans count form.errors.items|length as counter %}Please correct 
the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
+
+{% endif %}
+
 {% trans 'Password change' %}
 
 {% trans "Please enter your old password, for security's sake, and then 
enter your new password twice so we can verify you typed it in correctly." 
%}
 
-{% csrf_token %}
+
 
-{{ form.old_password.errors }}
-{% trans 'Old password:' 
%}{{ form.old_password }}
-{{ form.new_password1.errors }}
-{% trans 'New password:' 
%}{{ form.new_password1 }}
+
+{{ form.old_password.errors }}
+{% trans 'Old password' 
%}:{{ form.old_password }}
+
+
+
+{{ form.new_password1.errors }}
+{% trans 'New password' 
%}:{{ form.new_password1 }}
+
+
+
 {{ form.new_password2.errors }}
-{% trans 'Confirm 
password:' %}{{ form.new_password2 }}
+{% trans 'Password (again)' 
%}:{{ form.new_password2 }}
+
 
-
-
+
 
+
+
+
+
+document.getElementById("id_old_password").focus();
+
+
+
 {% endblock %}

Modified: django/trunk/django/contrib/auth/admin.py
===
--- django/trunk/django/contrib/auth/admin.py   2010-01-12 23:34:46 UTC (rev 
12217)
+++ django/trunk/django/contrib/auth/admin.py   2010-01-12 23:35:29 UTC (rev 
12218)
@@ -1,4 +1,5 @@
 from django import template
+from django.db import transaction
 from django.conf import settings
 from django.contrib import admin
 from django.contrib.auth.forms import UserCreationForm, UserChangeForm, 
AdminPasswordChangeForm
@@ -10,6 +11,7 @@
 from django.template import RequestContext
 from django.utils.html import escape
 from django.utils.translation import ugettext, ugettext_lazy as _
+from django.views.decorators.csrf import csrf_protect
 
 class GroupAdmin(admin.ModelAdmin):
 search_fields = ('name',)
@@ -17,6 +19,8 @@
 filter_horizontal = ('permissions',)
 
 class UserAdmin(admin.ModelAdmin):
+add_form_template = 'admin/auth/user/add_form.html'
+change_user_password_template = None
 fieldsets = (
 (None, {'fields':

[Changeset] r12217 - in django/trunk: django/contrib/admin docs/ref/contrib/admin tests/regressiontests/admin_views tests/templates/custom_admin

2010-01-12 Thread noreply
Author: jezdez
Date: 2010-01-12 17:34:46 -0600 (Tue, 12 Jan 2010)
New Revision: 12217

Added:
   django/trunk/tests/templates/custom_admin/logout.html
   django/trunk/tests/templates/custom_admin/password_change_done.html
   django/trunk/tests/templates/custom_admin/password_change_form.html
Modified:
   django/trunk/django/contrib/admin/sites.py
   django/trunk/docs/ref/contrib/admin/index.txt
   django/trunk/tests/regressiontests/admin_views/customadmin.py
   django/trunk/tests/regressiontests/admin_views/tests.py
Log:
Fixed #8933 - Allow more admin templates to be overridden.

Modified: django/trunk/django/contrib/admin/sites.py
===
--- django/trunk/django/contrib/admin/sites.py  2010-01-12 23:34:03 UTC (rev 
12216)
+++ django/trunk/django/contrib/admin/sites.py  2010-01-12 23:34:46 UTC (rev 
12217)
@@ -37,8 +37,11 @@
 """
 
 index_template = None
+app_index_template = None
 login_template = None
-app_index_template = None
+logout_template = None
+password_change_template = None
+password_change_done_template = None
 
 def __init__(self, name=None, app_name='admin'):
 self._registry = {} # model_class class -> admin_class instance
@@ -248,14 +251,22 @@
 url = '%spassword_change/done/' % self.root_path
 else:
 url = reverse('admin:password_change_done', current_app=self.name)
-return password_change(request, post_change_redirect=url)
+defaults = {
+'post_change_redirect': url
+}
+if self.password_change_template is not None:
+defaults['template_name'] = self.password_change_template
+return password_change(request, **defaults)
 
 def password_change_done(self, request):
 """
 Displays the "success" page after a password change.
 """
 from django.contrib.auth.views import password_change_done
-return password_change_done(request)
+defaults = {}
+if self.password_change_done_template is not None:
+defaults['template_name'] = self.password_change_done_template
+return password_change_done(request, **defaults)
 
 def i18n_javascript(self, request):
 """
@@ -277,7 +288,10 @@
 This should *not* assume the user is already logged in.
 """
 from django.contrib.auth.views import logout
-return logout(request)
+defaults = {}
+if self.logout_template is not None:
+defaults['template_name'] = self.logout_template
+return logout(request, **defaults)
 logout = never_cache(logout)
 
 def login(self, request):

Modified: django/trunk/docs/ref/contrib/admin/index.txt
===
--- django/trunk/docs/ref/contrib/admin/index.txt   2010-01-12 23:34:03 UTC 
(rev 12216)
+++ django/trunk/docs/ref/contrib/admin/index.txt   2010-01-12 23:34:46 UTC 
(rev 12217)
@@ -1343,9 +1343,10 @@
 Root and login templates
 
 
-If you wish to change the index or login templates, you are better off creating
-your own ``AdminSite`` instance (see below), and changing the 
:attr:`AdminSite.index_template`
-or :attr:`AdminSite.login_template` properties.
+If you wish to change the index, login or logout templates, you are better off
+creating your own ``AdminSite`` instance (see below), and changing the
+:attr:`AdminSite.index_template` , :attr:`AdminSite.login_template` or
+:attr:`AdminSite.logout_template` properties.
 
 ``AdminSite`` objects
 =
@@ -1375,18 +1376,31 @@
 ``AdminSite`` attributes
 
 
+Templates can override or extend base admin templates as described in
+`Overriding Admin Templates`_.
+
 .. attribute:: AdminSite.index_template
 
 Path to a custom template that will be used by the admin site main index view.
-Templates can override or extend base admin templates as described in
-`Overriding Admin Templates`_.
 
 .. attribute:: AdminSite.login_template
 
 Path to a custom template that will be used by the admin site login view.
-Templates can override or extend base admin templates as described in
-`Overriding Admin Templates`_.
 
+.. attribute:: AdminSite.logout_template
+
+Path to a custom template that will be used by the admin site logout view.
+
+.. attribute:: AdminSite.password_change_template
+
+Path to a custom template that will be used by the admin site password change
+view.
+
+.. attribute:: AdminSite.password_change_done_template
+
+Path to a custom template that will be used by the admin site password change
+done view.
+
 Hooking ``AdminSite`` instances into your URLconf
 -
 

Modified: django/trunk/tests/regressiontests/admin_views/customadmin.py
===
--- django/trunk/tests/regressiontests/admin_views/customadmin.

[Changeset] r12216 - in django/trunk: django/contrib/admin docs/ref/contrib/admin tests/regressiontests/admin_views tests/templates/custom_admin

2010-01-12 Thread noreply
Author: jezdez
Date: 2010-01-12 17:34:03 -0600 (Tue, 12 Jan 2010)
New Revision: 12216

Added:
   django/trunk/tests/templates/custom_admin/add_form.html
Modified:
   django/trunk/django/contrib/admin/options.py
   django/trunk/docs/ref/contrib/admin/index.txt
   django/trunk/tests/regressiontests/admin_views/models.py
   django/trunk/tests/regressiontests/admin_views/tests.py
Log:
Fixed #10640 - Adds a add_form_template option to ModelAdmin. Thanks jcsackett.

Modified: django/trunk/django/contrib/admin/options.py
===
--- django/trunk/django/contrib/admin/options.py2010-01-12 22:03:00 UTC 
(rev 12215)
+++ django/trunk/django/contrib/admin/options.py2010-01-12 23:34:03 UTC 
(rev 12216)
@@ -200,6 +200,7 @@
 inlines = []
 
 # Custom templates (designed to be over-ridden in subclasses)
+add_form_template = None
 change_form_template = None
 change_list_template = None
 delete_confirmation_template = None
@@ -618,8 +619,12 @@
 'save_on_top': self.save_on_top,
 'root_path': self.admin_site.root_path,
 })
+if add and self.add_form_template is not None:
+form_template = self.add_form_template
+else:
+form_template = self.change_form_template
 context_instance = template.RequestContext(request, 
current_app=self.admin_site.name)
-return render_to_response(self.change_form_template or [
+return render_to_response(form_template or [
 "admin/%s/%s/change_form.html" % (app_label, 
opts.object_name.lower()),
 "admin/%s/change_form.html" % app_label,
 "admin/change_form.html"

Modified: django/trunk/docs/ref/contrib/admin/index.txt
===
--- django/trunk/docs/ref/contrib/admin/index.txt   2010-01-12 22:03:00 UTC 
(rev 12215)
+++ django/trunk/docs/ref/contrib/admin/index.txt   2010-01-12 23:34:03 UTC 
(rev 12216)
@@ -712,11 +712,20 @@
 If you don't specify this attribute, a default template shipped with Django
 that provides the standard appearance is used.
 
+.. attribute:: ModelAdmin.add_form_template
+
+Path to a custom template that will be used by the model object creation
+views. Templates can override or extend base admin templates as described in
+`Overriding Admin Templates`_.
+
+If you don't specify this attribute, a default template shipped with Django
+that provides the standard appearance is used.
+
 .. attribute:: ModelAdmin.change_form_template
 
-Path to a custom template that will be used by both the model object creation
-and change views. Templates can override or extend base admin templates as
-described in `Overriding Admin Templates`_.
+Path to a custom template that will be used by the model object change views.
+Templates can override or extend base admin templates as described in
+`Overriding Admin Templates`_.
 
 If you don't specify this attribute, a default template shipped with Django
 that provides the standard appearance is used.

Modified: django/trunk/tests/regressiontests/admin_views/models.py
===
--- django/trunk/tests/regressiontests/admin_views/models.py2010-01-12 
22:03:00 UTC (rev 12215)
+++ django/trunk/tests/regressiontests/admin_views/models.py2010-01-12 
23:34:03 UTC (rev 12216)
@@ -110,6 +110,7 @@
 """
 change_list_template = 'custom_admin/change_list.html'
 change_form_template = 'custom_admin/change_form.html'
+add_form_template = 'custom_admin/add_form.html'
 object_history_template = 'custom_admin/object_history.html'
 delete_confirmation_template = 'custom_admin/delete_confirmation.html'
 

Modified: django/trunk/tests/regressiontests/admin_views/tests.py
===
--- django/trunk/tests/regressiontests/admin_views/tests.py 2010-01-12 
22:03:00 UTC (rev 12215)
+++ django/trunk/tests/regressiontests/admin_views/tests.py 2010-01-12 
23:34:03 UTC (rev 12216)
@@ -550,11 +550,11 @@
 self.assert_("var hello = 'Hello!';" in request.content)
 self.assertTemplateUsed(request, 'custom_admin/change_list.html')
 
-# Test custom change form template
+# Test custom add form template
 request = 
self.client.get('/test_admin/admin/admin_views/customarticle/add/')
-self.assertTemplateUsed(request, 'custom_admin/change_form.html')
+self.assertTemplateUsed(request, 'custom_admin/add_form.html')
 
-# Add an article so we can test delete and history views
+# Add an article so we can test delete, change, and history views
 post = 
self.client.post('/test_admin/admin/admin_views/customarticle/add/', {
 'content': 'great article',
 'date_0': '2008-03-18',
@@ -563,7 +563,10 @@
 self.assertRedirects(post, 
'/test_admin/admin/admin

Re: [Django] #7777: DecimalField validation ignores infinity and nan

2010-01-12 Thread Django
#: DecimalField validation ignores infinity and nan
-+--
  Reporter:  thebitguru  | Owner:  thebitguru
Status:  assigned| Milestone:  1.2   
 Component:  Core framework  |   Version:  SVN   
Resolution:  |  Keywords:
 Stage:  Design decision needed  | Has_patch:  1 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Changes (by russellm):

  * version:  1.2-alpha => SVN
  * milestone:  => 1.2

-- 
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] #6434: auto_now and auto_now_add documentation

2010-01-12 Thread Django
#6434: auto_now and auto_now_add documentation
+---
  Reporter:  jok...@radgjafahus.is  | Owner:  nobody
 
Status:  new| Milestone:
 
 Component:  Documentation  |   Version:  SVN   
 
Resolution: |  Keywords:  datefield 
auto_now auto_now_add
 Stage:  Accepted   | Has_patch:  1 
 
Needs_docs:  0  |   Needs_tests:  0 
 
Needs_better_patch:  1  |  
+---
Changes (by CollinAnderson):

  * summary:  auto_now and auto_now_add should me marked for soon-to-be-
  deprecated => auto_now and auto_now_add
  documentation

Comment:

 I believe that the current attitude towards auto_now and auto_now_add is
 that they become editable=False automatically. This needs to be
 documented, and should probably explain the common pitfalls and recommend
 an alternative method.

 Current documentation:
 http://docs.djangoproject.com/en/dev/ref/models/fields/#datefield

-- 
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] #11796: Change Permission ordering to sort by application, model, then permission

2010-01-12 Thread Django
#11796: Change Permission ordering to sort by application, model, then 
permission
-+--
  Reporter:  russryba| Owner:  jezdez 
Status:  assigned| Milestone: 
 Component:  Authentication  |   Version:  SVN
Resolution:  |  Keywords:  Permission ordering
 Stage:  Accepted| Has_patch:  1  
Needs_docs:  0   |   Needs_tests:  0  
Needs_better_patch:  0   |  
-+--
Changes (by jezdez):

  * owner:  nobody => jezdez
  * status:  new => assigned
  * version:  1.0 => SVN
  * stage:  Unreviewed => Accepted

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-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] #12596: Calling ModelForm.clean() is no longer optional

2010-01-12 Thread Django
#12596: Calling ModelForm.clean() is no longer optional
-+--
  Reporter:  carljm  | Owner:  carljm
Status:  assigned| Milestone:
 Component:  Forms   |   Version:  1.1   
Resolution:  |  Keywords:
 Stage:  Unreviewed  | Has_patch:  0 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Changes (by carljm):

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

Comment:

 Whoops, forgot to use preview. Accepting, as this was already discussed
 with core committers in IRC.

-- 
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] #12596: Calling ModelForm.clean() is no longer optional

2010-01-12 Thread Django
#12596: Calling ModelForm.clean() is no longer optional
+---
 Reporter:  carljm  |   Owner:  carljm
   Status:  new |   Milestone:
Component:  Forms   | Version:  1.1   
 Keywords:  |   Stage:  Unreviewed
Has_patch:  0   |  
+---
 It's [[documented
 http://docs.djangoproject.com/en/1.1/topics/forms/modelforms/#overriding-
 the-clean-method]] that if you override clean() on a ModelForm and fail to
 call ModelForm's clean() method, all you lose is validate_unique. With the
 recent model validation changes, this is no longer true; ModelForm.clean
 does quite a bit more (including constructing self.instance), and failing
 to call it will almost certainly break things.

 Per discussion with jkocherhans in IRC, it should be possible to rearrange
 things to maintain the previously documented behavior.

-- 
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] r12215 - django/trunk/django/contrib/messages/tests

2010-01-12 Thread noreply
Author: lukeplant
Date: 2010-01-12 16:03:00 -0600 (Tue, 12 Jan 2010)
New Revision: 12215

Modified:
   django/trunk/django/contrib/messages/tests/base.py
Log:
Fixed #12588 - test failure since r12207



Modified: django/trunk/django/contrib/messages/tests/base.py
===
--- django/trunk/django/contrib/messages/tests/base.py  2010-01-12 18:40:54 UTC 
(rev 12214)
+++ django/trunk/django/contrib/messages/tests/base.py  2010-01-12 22:03:00 UTC 
(rev 12215)
@@ -58,6 +58,7 @@
 settings.TEMPLATE_CONTEXT_PROCESSORS = \
self._template_context_processors
 settings.INSTALLED_APPS = self._installed_apps
+settings.MESSAGE_STORAGE = self._message_storage
 
 def restore_setting(self, setting):
 if setting in self._remembered_settings:

-- 
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] #12416: Improve KML Serialization

2010-01-12 Thread Django
#12416: Improve KML Serialization
-+--
  Reporter:  jbronn  | Owner:  jbronn  
Status:  new | Milestone:  1.2 
 Component:  GIS |   Version:  SVN 
Resolution:  |  Keywords:  gis kml 3d style rhr
 Stage:  Unreviewed  | Has_patch:  0   
Needs_docs:  0   |   Needs_tests:  0   
Needs_better_patch:  0   |  
-+--
Changes (by tylere):

 * cc: tylere (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] #12595: Localflavor bad arguments handling

2010-01-12 Thread Django
#12595: Localflavor bad arguments handling
-+--
  Reporter:  sayane  | Owner:  nobody
Status:  new | Milestone:  1.2   
 Component:  django.contrib.localflavor  |   Version:  SVN   
Resolution:  |  Keywords:
 Stage:  Accepted| Has_patch:  1 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Changes (by jezdez):

  * stage:  Unreviewed => Accepted

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-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] #12581: connection.queries should use a ring buffer to avoid large memory consumption under runserver

2010-01-12 Thread Django
#12581: connection.queries should use a ring buffer to avoid large memory
consumption under runserver
---+
  Reporter:  robhudson | Owner:  nobody
Status:  new   | Milestone:
 Component:  Database layer (models, ORM)  |   Version:  1.1   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by robhudson):

 FYI: Original patch by Alex Gaynor, tests and ticket added by Rob Hudson.

-- 
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] #12595: Localflavor bad arguments handling

2010-01-12 Thread Django
#12595: Localflavor bad arguments handling
-+--
  Reporter:  sayane  | Owner:  nobody
Status:  new | Milestone:  1.2   
 Component:  django.contrib.localflavor  |   Version:  SVN   
Resolution:  |  Keywords:
 Stage:  Unreviewed  | Has_patch:  1 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Changes (by sayane):

 * cc: say...@gmail.com (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.




[Django] #12595: Localflavor bad arguments handling

2010-01-12 Thread Django
#12595: Localflavor bad arguments handling
+---
 Reporter:  sayane  |   Owner:  nobody
   Status:  new |   Milestone:  1.2   
Component:  django.contrib.localflavor  | Version:  SVN   
 Keywords:  |   Stage:  Unreviewed
Has_patch:  1   |  
+---
 A lot of form fields in django.contrib.localflavor handles arguments to
 {{{__init__()}}} in a bad way.

 {{{
 def __init__(self, *args, **kwargs):
 super(PLPESELField, self).__init__(r'^\d{11}$',
 max_length=None, min_length=None, *args, **kwargs)
 }}}

 Every line like first one should be fixed like this:

 {{{
 def __init__(self, max_length=None, min_length=None, *args, **kwargs):
 }}}

 Because if someone will pass {{{max_length}}} or {{{min_length}}} argument
 to {{{__init__()}}} it will fail (multiple
 {{{min_length}}}/{{{max_length}}} arguments - additional one will be in
 {{{kwargs}}}).

 It is a big problem, if i'm trying to do something like this:

 {{{
 class PostalCodeField(models.CharField):
 def formfield(self, **kwargs):
 kwargs.setdefault("form_class", PLPostalCodeField)
 return super(self.__class__, self).formfield(**kwargs)
 }}}
 because {{{django.db.models.CharField}}} sets {{{max_length}}} to
 {{{self.max_length}}}.

 I'm attaching patch to fix polish localflavor.

-- 
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] #12592: i18nguy language code for brazilian portuguese is wrong

2010-01-12 Thread Django
#12592: i18nguy language code for brazilian portuguese is wrong
+---
  Reporter:  italomaia  | Owner:  nobody
Status:  new| Milestone:  1.2   
 Component:  Uncategorized  |   Version:  SVN   
Resolution: |  Keywords:
 Stage:  Accepted   | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by jezdez):

  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * version:  1.1 => SVN
  * milestone:  => 1.2
  * needs_docs:  => 0
  * stage:  Unreviewed => Accepted

Comment:

 To clarify, this is about the global_settings.py having a comment linking
 to http://www.i18nguy.com/unicode/language-identifiers.html.

-- 
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] #6191: Admin delete view doesn't show all items in some circumstances

2010-01-12 Thread Django
#6191: Admin delete view doesn't show all items in some circumstances
---+
  Reporter:  nicklane  | Owner:  carljm 
Status:  new   | Milestone: 
 Component:  django.contrib.admin  |   Version:  SVN
Resolution:|  Keywords:  nfa-someday
 Stage:  Accepted  | Has_patch:  1  
Needs_docs:  0 |   Needs_tests:  0  
Needs_better_patch:  1 |  
---+
Comment (by carljm):

 Discovered two more differences between this patch and current behavior.

 1. Currently the list of "related objects to be deleted" includes entries
 for "one or more foo in bar: my_bar", where foo is a M2M field on the bar
 model pointing to the object about to be deleted. With the patch, m2m
 intermediary relationship objects are only listed if you have an explicit
 "through" model, in which case each "through" object is listed separately.
 IMO, an m2m without an explicit through model is conceptually just a
 relationship; the fact that an entry in a table will be deleted is just a
 relationship implementation detail that doesn't require notification. If
 the previous behavior is preferred, however, I am willing to add it to the
 patch.

 2. In general, this patch only ever lists a given object once, even if
 there are multiple relationship paths to it. Current behavior can
 potentially list the same object many times if there are several paths 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] #12594: Meaningless exception when DEBUG=False and resolver.urlconf_module is None.

2010-01-12 Thread Django
#12594: Meaningless exception when DEBUG=False and resolver.urlconf_module is 
None.
+---
  Reporter:  buriy  | Owner:  nobody   
Status:  new| Milestone:  1.2  
 Component:  HTTP handling  |   Version:  1.2-alpha
Resolution: |  Keywords:   
 Stage:  Unreviewed | Has_patch:  1
Needs_docs:  0  |   Needs_tests:  0
Needs_better_patch:  0  |  
+---
Changes (by buriy):

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

Comment:

 Exception Before:
 {{{
 Traceback (most recent call last):

   File "/Projects/django/wn2/django/core/servers/basehttp.py", line 280,
 in run
 self.result = application(self.environ, self.start_response)

   File "/Projects/django/wn2/django/core/servers/basehttp.py", line 672,
 in __call__
 return self.application(environ, start_response)

   File "/Projects/django/wn2/django/core/handlers/wsgi.py", line 241, in
 __call__
 response = self.get_response(request)

   File "/Projects/django/wn2/django/core/handlers/base.py", line 143, in
 get_response
 return self.handle_uncaught_exception(request, resolver, exc_info)

   File "/Projects/django/wn2/django/core/handlers/base.py", line 180, in
 handle_uncaught_exception
 callback, param_dict = resolver.resolve500()

   File "/Projects/django/wn2/django/core/urlresolvers.py", line 269, in
 resolve500
 return self._resolve_special('500')

   File "/Projects/django/wn2/django/core/urlresolvers.py", line 259, in
 _resolve_special
 callback = getattr(self.urlconf_module, 'handler%s' % view_type)

 AttributeError: 'NoneType' object has no attribute 'handler500'
 }}}

 Exception after:
 {{{
 Traceback (most recent call last):

   File "/Projects/django/wn2/django/core/servers/basehttp.py", line 280,
 in run
 self.result = application(self.environ, self.start_response)

   File "/Projects/django/wn2/django/core/servers/basehttp.py", line 672,
 in __call__
 return self.application(environ, start_response)

   File "/Projects/django/wn2/django/core/handlers/wsgi.py", line 241, in
 __call__
 response = self.get_response(request)

   File "/Projects/django/wn2/django/core/handlers/base.py", line 143, in
 get_response
 return self.handle_uncaught_exception(request, resolver, exc_info)

   File "/Projects/django/wn2/django/core/handlers/base.py", line 85, in
 get_response
 urlconf = getattr(request, "urlconf", settings.ROOT_URLCONF)

   File "/Projects/django/wn2/django/utils/functional.py", line 273, in
 __getattr__
 return getattr(self._wrapped, name)

 AttributeError: 'Settings' object has no attribute 'ROOT_URLCONF'
 }}}

-- 
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] #12594: Meaningless exception when DEBUG=False and resolver.urlconf_module is None.

2010-01-12 Thread Django
#12594: Meaningless exception when DEBUG=False and resolver.urlconf_module is 
None.
---+
 Reporter:  buriy  |   Owner:  nobody
   Status:  new|   Milestone:  1.2   
Component:  HTTP handling  | Version:  1.2-alpha 
 Keywords: |   Stage:  Unreviewed
Has_patch:  1  |  
---+
 Because of resolver.resolve500() can now fail due to urlconf_module set to
 None in django/core/handlers/base.py,
 sometimes site developer doesn't get appropriate error message.
 Instead developer gets message that handler500 is not found in urlconf
 module.

 Problem is only in handler500 lookup, everything else goes well.

 How to reproduce:
 set DEBUG to False, comment out ROOT_URLCONF line.

 I managed to find this problem it another way, but it will take some time
 to figure out how settings.py can be imported without errors, but get
 empty dir to LazySettings.

 My suggested fix:
 {{{
 #!python
 def handle_uncaught_exception(self, request, resolver, exc_info):
 ...
 mail_admins(subject, message, fail_silently=True)
 # Return an HttpResponse that displays a friendly error message.

 if resolver.urlconf_module is None: # FIX LINE1: you aren't
 getting http500!
 raise exc_info[1], None, exc_info[2] # FIX LINE2: so we'll
 raise it raw.

 callback, param_dict = resolver.resolve500()
 return callback(request, **param_dict)

 }}}

-- 
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] #12589: upload_to argument on FileField It is not completely clear in the documentation

2010-01-12 Thread Django
#12589: upload_to argument on FileField It is not completely clear in the
documentation
+---
  Reporter:  finngruwier| Owner:  nobody
Status:  closed | Milestone:
 Component:  Documentation  |   Version:  1.1   
Resolution:  invalid|  Keywords:
 Stage:  Unreviewed | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Comment (by finngruwier):

 Ah - I see.

 Thanks for pointing this out.

-- 
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] #12593: "manage.py loaddata" exits with system exist status 0 when there are errors

2010-01-12 Thread Django
#12593: "manage.py loaddata" exits with system exist status 0 when there are 
errors
+---
  Reporter:  bruce_s| Owner:  nobody
Status:  closed | Milestone:
 Component:  Uncategorized  |   Version:  1.1   
Resolution:  duplicate  |  Keywords:
 Stage:  Unreviewed | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by ramiro):

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

Comment:

 Duplicate of #11481.

-- 
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] #12593: "manage.py loaddata" exits with system exist status 0 when there are errors

2010-01-12 Thread Django
#12593: "manage.py loaddata" exits with system exist status 0 when there are 
errors
+---
  Reporter:  bruce_s| Owner:  nobody
Status:  new| Milestone:
 Component:  Uncategorized  |   Version:  1.1   
Resolution: |  Keywords:
 Stage:  Unreviewed | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by bruce_s):

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

Comment:

 Patch to fix with sys.exit(1):

 --- loaddata.py 2010-01-12 10:54:47.0 -0800
 +++ /usr/lib64/python2.6/site-
 packages/django/core/management/commands/loaddata.py  2010-01-12
 10:54:17.0 -0800
 @@ -105,7 +105,7 @@ class Command(BaseCommand):
  (fixture_name, format)))
  transaction.rollback()
  transaction.leave_transaction_management()
 -sys.exit(1)
 +return

  if os.path.isabs(fixture_name):
  fixture_dirs = [fixture_name]
 @@ -138,7 +138,7 @@ class Command(BaseCommand):
  (fixture_name,
 humanize(fixture_dir)))
  transaction.rollback()
 transaction.leave_transaction_management()
 -sys.exit(1)
 +return
  else:
  fixture_count += 1
  objects_in_fixture = 0
 @@ -167,7 +167,7 @@ class Command(BaseCommand):
  self.style.ERROR("Problem
 installing fixture '%s': %s\n" %
   (full_path,
 ''.join(traceback.format_exception(sys.exc_type,
   sys.exc_value,
 sys.exc_traceback)
 -sys.exit(1)
 +return
  fixture.close()

  # If the fixture we loaded contains 0
 objects, assume that an
 @@ -178,7 +178,7 @@ class Command(BaseCommand):
  (fixture_name)))
  transaction.rollback()
 transaction.leave_transaction_management()
 -sys.exit(1)
 +return

  except Exception, e:
  if verbosity > 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] #12593: "manage.py loaddata" exits with system exist status 0 when there are errors

2010-01-12 Thread Django
#12593: "manage.py loaddata" exits with system exist status 0 when there are 
errors
---+
 Reporter:  bruce_s|   Owner:  nobody
   Status:  new|   Milestone:
Component:  Uncategorized  | Version:  1.1   
 Keywords: |   Stage:  Unreviewed
Has_patch:  0  |  
---+
 "manage.py loaddata" returns with system exit status 0 on error. it should
 return nonzero on error,
 so that (for example) it plays nice with ant, make, expect, etc.

 Example:

 {{{
 % ./manage.py loaddata gamedata-test.json
 Installing json fixture 'gamedata-test' from absolute path.
 Problem installing fixture 'gamedata-test.json': Traceback (most recent
 call last):
   File "/usr/lib64/python2.6/site-
 packages/django/core/management/commands/loaddata.py", line 150, in handle
 for obj in objects:
   File "/usr/lib64/python2.6/site-
 packages/django/core/serializers/json.py", line 41, in Deserializer
 for obj in PythonDeserializer(simplejson.load(stream)):
   File "/usr/lib64/python2.6/json/__init__.py", line 267, in load
 parse_constant=parse_constant, **kw)
   File "/usr/lib64/python2.6/json/__init__.py", line 307, in loads
 return _default_decoder.decode(s)
   File "/usr/lib64/python2.6/json/decoder.py", line 319, in decode
 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
   File "/usr/lib64/python2.6/json/decoder.py", line 336, in raw_decode
 obj, end = self._scanner.iterscan(s, **kw).next()
   File "/usr/lib64/python2.6/json/scanner.py", line 55, in iterscan
 rval, next_pos = action(m, context)
   File "/usr/lib64/python2.6/json/decoder.py", line 219, in JSONArray
 raise ValueError(errmsg("Expecting object", s, end))
 ValueError: Expecting object: line 2 column 5 (char 6)
 % echo $?
 0
 }}}

 The code at fault is in /django/core/management/commands/loaddata.py,
 around line 170 (and in several other places),
 where there are try/except blocks which return when they should either
 sys.exit(1) or raise, so that the outermost program
 knows to exit with error:


 {{{
 except Exception:
 import traceback
 fixture.close()
 transaction.rollback()
 transaction.leave_transaction_management()
 if show_traceback:
 traceback.print_exc()
 else:
 sys.stderr.write(
 self.style.ERROR("Problem installing fixture '%s': %s\n" %
  (full_path,
 ''.join(traceback.format_exception(sys.exc_type,
  sys.exc_value, sys.exc_traceback)
 return
 }}}

 That last "return" is the bug.   Replacing it with "raise" fixes the
 problem but makes the output quite a bit messier:

 {{{
 % ./manage.py loaddata gamedata-test.json
 Installing json fixture 'gamedata-test' from absolute path.
 Problem installing fixture 'gamedata-test.json': Traceback (most recent
 call last):
   File "/usr/lib64/python2.6/site-
 packages/django/core/management/commands/loaddata.py", line 150, in handle
 for obj in objects:
   File "/usr/lib64/python2.6/site-
 packages/django/core/serializers/json.py", line 41, in Deserializer
 for obj in PythonDeserializer(simplejson.load(stream)):
   File "/usr/lib64/python2.6/json/__init__.py", line 267, in load
 parse_constant=parse_constant, **kw)
   File "/usr/lib64/python2.6/json/__init__.py", line 307, in loads
 return _default_decoder.decode(s)
   File "/usr/lib64/python2.6/json/decoder.py", line 319, in decode
 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
   File "/usr/lib64/python2.6/json/decoder.py", line 336, in raw_decode
 obj, end = self._scanner.iterscan(s, **kw).next()
   File "/usr/lib64/python2.6/json/scanner.py", line 55, in iterscan
 rval, next_pos = action(m, context)
   File "/usr/lib64/python2.6/json/decoder.py", line 219, in JSONArray
 raise ValueError(errmsg("Expecting object", s, end))
 ValueError: Expecting object: line 2 column 5 (char 6)

 Traceback (most recent call last):
   File "./manage.py", line 11, in 
 execute_manager(settings)
   File "/usr/lib64/python2.6/site-
 packages/django/core/management/__init__.py", line 439, in execute_manager
 utility.execute()
   File "/usr/lib64/python2.6/site-
 packages/django/core/management/__init__.py", line 380, in execute
 self.fetch_command(subcommand).run_from_argv(self.argv)
   File "/usr/lib64/python2.6/site-
 packages/django/core/management/base.py", line 195, in run_from_argv
 self.execute(*args, **options.__dict__)
   File "/usr/lib64/python2.6/site-
 packages/django/core/management/base.py", line 222, in execute
 output = self.handle(*args, **options)
   File "/usr/lib64/python2.6/site-
 packages/django/core/management/commands/loaddata.py", line 200, in handle
 transaction.leave_transaction_management()
   File "/usr/lib64/python2.6/site-packages/django/db/transaction.py", line

Re: [Django] #10923: Use thread-safe GEOS API if available

2010-01-12 Thread Django
#10923: Use thread-safe GEOS API if available
---+
  Reporter:  andrew_pendleton  | Owner:  jbronn 
Status:  closed| Milestone:  1.2
 Component:  GIS   |   Version:  SVN
Resolution:  fixed |  Keywords:  geos thread safe safety
 Stage:  Accepted  | Has_patch:  0  
Needs_docs:  0 |   Needs_tests:  0  
Needs_better_patch:  0 |  
---+
Changes (by jbronn):

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

Comment:

 (In [12214]) Fixed #10923 -- The GEOS bindings now use the thread-safe
 API, when applicable. Thanks, Tuure Laurinolli, for assistance in
 developing this patch.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-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] r12214 - in django/trunk/django/contrib/gis/geos: . prototypes

2010-01-12 Thread noreply
Author: jbronn
Date: 2010-01-12 12:40:54 -0600 (Tue, 12 Jan 2010)
New Revision: 12214

Added:
   django/trunk/django/contrib/gis/geos/prototypes/threadsafe.py
Modified:
   django/trunk/django/contrib/gis/geos/geometry.py
   django/trunk/django/contrib/gis/geos/io.py
   django/trunk/django/contrib/gis/geos/libgeos.py
   django/trunk/django/contrib/gis/geos/prototypes/coordseq.py
   django/trunk/django/contrib/gis/geos/prototypes/errcheck.py
   django/trunk/django/contrib/gis/geos/prototypes/geom.py
   django/trunk/django/contrib/gis/geos/prototypes/io.py
   django/trunk/django/contrib/gis/geos/prototypes/misc.py
   django/trunk/django/contrib/gis/geos/prototypes/predicates.py
   django/trunk/django/contrib/gis/geos/prototypes/prepared.py
   django/trunk/django/contrib/gis/geos/prototypes/topology.py
Log:
Fixed #10923 -- The GEOS bindings now use the thread-safe API, when applicable. 
 Thanks, Tuure Laurinolli, for assistance in developing this patch.


Modified: django/trunk/django/contrib/gis/geos/geometry.py
===
--- django/trunk/django/contrib/gis/geos/geometry.py2010-01-12 14:58:47 UTC 
(rev 12213)
+++ django/trunk/django/contrib/gis/geos/geometry.py2010-01-12 18:40:54 UTC 
(rev 12214)
@@ -21,6 +21,10 @@
 # the underlying GEOS library.
 from django.contrib.gis.geos import prototypes as capi
 
+# These functions provide access to a thread-local instance
+# of their corresponding GEOS I/O class.
+from django.contrib.gis.geos.prototypes.io import wkt_r, wkt_w, wkb_r, wkb_w, 
ewkb_w, ewkb_w3d
+
 # Regular expression for recognizing HEXEWKB and WKT.  A prophylactic measure
 # to prevent potentially malicious input from reaching the underlying C
 # library.  Not a substitute for good web security programming practices.
@@ -61,13 +65,13 @@
 if wkt_m:
 # Handling WKT input.
 if wkt_m.group('srid'): srid = int(wkt_m.group('srid'))
-g = wkt_r.read(wkt_m.group('wkt'))
+g = wkt_r().read(wkt_m.group('wkt'))
 elif hex_regex.match(geo_input):
 # Handling HEXEWKB input.
-g = wkb_r.read(geo_input)
+g = wkb_r().read(geo_input)
 elif gdal.GEOJSON and gdal.geometries.json_regex.match(geo_input):
 # Handling GeoJSON input.
-g = wkb_r.read(gdal.OGRGeometry(geo_input).wkb)
+g = wkb_r().read(gdal.OGRGeometry(geo_input).wkb)
 else:
 raise ValueError('String or unicode input unrecognized as WKT 
EWKT, and HEXEWKB.')
 elif isinstance(geo_input, GEOM_PTR):
@@ -75,7 +79,7 @@
 g = geo_input
 elif isinstance(geo_input, buffer):
 # When the input is a buffer (WKB).
-g = wkb_r.read(geo_input)
+g = wkb_r().read(geo_input)
 elif isinstance(geo_input, GEOSGeometry):
 g = capi.geom_clone(geo_input.ptr)
 else:
@@ -368,7 +372,7 @@
 @property
 def wkt(self):
 "Returns the WKT (Well-Known Text) representation of this Geometry."
-return wkt_w.write(self)
+return wkt_w().write(self)
 
 @property
 def hex(self):
@@ -380,7 +384,7 @@
 """
 # A possible faster, all-python, implementation:
 #  str(self.wkb).encode('hex')
-return wkb_w.write_hex(self)
+return wkb_w().write_hex(self)
 
 @property
 def hexewkb(self):
@@ -393,9 +397,9 @@
 if not GEOS_PREPARE:
 # See: http://trac.osgeo.org/geos/ticket/216
 raise GEOSException('Upgrade GEOS to 3.1 to get valid 3D 
HEXEWKB.')   
-return ewkb_w3d.write_hex(self)
+return ewkb_w3d().write_hex(self)
 else:
-return ewkb_w.write_hex(self)
+return ewkb_w().write_hex(self)
 
 @property
 def json(self):
@@ -416,7 +420,7 @@
 as a Python buffer.  SRID and Z values are not included, use the
 `ewkb` property instead.
 """
-return wkb_w.write(self)
+return wkb_w().write(self)
 
 @property
 def ewkb(self):
@@ -429,9 +433,9 @@
 if not GEOS_PREPARE:
 # See: http://trac.osgeo.org/geos/ticket/216
 raise GEOSException('Upgrade GEOS to 3.1 to get valid 3D 
EWKB.')
-return ewkb_w3d.write(self)
+return ewkb_w3d().write(self)
 else:
-return ewkb_w.write(self)
+return ewkb_w().write(self)
 
 @property
 def kml(self):
@@ -493,7 +497,7 @@
 g = gdal.OGRGeometry(self.wkb, srid)
 g.transform(ct)
 # Getting a new GEOS pointer
-ptr = wkb_r.read(g.wkb)
+ptr = wkb_r().read(g.wkb)
 if clone:
 # User wants a cloned transformed geometry returned.
 return GEOSGeometry(ptr, srid=g.srid)
@@ -655,9 +659,6 @@

[Django] #12592: i18nguy language code for brazilian portuguese is wrong

2010-01-12 Thread Django
#12592: i18nguy language code for brazilian portuguese is wrong
---+
 Reporter:  italomaia  |   Owner:  nobody
   Status:  new|   Milestone:
Component:  Uncategorized  | Version:  1.1   
 Keywords: |   Stage:  Unreviewed
Has_patch:  0  |  
---+
 In i18nguy, as advised in settings.py it says one should use pt-BR, but
 django-settings only understand pt-br. Maybe i18nguy should update, or
 django settings should advise another website.

-- 
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] #12339: ContentType update could cascade deletes to generic foreign keys, causing data loss

2010-01-12 Thread Django
#12339: ContentType update could cascade deletes to generic foreign keys, 
causing
data loss
---+
  Reporter:  kcarnold  | Owner:  nobody 
 
Status:  reopened  | Milestone: 
 
 Component:  Contrib apps  |   Version:  1.1
 
Resolution:|  Keywords:  contenttype, delete, 
cascade
 Stage:  Unreviewed| Has_patch:  0  
 
Needs_docs:  0 |   Needs_tests:  0  
 
Needs_better_patch:  0 |  
---+
Comment (by danros):

 I agree that this should be fixed, and perhaps at a high priority. The
 docs generally suggest that running syncdb on live data is 'safe' (it will
 only create new tables). This is definitely not the case due to 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.




[Django] #12591: django.contrib.gis.utils.srs is out of date

2010-01-12 Thread Django
#12591: django.contrib.gis.utils.srs is out of date
-+--
 Reporter:  yourcelf |   Owner:  nobody
   Status:  new  |   Milestone:
Component:  GIS  | Version:  SVN   
 Keywords:  srs add_postgis_srs  |   Stage:  Unreviewed
Has_patch:  0|  
-+--
 `django.contrib.gis.utils.srs.add_postgis_srs` fails with the following
 error:

 {{{
 ImportError   Traceback (most recent call
 last)
 /usr/local/lib/python2.6/dist-packages/django/contrib/gis/utils/srs.pyc in
 add_postgis_srs(srs, auth_name, auth_srid, ref_sys_name)
  22determined by GDAL.
  23 """
 ---> 24 from django.contrib.gis.db.backend import SpatialBackend
  25 from django.contrib.gis.models import SpatialRefSys
  26 from django.contrib.gis.gdal import SpatialReference

 ImportError: No module named backend
 }}}

 This is because the `django.contrib.gis.db.backend` module no longer
 exists (it has been renamed "`backends`"), and the `SpatialBackend` class
 is no longer defined.

 Thus the following instructions in geodjango documentation fail:
 http://geodjango.org/docs/install.html#add-google-projection-to-spatial-
 ref-sys-table

-- 
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] #12590: validators modeltest test fail under Python 2.4

2010-01-12 Thread Django
#12590: validators modeltest test fail under Python 2.4
---+
 Reporter:  ramiro |   Owner:  nobody
   Status:  new|   Milestone:  1.2   
Component:  Testing framework  | Version:  SVN   
 Keywords: |   Stage:  Unreviewed
Has_patch:  1  |  
---+
 This is happening since the model validation merge (r12098) * and can be
 seen in our buildbot: http://buildbot.djangoproject.com/builders/django-
 trunk%20ubuntu9.10-py2.4-sqlite/builds/147/steps/test/logs/stdio

 The reason seems to be that in Python 2.4 `isinstance(Exception, type)`
 returns False and in python 2.5 it returns True,
 the same applies to `ValidationError`.

 * But these tests weren't being run until r12156.

-- 
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] #12339: ContentType update could cascade deletes to generic foreign keys, causing data loss

2010-01-12 Thread Django
#12339: ContentType update could cascade deletes to generic foreign keys, 
causing
data loss
---+
  Reporter:  kcarnold  | Owner:  nobody 
 
Status:  reopened  | Milestone: 
 
 Component:  Contrib apps  |   Version:  1.1
 
Resolution:|  Keywords:  contenttype, delete, 
cascade
 Stage:  Unreviewed| Has_patch:  0  
 
Needs_docs:  0 |   Needs_tests:  0  
 
Needs_better_patch:  0 |  
---+
Comment (by kcarnold):

 Pick your patch.

 The first one just removes the dangerous {{{delete}}}, always leaving
 stale content types alone.

 The second one keeps the {{{delete}}}, but guards it by a flag that
 defaults to False. It documents how to call the command with that flag
 being true. (It also incidentally enables {{{update_all_contenttypes}}} to
 pass along the new {{{db}}} parameter. I don't know if that's useful,
 though.) That documentation might arguably belong in the main docs, but I
 don't think it's worth integrating, given that it merely patches over the
 real problem (lack of migration support).

 I care that this bug is fixed, but I'm indifferent to which approach you
 prefer to take.

-- 
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] #12589: upload_to argument on FileField It is not completely clear in the documentation

2010-01-12 Thread Django
#12589: upload_to argument on FileField It is not completely clear in the
documentation
+---
  Reporter:  finngruwier| Owner:  nobody
Status:  closed | Milestone:
 Component:  Documentation  |   Version:  1.1   
Resolution:  invalid|  Keywords:
 Stage:  Unreviewed | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by kmtracey):

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

Comment:

 The MEDIA_ROOT setting is not ignored if the `upload_to` is a callable.
 The callable `upload_to` is expected to return a local filesystem path
 that will then be appended to MEDIA_ROOT, just like a static `upload_to`.
 (Note in both cases if these values turn out to be absolute paths then
 that absolute path will be used.  This will usually result in a
 !SuspiciousOperation exception since Django won't allow writing to files
 outside the MEDIA_ROOT tree. If, however, the absolute path happens to
 fall inside the MEDIA_ROOT tree then things will 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.




[Django] #12589: upload_to argument on FileField It is not completely clear in the documentation

2010-01-12 Thread Django
#12589: upload_to argument on FileField It is not completely clear in the
documentation
---+
 Reporter:  finngruwier|   Owner:  nobody
   Status:  new|   Milestone:
Component:  Documentation  | Version:  1.1   
 Keywords: |   Stage:  Unreviewed
Has_patch:  0  |  
---+
 The documentation says: "A local filesystem path that will be appended to
 your MEDIA_ROOT setting...". However, if file_field is a callable, the
 value returned from the callable will be used as the full path for the
 file, thus ignoring the MEDIA_ROOT setting.

-- 
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] #10933: Avoid " TypeError: Cannot convert Decimal("0.0000") to Decimal " when the decimal module has been reloaded

2010-01-12 Thread Django
#10933: Avoid " TypeError: Cannot convert Decimal("0.") to Decimal  " when 
the
decimal module has been reloaded
---+
  Reporter:  gagravarr | Owner:  nobody
Status:  new   | Milestone:
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  1 
Needs_better_patch:  0 |  
---+
Changes (by orzel):

  * version:  1.0 => SVN

Comment:

 Hello. Just to confirm that the bug (really annoying if you have 'send
 error mail' on) in django trunk as of today, although it's really, really
 worse. If i disable the above patch (that i'm using for very long), i got
 such a mail for almost every save(). I think it happenned less often in
 may.
 I'm using apache + mod_python.
 The updated patch is :


 {{{
 --- a/django/db/models/fields/__init__.py   Tue Jan 12 16:33:40 2010
 +0100
 +++ b/django/db/models/fields/__init__.py   Tue Jan 12 16:57:48 2010
 +0100
 @@ -761,6 +761,11 @@
  def to_python(self, value):
  if value is None:
  return value
 +# Work around reload(decimal) problems
 +if not isinstance(value, decimal.Decimal) and \
 +   len(str(value.__class__).split("'")) == 3 and \
 +   str(value.__class__).split("'")[1] == 'decimal.Decimal':
 +return decimal.Decimal( value.to_eng_string() )
  try:
  return decimal.Decimal(value)
  except decimal.InvalidOperation:

 }}}

-- 
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] #12512: Misspelling

2010-01-12 Thread Django
#12512: Misspelling
+---
  Reporter:  bward1 | Owner:  nobody
Status:  closed | Milestone:
 Component:  Documentation  |   Version:  1.1   
Resolution:  fixed  |  Keywords:  typo  
 Stage:  Ready for checkin  | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Comment (by jkocherhans):

 Doh, that should have been #12521, not #12512.

-- 
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] #12339: ContentType update could cascade deletes to generic foreign keys, causing data loss

2010-01-12 Thread Django
#12339: ContentType update could cascade deletes to generic foreign keys, 
causing
data loss
---+
  Reporter:  kcarnold  | Owner:  nobody 
 
Status:  reopened  | Milestone: 
 
 Component:  Contrib apps  |   Version:  1.1
 
Resolution:|  Keywords:  contenttype, delete, 
cascade
 Stage:  Unreviewed| Has_patch:  0  
 
Needs_docs:  0 |   Needs_tests:  0  
 
Needs_better_patch:  0 |  
---+
Comment (by danros):

 I was just bitten by this!

 My situation involved moving some models from one app to another. I might
 have guessed that syncdb would have created a new contenttype for the
 models, but i didn't expect syncdb to cascade delete all affected items
 with a foreignkey referring the 'old' contenttype!

 IMO this should not be the default behaviour, or if it is, there should be
 *large* warnings about the possible loss of data.

-- 
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] #12588: context_processors test failure since r12207

2010-01-12 Thread Django
#12588: context_processors test failure since r12207
---+
 Reporter:  kmtracey   |   Owner:  nobody
   Status:  new|   Milestone:  1.2   
Component:  Uncategorized  | Version:  SVN   
 Keywords: |   Stage:  Unreviewed
Has_patch:  0  |  
---+
 Since r12207 we're getting a failure when running the full test suite:

 {{{
 ==
 FAIL: test_message_attrs
 (regressiontests.context_processors.tests.AuthContextProcessorTests)
 --
 Traceback (most recent call last):
   File "/home/buildbot/slave-py2.5/parts/ubuntu9.10-py2.5-sqlite/django-
 
trunk_ubuntu9.10-py2.5-sqlite/build/tests/regressiontests/context_processors/tests.py",
 line 73, in test_message_attrs
 self.assertContains(response, "Message 1")
   File "/home/buildbot/slave-py2.5/parts/ubuntu9.10-py2.5-sqlite/django-
 trunk_ubuntu9.10-py2.5-sqlite/build/django/test/testcases.py", line 359,
 in assertContains
 "Couldn't find '%s' in response" % text)
 AssertionError: Couldn't find 'Message 1' in response

 --
 Ran 1349 tests in 409.910s

 FAILED (failures=1)
 Destroying test database 'default'...
 Destroying test database 'other'...
 program finished with exit code 1
 elapsedTime=447.11

 }}}

 (From http://buildbot.djangoproject.com/builders/django-
 trunk%20ubuntu9.10-py2.5-sqlite/builds/140/steps/test/logs/stdio)

 Running the context_processors test by itself does not show the failure.

-- 
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] #7777: DecimalField validation ignores infinity and nan

2010-01-12 Thread Django
#: DecimalField validation ignores infinity and nan
-+--
  Reporter:  thebitguru  | Owner:  thebitguru
Status:  assigned| Milestone:
 Component:  Core framework  |   Version:  1.2-alpha 
Resolution:  |  Keywords:
 Stage:  Design decision needed  | Has_patch:  1 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Changes (by thebitguru):

  * version:  SVN => 1.2-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 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.




[Changeset] r12213 - django/trunk/docs/releases

2010-01-12 Thread noreply
Author: jkocherhans
Date: 2010-01-12 08:58:47 -0600 (Tue, 12 Jan 2010)
New Revision: 12213

Modified:
   django/trunk/docs/releases/1.2.txt
Log:
Fixed #12516. Added the new location of email_re to the release notes. This 
regex is undocumented, so we're not putting in an import for backwards 
compatibility.

Modified: django/trunk/docs/releases/1.2.txt
===
--- django/trunk/docs/releases/1.2.txt  2010-01-12 14:58:34 UTC (rev 12212)
+++ django/trunk/docs/releases/1.2.txt  2010-01-12 14:58:47 UTC (rev 12213)
@@ -360,6 +360,13 @@
 
 Use ``django.utils.formats.get_format()`` to get the appropriate formats.
 
+email_re
+
+
+An undocumented regex for validating email addresses has been moved from
+django.form.fields to django.core.validators. You will need to update
+your imports if you are using it.
+
 What's new in Django 1.2
 
 

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

2010-01-12 Thread noreply
Author: jkocherhans
Date: 2010-01-12 08:58:34 -0600 (Tue, 12 Jan 2010)
New Revision: 12212

Modified:
   django/trunk/docs/ref/validators.txt
Log:
Fixed #12525. Added a note to the validators doucmentation that models will not 
automatically run validators when saved, and a link to the ModelForm docs.

Modified: django/trunk/docs/ref/validators.txt
===
--- django/trunk/docs/ref/validators.txt2010-01-12 14:58:24 UTC (rev 
12211)
+++ django/trunk/docs/ref/validators.txt2010-01-12 14:58:34 UTC (rev 
12212)
@@ -41,8 +41,12 @@
 ==
 
 See the :ref:`form validation ` for more information on
-how validators are run in forms, and :ref:`Validating objects 
`
-for how they're run in models.
+how validators are run in forms, and :ref:`Validating objects
+` for how they're run in models. Note that validators will
+not be run automatically when you save a model, but if you are using a
+``ModelForm``, it will run your validators on any fields that are included in
+your form. See the :ref:`ModelForm documentation `
+for information on how model validation interacts with forms.
 
 Built-in validators
 ===

-- 
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] r12211 - in django/trunk: django/forms tests/regressiontests/forms

2010-01-12 Thread noreply
Author: jkocherhans
Date: 2010-01-12 08:58:24 -0600 (Tue, 12 Jan 2010)
New Revision: 12211

Modified:
   django/trunk/django/forms/models.py
   django/trunk/tests/regressiontests/forms/models.py
Log:
Fixed #12510. Changed ModelChoiceField to stop using some of its superclasses 
implementation. This could cause more than one query when generating choices. 
Thanks, Petr Marhoun and Honza Kral.

Modified: django/trunk/django/forms/models.py
===
--- django/trunk/django/forms/models.py 2010-01-12 14:26:17 UTC (rev 12210)
+++ django/trunk/django/forms/models.py 2010-01-12 14:58:24 UTC (rev 12211)
@@ -903,8 +903,7 @@
 
 choices = property(_get_choices, ChoiceField._set_choices)
 
-def clean(self, value):
-Field.clean(self, value)
+def to_python(self, value):
 if value in EMPTY_VALUES:
 return None
 try:
@@ -914,6 +913,9 @@
 raise ValidationError(self.error_messages['invalid_choice'])
 return value
 
+def validate(self, value):
+return Field.validate(self, value)
+
 class ModelMultipleChoiceField(ModelChoiceField):
 """A MultipleChoiceField whose choices are a model QuerySet."""
 widget = SelectMultiple

Modified: django/trunk/tests/regressiontests/forms/models.py
===
--- django/trunk/tests/regressiontests/forms/models.py  2010-01-12 14:26:17 UTC 
(rev 12210)
+++ django/trunk/tests/regressiontests/forms/models.py  2010-01-12 14:58:24 UTC 
(rev 12211)
@@ -3,11 +3,13 @@
 import tempfile
 import shutil
 
-from django.db import models
+from django.db import models, connection
+from django.conf import settings
 # Can't import as "forms" due to implementation details in the test suite (the
 # current file is called "forms" and is already imported).
 from django import forms as django_forms
 from django.core.files.storage import FileSystemStorage
+from django.test import TestCase
 
 temp_storage_location = tempfile.mkdtemp()
 temp_storage = FileSystemStorage(location=temp_storage_location)
@@ -41,6 +43,30 @@
 class FileForm(django_forms.Form):
 file1 = django_forms.FileField()
 
+class Group(models.Model):
+name = models.CharField(max_length=10)
+
+def __unicode__(self):
+return u'%s' % self.name
+
+class TestTicket12510(TestCase):
+''' It is not necessary to generate choices for ModelChoiceField 
(regression test for #12510). '''
+def setUp(self):
+self.groups = [Group.objects.create(name=name) for name in 'abc']
+self.old_debug = settings.DEBUG
+# turn debug on to get access to connection.queries
+settings.DEBUG = True
+
+def tearDown(self):
+settings.DEBUG = self.old_debug
+
+def test_choices_not_fetched_when_not_rendering(self):
+field = django_forms.ModelChoiceField(Group.objects.order_by('-name'))
+self.assertEqual('a', field.clean(self.groups[0].pk).name)
+# only one query is required to pull the model from DB
+self.assertEqual(1, len(connection.queries))
+
+
 __test__ = {'API_TESTS': """
 >>> from django.forms.models import ModelForm
 >>> from django.core.files.uploadedfile import SimpleUploadedFile

-- 
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] r12210 - django/trunk/django/db/models

2010-01-12 Thread noreply
Author: lukeplant
Date: 2010-01-12 08:26:17 -0600 (Tue, 12 Jan 2010)
New Revision: 12210

Modified:
   django/trunk/django/db/models/base.py
Log:
Fixed some bad indentation



Modified: django/trunk/django/db/models/base.py
===
--- django/trunk/django/db/models/base.py   2010-01-12 14:04:04 UTC (rev 
12209)
+++ django/trunk/django/db/models/base.py   2010-01-12 14:26:17 UTC (rev 
12210)
@@ -660,7 +660,7 @@
 date_errors = self._perform_date_checks(date_checks)
 
 for k, v in date_errors.items():
- errors.setdefault(k, []).extend(v)
+errors.setdefault(k, []).extend(v)
 
 if errors:
 raise ValidationError(errors)

-- 
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] #12587: Related fields when using multiple databases and different managers

2010-01-12 Thread Django
#12587: Related fields when using multiple databases and different managers
---+
  Reporter:  aprilmay  | Owner:  nobody 
 
Status:  closed| Milestone:  1.2
 
 Component:  Database layer (models, ORM)  |   Version:  SVN
 
Resolution:  duplicate |  Keywords:  multiple 
related
 Stage:  Unreviewed| Has_patch:  1  
 
Needs_docs:  0 |   Needs_tests:  0  
 
Needs_better_patch:  0 |  
---+
Changes (by russellm):

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

Comment:

 Duplicate of #12540. Although I'm sure the patch you have provided solves
 the problem as you see it, the general problem will require a slightly
 more general solution. See the discussion referenced in #12540 for more
 details.

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

2010-01-12 Thread noreply
Author: jkocherhans
Date: 2010-01-12 08:04:04 -0600 (Tue, 12 Jan 2010)
New Revision: 12209

Modified:
   django/trunk/docs/ref/models/instances.txt
Log:
Fixed #12586. Corrected a typo in the validation docs. Thanks, phyfus.

Modified: django/trunk/docs/ref/models/instances.txt
===
--- django/trunk/docs/ref/models/instances.txt  2010-01-12 13:14:32 UTC (rev 
12208)
+++ django/trunk/docs/ref/models/instances.txt  2010-01-12 14:04:04 UTC (rev 
12209)
@@ -59,7 +59,7 @@
 Example::
 
 try:
-article.full_validate()
+article.full_clean()
 except ValidationError, e:
 # Do something based on the errors contained in e.error_dict.
 # Display them to a user, or handle them programatically.

-- 
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] #12587: Related fields when using multiple databases and different managers

2010-01-12 Thread Django
#12587: Related fields when using multiple databases and different managers
--+-
 Reporter:  aprilmay  |   Owner:  nobody
   Status:  new   |   Milestone:  1.2   
Component:  Database layer (models, ORM)  | Version:  SVN   
 Keywords:  multiple related  |   Stage:  Unreviewed
Has_patch:  1 |  
--+-
 Let's take the case:

 - 2 databases in settings.py (default and otherdb)

 - 2 model managers, that will be used for managing models on different
 DBs:

 {{{
 class Manager1(models.Manager):
 def __init__(self):
 super(Manager1, self).__init__()
 self._db = 'default'

 class Manager2(models.Manager):
 def __init__(self):
 super(Manager2, self).__init__()
 self._db = 'otherdb'
 }}}

 - 2 models using a manager each, and a relation between the 2:

 {{{
 class MyModel1(models.Model):
 objects = Manager1()

 class MyModel2(models.Model):
 objects = Manager2()
 rel_to_model1 = models.OneToOneField(MyModel1)
 }}}

 In that case the relations fail:
 {{{
 a_model2 = MyModel2.objects.all()[0]
 a_model1 = a_model2.rel_to_model1
 }}}
 The last line raises an error because it uses the manager for model2 for
 searching model1.

 Also,
 {{{
 a_model1 = MyModel1.objects.all()[0]
 a_model2 = a_model1.mymodel2
 }}}
 The last line raises an error for the same reason than above.

 These examples show (and the proposed patch is a fix for) the
 OneToOneField relation, but other relations might suffer from same kind of
 issue.

 This is dummy code, hope it is good enough.

-- 
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] #12177: Error in part 4 of the tutorial?

2010-01-12 Thread Django
#12177: Error in part 4 of the tutorial?
+---
  Reporter:  simon_k| Owner:  nobody
Status:  closed | Milestone:
 Component:  Documentation  |   Version:  SVN   
Resolution:  duplicate  |  Keywords:
 Stage:  Unreviewed | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by russellm):

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

Comment:

 It sounds like you're not following the tutorial exactly. If you're
 following the tutorial, you shouldn't need to delve into the CSRF
 documention at all - you should only need to follow the steps that the
 tutorial gives you. Also, django.middleware.csrf.CsrfViewMiddleware
 clearly does exist in trunk, as does the csrf_token template tag.

 I don't know exactly what is going wrong with your particular setup; until
 we know there is a specific problem with the tutorial, this isn't
 something that should be in Trac. Please follow this up on Django-users
 and explain exactly what you have done; if it turns out that there is a
 problem with the tutorial, we can open a new 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.




[Changeset] r12208 - django/trunk/docs/releases

2010-01-12 Thread noreply
Author: lukeplant
Date: 2010-01-12 07:14:32 -0600 (Tue, 12 Jan 2010)
New Revision: 12208

Modified:
   django/trunk/docs/releases/1.2.txt
Log:
Documented the backwards incompatibility caused by `in` being a new keyword in 
the `if` template tag.



Modified: django/trunk/docs/releases/1.2.txt
===
--- django/trunk/docs/releases/1.2.txt  2010-01-12 02:41:57 UTC (rev 12207)
+++ django/trunk/docs/releases/1.2.txt  2010-01-12 13:14:32 UTC (rev 12208)
@@ -49,7 +49,8 @@
 'or' and 'not' as valid **variable** names. Previously, that worked in some
 cases even though these strings were normally treated as keywords. Now, the
 keyword status is always enforced, and template code such as ``{% if not %}`` 
or
-``{% if and %}`` will throw a ``TemplateSyntaxError``.
+``{% if and %}`` will throw a ``TemplateSyntaxError``. Also, ``in`` is a new
+keyword and so is not a valid variable name in this context.
 
 ``LazyObject``
 --

-- 
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] #12521: ModelAdmin save_model request.user idiom is broken by model validation

2010-01-12 Thread Django
#12521: ModelAdmin save_model request.user idiom is broken by model validation
-+--
  Reporter:  simon   | Owner:  jkocherhans
Status:  closed  | Milestone:  1.2
 Component:  django.contrib.admin|   Version:  SVN
Resolution:  fixed   |  Keywords: 
 Stage:  Design decision needed  | Has_patch:  1  
Needs_docs:  0   |   Needs_tests:  1  
Needs_better_patch:  0   |  
-+--
Changes (by lukeplant):

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

Comment:

 This was fixed in [12206] by Joseph Kocherhans (typo in commit message
 says #12512 instead of #12521).

-- 
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] #7048: Support clearing FileFields with ModelForms

2010-01-12 Thread Django
#7048: Support clearing FileFields with ModelForms
---+
  Reporter:  jarrow| Owner:  brosner
Status:  assigned  | Milestone:  1.2
 Component:  django.contrib.admin  |   Version:  SVN
Resolution:|  Keywords: 
 Stage:  Accepted  | Has_patch:  1  
Needs_docs:  0 |   Needs_tests:  1  
Needs_better_patch:  0 |  
---+
Changes (by gogna):

 * cc: flavio.cure...@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] #8933: Make more admin templates overridable

2010-01-12 Thread Django
#8933: Make more admin templates overridable
---+
  Reporter:  jezdez| Owner:  jezdez
Status:  new   | Milestone:
 Component:  django.contrib.admin  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  1 
Needs_better_patch:  0 |  
---+
Changes (by jezdez):

  * owner:  brosner => jezdez
  * status:  assigned => new
  * version:  1.0 => SVN

-- 
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] #10414: select_related ignores unrecognized fields

2010-01-12 Thread Django
#10414: select_related ignores unrecognized fields
---+
  Reporter:  trebor74hr| Owner:  nobody 
   
Status:  new   | Milestone:  1.2
   
 Component:  Database layer (models, ORM)  |   Version: 
   
Resolution:|  Keywords:  
select_related
 Stage:  Design decision needed| Has_patch:  0  
   
Needs_docs:  0 |   Needs_tests:  0  
   
Needs_better_patch:  0 |  
---+
Changes (by russellm):

  * milestone:  => 1.2

Comment:

 This is either going to be trivial or impossible to fix. Either way, we
 should address this for 1.2

-- 
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] #12151: UnicodeEncodeError from django.contrib.comments.views.utils line 41.

2010-01-12 Thread Django
#12151: UnicodeEncodeError from django.contrib.comments.views.utils line 41.
--+-
  Reporter:  mikl | Owner:  nobody
Status:  new  | Milestone:  1.2   
 Component:  django.contrib.comments  |   Version:  SVN   
Resolution:   |  Keywords:
 Stage:  Unreviewed   | Has_patch:  0 
Needs_docs:  0|   Needs_tests:  0 
Needs_better_patch:  0|  
--+-
Changes (by mikl):

 * cc: mikl (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] #12577: New validation behaviour breaks django.contrib.contenttypes when unique_toghether is used

2010-01-12 Thread Django
#12577: New validation behaviour breaks django.contrib.contenttypes when
unique_toghether is used
-+--
  Reporter:  raffaele.salm...@gmail.com  | Owner:  nobody
Status:  new | Milestone:
 Component:  Uncategorized   |   Version:  SVN   
Resolution:  |  Keywords:
 Stage:  Unreviewed  | Has_patch:  0 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Comment (by gvangool):

 Ignore my reply, just saw what you were doing.

-- 
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] #12577: New validation behaviour breaks django.contrib.contenttypes when unique_toghether is used

2010-01-12 Thread Django
#12577: New validation behaviour breaks django.contrib.contenttypes when
unique_toghether is used
-+--
  Reporter:  raffaele.salm...@gmail.com  | Owner:  nobody
Status:  new | Milestone:
 Component:  Uncategorized   |   Version:  SVN   
Resolution:  |  Keywords:
 Stage:  Unreviewed  | Has_patch:  0 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Comment (by gvangool):

 Just wondering why your using a {{{ GenericRelation }}} instead of a {{{
 ManyToManyField }}}?

-- 
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] #12577: New validation behaviour breaks django.contrib.contenttypes when unique_toghether is used

2010-01-12 Thread Django
#12577: New validation behaviour breaks django.contrib.contenttypes when
unique_toghether is used
-+--
  Reporter:  raffaele.salm...@gmail.com  | Owner:  nobody
Status:  new | Milestone:
 Component:  Uncategorized   |   Version:  SVN   
Resolution:  |  Keywords:
 Stage:  Unreviewed  | Has_patch:  0 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Changes (by raffaele.salm...@gmail.com):

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

Comment:

 With r12206 now tries to save a NULL object_id

 {{{
 Environment:

 Request Method: POST
 Request URL: http://localhost:8000/admin/example/genericcontact/add/
 Django Version: 1.2 alpha 1
 Python Version: 2.6.4
 Installed Applications:
 ['django.contrib.auth',
  'django.contrib.contenttypes',
  'django.contrib.sessions',
  'django.contrib.sites',
  'django.contrib.admin',
  'django.contrib.comments',
  'example']
 Installed Middleware:
 ('django.middleware.gzip.GZipMiddleware',
  'django.middleware.common.CommonMiddleware',
  'django.contrib.sessions.middleware.SessionMiddleware',
  'django.middleware.locale.LocaleMiddleware',
  'django.contrib.auth.middleware.AuthenticationMiddleware',
  'django.middleware.doc.XViewMiddleware',
  'django.middleware.transaction.TransactionMiddleware')


 Traceback:
 File "/home/raf/src/www/simple/site-
 packages/django/django/core/handlers/base.py" in get_response
   101. response = callback(request, *callback_args,
 **callback_kwargs)
 File "/home/raf/src/www/simple/site-
 packages/django/django/contrib/admin/options.py" in wrapper
   237. return self.admin_site.admin_view(view)(*args,
 **kwargs)
 File "/home/raf/src/www/simple/site-
 packages/django/django/utils/decorators.py" in __call__
   36. return self.decorator(self.func)(*args, **kwargs)
 File "/home/raf/src/www/simple/site-
 packages/django/django/utils/decorators.py" in _wrapped_view
   86. response = view_func(request, *args, **kwargs)
 File "/home/raf/src/www/simple/site-
 packages/django/django/utils/decorators.py" in __call__
   36. return self.decorator(self.func)(*args, **kwargs)
 File "/home/raf/src/www/simple/site-
 packages/django/django/views/decorators/cache.py" in _wrapped_view_func
   70. response = view_func(request, *args, **kwargs)
 File "/home/raf/src/www/simple/site-
 packages/django/django/contrib/admin/sites.py" in inner
   187. return view(request, *args, **kwargs)
 File "/home/raf/src/www/simple/site-
 packages/django/django/utils/decorators.py" in _wrapped_view
   86. response = view_func(request, *args, **kwargs)
 File "/home/raf/src/www/simple/site-
 packages/django/django/db/transaction.py" in _commit_on_success
   295. res = func(*args, **kw)
 File "/home/raf/src/www/simple/site-
 packages/django/django/contrib/admin/options.py" in add_view
   781. self.save_formset(request, form, formset,
 change=False)
 File "/home/raf/src/www/simple/site-
 packages/django/django/contrib/admin/options.py" in save_formset
   599. formset.save()
 File "/home/raf/src/www/simple/site-
 packages/django/django/forms/models.py" in save
   429. return self.save_existing_objects(commit) +
 self.save_new_objects(commit)
 File "/home/raf/src/www/simple/site-
 packages/django/django/forms/models.py" in save_new_objects
   567. self.new_objects.append(self.save_new(form,
 commit=commit))
 File "/home/raf/src/www/simple/site-
 packages/django/django/forms/models.py" in save_new
   413. return form.save(commit=commit)
 File "/home/raf/src/www/simple/site-
 packages/django/django/forms/models.py" in save
   313.  fail_message, commit, construct=False)
 File "/home/raf/src/www/simple/site-
 packages/django/django/forms/models.py" in save_instance
   95. instance.save()
 File "/home/raf/src/www/simple/site-
 packages/django/django/db/models/base.py" in save
   430. self.save_base(using=using, force_insert=force_insert,
 force_update=force_update)
 File "/home/raf/src/www/simple/site-
 packages/django/django/db/models/base.py" in save_base
   519. result = manager._insert(values,
 return_id=update_pk, using=using)
 File "/home/raf/src/www/simple/site-
 packages/django/django/db/models/manager.py" in _insert
   197. return insert_query(self.model, values, **kwargs)
 File "/home/raf/src/www/simple/site-
 packages/django/django/db/models/query.py" in insert_query
   1345. return query.get_compiler(usi