Re: [Django] #17052: dictConfig does not correctly handle absolute imports

2011-10-14 Thread Django
#17052: dictConfig does not correctly handle absolute imports
---+--
 Reporter:  dcramer|Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Uncategorized  |  Version:  SVN
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by russellm):

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


Comment:

 To clarify: you appear to be reporting an issue with dictconfig itself --
 is this correct? If so, has it been reported and/or fixed in Python's
 native dictconfig?

 Django's dictconfig is a literal copy of the one included in Python,
 included verbatim to ensure compatibility across Python versions. If
 there's a problem with the version bundled with Django, the preferred fix
 is to update to a new verbatim copy, not to patch Django's version.

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

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



[Changeset] r16987 - in django/trunk: django/db/backends django/db/backends/oracle django/db/backends/postgresql_psycopg2 django/db/models/fields docs/howto docs/ref docs/ref/models docs/releases doc

2011-10-14 Thread noreply
Author: aaugustin
Date: 2011-10-14 14:49:43 -0700 (Fri, 14 Oct 2011)
New Revision: 16987

Added:
   django/trunk/docs/topics/db/tablespaces.txt
   django/trunk/tests/modeltests/tablespaces/
   django/trunk/tests/modeltests/tablespaces/__init__.py
   django/trunk/tests/modeltests/tablespaces/models.py
   django/trunk/tests/modeltests/tablespaces/tests.py
Modified:
   django/trunk/django/db/backends/__init__.py
   django/trunk/django/db/backends/creation.py
   django/trunk/django/db/backends/oracle/base.py
   django/trunk/django/db/backends/postgresql_psycopg2/base.py
   django/trunk/django/db/backends/postgresql_psycopg2/creation.py
   django/trunk/django/db/backends/postgresql_psycopg2/operations.py
   django/trunk/django/db/models/fields/related.py
   django/trunk/docs/howto/custom-model-fields.txt
   django/trunk/docs/ref/databases.txt
   django/trunk/docs/ref/models/fields.txt
   django/trunk/docs/ref/models/options.txt
   django/trunk/docs/ref/settings.txt
   django/trunk/docs/releases/1.4.txt
   django/trunk/docs/topics/db/index.txt
Log:
Fixed #12308 -- Added tablespace support to the PostgreSQL backend.


Modified: django/trunk/django/db/backends/__init__.py
===
--- django/trunk/django/db/backends/__init__.py 2011-10-14 17:03:08 UTC (rev 
16986)
+++ django/trunk/django/db/backends/__init__.py 2011-10-14 21:49:43 UTC (rev 
16987)
@@ -365,6 +365,10 @@
 # date_interval_sql can properly handle mixed Date/DateTime fields and 
timedeltas
 supports_mixed_date_datetime_comparisons = True
 
+# Does the backend support tablespaces? Default to False because it isn't
+# in the SQL standard.
+supports_tablespaces = False
+
 # Features that need to be confirmed at runtime
 # Cache whether the confirmation has been performed.
 _confirmed = False
@@ -696,8 +700,12 @@
 
 def tablespace_sql(self, tablespace, inline=False):
 """
-Returns the SQL that will be appended to tables or rows to define
-a tablespace. Returns '' if the backend doesn't use tablespaces.
+Returns the SQL that will be used in a query to define the tablespace.
+
+Returns '' if the backend doesn't support tablespaces.
+
+If inline is True, the SQL is appended to a row; otherwise it's 
appended
+to the entire CREATE TABLE or CREATE INDEX statement.
 """
 return ''
 

Modified: django/trunk/django/db/backends/creation.py
===
--- django/trunk/django/db/backends/creation.py 2011-10-14 17:03:08 UTC (rev 
16986)
+++ django/trunk/django/db/backends/creation.py 2011-10-14 21:49:43 UTC (rev 
16987)
@@ -57,7 +57,9 @@
 if tablespace and f.unique:
 # We must specify the index tablespace inline, because we
 # won't be generating a CREATE INDEX statement for this field.
-
field_output.append(self.connection.ops.tablespace_sql(tablespace, inline=True))
+tablespace_sql = 
self.connection.ops.tablespace_sql(tablespace, inline=True)
+if tablespace_sql:
+field_output.append(tablespace_sql)
 if f.rel:
 ref_output, pending = 
self.sql_for_inline_foreign_key_references(f, known_models, style)
 if pending:
@@ -74,7 +76,9 @@
 full_statement.append('%s%s' % (line, i < len(table_output)-1 
and ',' or ''))
 full_statement.append(')')
 if opts.db_tablespace:
-
full_statement.append(self.connection.ops.tablespace_sql(opts.db_tablespace))
+tablespace_sql = 
self.connection.ops.tablespace_sql(opts.db_tablespace)
+if tablespace_sql:
+full_statement.append(tablespace_sql)
 full_statement.append(';')
 final_output.append('\n'.join(full_statement))
 
@@ -149,11 +153,9 @@
 qn = self.connection.ops.quote_name
 tablespace = f.db_tablespace or model._meta.db_tablespace
 if tablespace:
-sql = self.connection.ops.tablespace_sql(tablespace)
-if sql:
-tablespace_sql = ' ' + sql
-else:
-tablespace_sql = ''
+tablespace_sql = self.connection.ops.tablespace_sql(tablespace)
+if tablespace_sql:
+tablespace_sql = ' ' + tablespace_sql
 else:
 tablespace_sql = ''
 i_name = '%s_%s' % (model._meta.db_table, self._digest(f.column))

Modified: django/trunk/django/db/backends/oracle/base.py
===
--- django/trunk/django/db/backends/oracle/base.py  2011-10-14 17:03:08 UTC 
(rev 16986)
+++ django/trunk/django/db/backends/oracle/base.py  2011-10-14 21:49:43 UTC 
(rev 16987)
@@ -79,6 +79,7 @@
 can_defer_constraint_checks = True
 ignores_nu

Re: [Django] #12308: Adding tablespace support to postgres backends

2011-10-14 Thread Django
#12308: Adding tablespace support to postgres backends
-+-
 Reporter:  tclineks |Owner:  aaugustin
 Type:  New feature  |   Status:  closed
Component:  Database layer   |  Version:  SVN
  (models, ORM)  |   Resolution:  fixed
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by aaugustin):

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


Comment:

 In [16987]:
 {{{
 #!CommitTicketReference repository="" revision="16987"
 Fixed #12308 -- Added tablespace support to the PostgreSQL backend.
 }}}

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

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



Re: [Django] #17054: Django test suite does not run if gettext not installed

2011-10-14 Thread Django
#17054: Django test suite does not run if gettext not installed
---+--
 Reporter:  jsdalton   |Owner:  nobody
 Type:  Uncategorized  |   Status:  new
Component:  Testing framework  |  Version:  SVN
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by jsdalton):

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


Comment:

 Easy fix: https://github.com/django/django/pull/67

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

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



[Django] #17054: Django test suite does not run if gettext not installed

2011-10-14 Thread Django
#17054: Django test suite does not run if gettext not installed
---+
 Reporter:  jsdalton   |  Owner:  nobody
 Type:  Uncategorized  | Status:  new
Component:  Testing framework  |Version:  SVN
 Severity:  Normal |   Keywords:
 Triage Stage:  Unreviewed |  Has patch:  0
Easy pickings:  0  |  UI/UX:  0
---+
 This commit:

 
https://github.com/django/django/commit/5cc3dad1181745dc46af7b3494c0db7f8800fbd4#diff-25

 Converts the import of commands.tests in regression_tests/i18n from a *
 import to an explicit list.

 The problem is that those tests are conditionally imported in
 commands.tests based on whether the user has certain commands installed on
 their command line (xgettext and msgfmt to be exact). If those commands
 are not installed, the tests aren't loaded and the import in the main
 i18n.tests file fails. The result is that it's not possible to run the
 test suite:

 {{{
 $ ./runtests.py --settings=test_sqlite i18n
 Traceback (most recent call last):
   File "./runtests.py", line 286, in 
 failures = django_tests(int(options.verbosity), options.interactive,
 options.failfast, args)
   File "./runtests.py", line 153, in django_tests
 failures = test_runner.run_tests(test_labels, extra_tests=extra_tests)
   File
 "/Users/jsdalton/webs/testproject/src/django/django/test/simple.py", line
 353, in run_tests
 suite = self.build_suite(test_labels, extra_tests)
   File
 "/Users/jsdalton/webs/testproject/src/django/django/test/simple.py", line
 243, in build_suite
 suite.addTest(build_suite(app))
   File
 "/Users/jsdalton/webs/testproject/src/django/django/test/simple.py", line
 72, in build_suite
 test_module = get_tests(app_module)
   File
 "/Users/jsdalton/webs/testproject/src/django/django/test/simple.py", line
 33, in get_tests
 test_module = import_module('.'.join(prefix + [TEST_MODULE]))
   File
 "/Users/jsdalton/webs/testproject/src/django/django/utils/importlib.py",
 line 35, in import_module
 __import__(name)
   File
 
"/Users/jsdalton/webs/testproject/src/django/tests/regressiontests/i18n/tests.py",
 line 25, in 
 from .commands.tests import NoWrapExtractorTests,
 IgnoredExtractorTests, MessageCompilationTests, PoFileTests,
 BasicExtractorTests, JavascriptExtractorTests,
 CopyPluralFormsExtractorTests, SymlinkExtractorTests, ExtractorTests
 ImportError: cannot import name NoWrapExtractorTests
 }}}

 Easy fix is convert this line back to a * import. Better fix is???
 I'll think about it.

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

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



Re: [Django] #10046: ModPythonHandler class should check for IOError when writing response

2011-10-14 Thread Django
#10046: ModPythonHandler class should check for IOError when writing response
-+-
 Reporter:  ewoudenberg  |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  HTTP handling|  Version:  1.1
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:   | Triage Stage:  Design
Has patch:  1|  decision needed
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-

Comment (by anonymous):

 This is also a problem under mod_wsgi.

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

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



Re: [Django] #16360: Add a standard entrypoint for WSGI to project template

2011-10-14 Thread Django
#16360: Add a standard entrypoint for WSGI to project template
--+
 Reporter:  jezdez|Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  Core (Other)  |  Version:  SVN
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  1
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by carljm):

 https://github.com/django/django/pull/66 is the up-to-date version of this
 patch. Things still needed:

 1. Unit tests for get_wsgi_application and get_internal_wsgi_application.

 2. Manual testing of documented setup instructions for gunicorn, uWSGI,
 and Apache/mod_wsgi.

 3. General docs review.

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

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



Re: [Django] #17053: Add a note about USE_THOUSAND_SEPARATOR in localization docs

2011-10-14 Thread Django
#17053: Add a note about USE_THOUSAND_SEPARATOR in localization docs
-+-
 Reporter:  shelldweller |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |  Version:  1.3
Component:  Documentation|   Resolution:
 Severity:  Normal   | Triage Stage:
 Keywords:   |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by shelldweller):

 * cc: shelldweller (added)
 * needs_docs:   => 0
 * needs_tests:   => 0
 * needs_better_patch:   => 0


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

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



[Django] #17053: Add a note about USE_THOUSAND_SEPARATOR in localization docs

2011-10-14 Thread Django
#17053: Add a note about USE_THOUSAND_SEPARATOR in localization docs
--+
 Reporter:  shelldweller  |  Owner:  nobody
 Type:  Cleanup/optimization  | Status:  new
Component:  Documentation |Version:  1.3
 Severity:  Normal|   Keywords:
 Triage Stage:  Unreviewed|  Has patch:  1
Easy pickings:  1 |  UI/UX:  0
--+
 I've had a bit of a difficult time figuring out why my numbers did not
 localize with thousand separator in templates. After poking around I've
 found my way around. I would like to add little clarification to
 [https://docs.djangoproject.com/en/1.3/topics/i18n/localization/#format-
 localization the docs] summarizing my findings.

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

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



[Django] #17052: dictConfig does not correctly handle absolute imports

2011-10-14 Thread Django
#17052: dictConfig does not correctly handle absolute imports
---+
 Reporter:  dcramer|  Owner:  nobody
 Type:  Bug| Status:  new
Component:  Uncategorized  |Version:  SVN
 Severity:  Normal |   Keywords:
 Triage Stage:  Unreviewed |  Has patch:  0
Easy pickings:  0  |  UI/UX:  0
---+
 When you have a module, say foo.bar.logging.Handler, and you try to
 register that with dictConfig it will cause an import error due to the way
 the recursive importing was implemented.

 While we're not using Django for this, we are using logutils (which is
 still the same code):

 https://github.com/django/django/blob/master/django/utils/dictconfig.py#L157

 We patched it by simply using __import__ correctly:

 {{{
 class NotBrokenDictConfig(logutils.dictconfig.DictConfigurator):
 def resolve(self, s):
 module, cls_name = s.rsplit('.', 1)
 return getattr(self.importer(module, {}, {}, [cls_name]),
 cls_name)
 }}}

 See also https://github.com/dcramer/raven/issues/4

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

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



Re: [Django] #17041: Non-staff users should see clear message when trying to access admin

2011-10-14 Thread Django
#17041: Non-staff users should see clear message when trying to access admin
---+--
 Reporter:  coolRR |Owner:  nobody
 Type:  Uncategorized  |   Status:  closed
Component:  contrib.admin  |  Version:  1.3
 Severity:  Normal |   Resolution:  duplicate
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by bpeschier):

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


Comment:

 Duplicate of #15567

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

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



Re: [Django] #17023: WizardView.process_step() is docummented twice

2011-10-14 Thread Django
#17023: WizardView.process_step() is docummented twice
---+
 Reporter:  semente|Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Documentation  |  Version:  SVN
 Severity:  Normal |   Resolution:
 Keywords:  wizard | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by bpeschier):

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


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

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



Re: [Django] #10813: Database errors in the shell should roll back the transaction

2011-10-14 Thread Django
#10813: Database errors in the shell should roll back the transaction
-+-
 Reporter:  Glenn|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  SVN
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  1
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by gdufferin@…):

 * ui_ux:   => 0
 * easy:   => 0


Comment:

 This bug also persists when creating a custom management task i.e
 /manage.py mycustomtask. Obviously, it would be ideal for database errors
 not to occur, thus not needing the rollback, but in some cases this is
 unavoidable, i.e in a try: Model.objects.get(*params) except: do something
 else...scenario.

 Is there a fix?

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

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



[Changeset] r16986 - in django/trunk/tests: modeltests/select_related modeltests/validation regressiontests/comment_tests/tests regressiontests/defer_regress regressiontests/forms/tests regressiontes

2011-10-14 Thread noreply
Author: Alex
Date: 2011-10-14 10:03:08 -0700 (Fri, 14 Oct 2011)
New Revision: 16986

Modified:
   django/trunk/tests/modeltests/select_related/tests.py
   django/trunk/tests/modeltests/validation/test_unique.py
   django/trunk/tests/regressiontests/comment_tests/tests/templatetag_tests.py
   django/trunk/tests/regressiontests/defer_regress/tests.py
   django/trunk/tests/regressiontests/forms/tests/models.py
   django/trunk/tests/regressiontests/select_related_onetoone/tests.py
Log:
Switch several assertNumQueries to use the context manager, which is much more 
beautiful.

Modified: django/trunk/tests/modeltests/select_related/tests.py
===
--- django/trunk/tests/modeltests/select_related/tests.py   2011-10-14 
00:20:50 UTC (rev 16985)
+++ django/trunk/tests/modeltests/select_related/tests.py   2011-10-14 
17:03:08 UTC (rev 16986)
@@ -1,9 +1,10 @@
-from __future__ import absolute_import
+from __future__ import with_statement, absolute_import
 
 from django.test import TestCase
 
 from .models import Domain, Kingdom, Phylum, Klass, Order, Family, Genus, 
Species
 
+
 class SelectRelatedTests(TestCase):
 
 def create_tree(self, stringtree):
@@ -41,29 +42,27 @@
 """
 Normally, accessing FKs doesn't fill in related objects
 """
-def test():
+with self.assertNumQueries(8):
 fly = Species.objects.get(name="melanogaster")
 domain = fly.genus.family.order.klass.phylum.kingdom.domain
 self.assertEqual(domain.name, 'Eukaryota')
-self.assertNumQueries(8, test)
 
 def test_access_fks_with_select_related(self):
 """
 A select_related() call will fill in those related objects without any
 extra queries
 """
-def test():
+with self.assertNumQueries(1):
 person = 
Species.objects.select_related(depth=10).get(name="sapiens")
 domain = person.genus.family.order.klass.phylum.kingdom.domain
 self.assertEqual(domain.name, 'Eukaryota')
-self.assertNumQueries(1, test)
 
 def test_list_without_select_related(self):
 """
 select_related() also of course applies to entire lists, not just
 items. This test verifies the expected behavior without select_related.
 """
-def test():
+with self.assertNumQueries(9):
 world = Species.objects.all()
 families = [o.genus.family.name for o in world]
 self.assertEqual(sorted(families), [
@@ -72,14 +71,13 @@
 'Fabaceae',
 'Hominidae',
 ])
-self.assertNumQueries(9, test)
 
 def test_list_with_select_related(self):
 """
 select_related() also of course applies to entire lists, not just
 items. This test verifies the expected behavior with select_related.
 """
-def test():
+with self.assertNumQueries(1):
 world = Species.objects.all().select_related()
 families = [o.genus.family.name for o in world]
 self.assertEqual(sorted(families), [
@@ -88,21 +86,19 @@
 'Fabaceae',
 'Hominidae',
 ])
-self.assertNumQueries(1, test)
 
 def test_depth(self, depth=1, expected=7):
 """
 The "depth" argument to select_related() will stop the descent at a
 particular level.
 """
-def test():
+# Notice: one fewer queries than above because of depth=1
+with self.assertNumQueries(expected):
 pea = 
Species.objects.select_related(depth=depth).get(name="sativum")
 self.assertEqual(
 pea.genus.family.order.klass.phylum.kingdom.domain.name,
 'Eukaryota'
 )
-# Notice: one fewer queries than above because of depth=1
-self.assertNumQueries(expected, test)
 
 def test_larger_depth(self):
 """
@@ -116,12 +112,11 @@
 The "depth" argument to select_related() will stop the descent at a
 particular level. This can be used on lists as well.
 """
-def test():
+with self.assertNumQueries(5):
 world = Species.objects.all().select_related(depth=2)
 orders = [o.genus.family.order.name for o in world]
 self.assertEqual(sorted(orders),
 ['Agaricales', 'Diptera', 'Fabales', 'Primates'])
-self.assertNumQueries(5, test)
 
 def test_select_related_with_extra(self):
 s = Species.objects.all().select_related(depth=1)\
@@ -137,31 +132,28 @@
 In this case, we explicitly say to select the 'genus' and
 'genus.family' models, leading to the same number of queries as before.
 """
-def test():
+with self.assertNumQueries(1):
 world = Species.objects.select_related('genus__family')
 families = [o.genus.fami

Re: [Django] #11665: django.test.TestCase should flush constraints

2011-10-14 Thread Django
#11665: django.test.TestCase should flush constraints
---+
 Reporter:  Glenn  |Owner:
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  SVN
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by bretthoerner):

 * cc: brett@… (removed)


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

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



Re: [Django] #11665: django.test.TestCase should flush constraints

2011-10-14 Thread Django
#11665: django.test.TestCase should flush constraints
---+
 Reporter:  Glenn  |Owner:
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  SVN
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by aaugustin):

 On IRC, Alex and I confirmed that it would be better to avoid the
 `_ignore_num_queries` hack and just make the test database-dependent
 instead.

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

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



[Django] #17051: RegexValidator.message is not used

2011-10-14 Thread Django
#17051: RegexValidator.message is not used
+---
 Reporter:  jbcurtincode@…  |  Owner:  nobody
 Type:  Bug | Status:  new
Component:  Core (Other)|Version:  1.3
 Severity:  Normal  |   Keywords:  validator
 Triage Stage:  Unreviewed  |  Has patch:  0
Easy pickings:  0   |  UI/UX:  0
+---
 Error_messages works correctly, however with and with out error_messages,
 RegexValidator.message never pops up.

 {{{
 class UserIdForm(forms.Form):
 user_id = forms.CharField( max_length=50,
 label = _("Id"),
 help_text = _("Enter your ID."),
 error_messages = {
 'invalid':_(u"Your ID may only contain letters and numbers."),
 'required':_(u"Enter your ID."),
 },
 validators=[
 RegexValidator(
 regex='^[a-zA-Z0-9]*$',
 message=_(u"Forgotten message."),
 )
 ]
 )
 }}}

 {{{
 {% for field in form %}
 {{field}}{{field.help_text}}
 
 {% for error in field.errors %}
 {{error}}
 {% endfor %}
 {% endfor %}
 }}}

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

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



Re: [Django] #17050: add id attribute to individual model divs in the admin index

2011-10-14 Thread Django
#17050: add id attribute to individual model divs in the admin index
---+
 Reporter:  scytale|Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  SVN
 Severity:  Normal |   Resolution:
 Keywords:  admin  | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  1
Easy pickings:  1  |UI/UX:  1
---+
Changes (by julien):

 * needs_better_patch:  0 => 1
 * stage:  Unreviewed => Accepted


Comment:

 That sounds reasonable. Using slugify on the app's title would probably be
 error prone, so instead I'd simply pass the app_label through to the
 template and use that instead. Also, you'd need to prefix the id, for
 example with "app-", to be sure it doesn't conflict with other styles
 (e.g. if you have an app called "changelist").

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

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



Re: [Django] #14806: No template tag to support contextual translations

2011-10-14 Thread Django
#14806: No template tag to support contextual translations
--+
 Reporter:  jtiai |Owner:  julien
 Type:  New feature   |   Status:  new
Component:  Internationalization  |  Version:  SVN
 Severity:  Normal|   Resolution:
 Keywords:  i18n  | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  1
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by julien):

 * needs_docs:  0 => 1
 * needs_tests:  0 => 1


Comment:

 I've posted a work in progress. `{% Blocktrans %}` and `{% trans %}` are
 both implemented, although only there are only tests for `{% blocktrans
 %}` at this stage. This will also need docs.

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

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



Re: [Django] #14806: No template tag to support contextual translations

2011-10-14 Thread Django
#14806: No template tag to support contextual translations
--+
 Reporter:  jtiai |Owner:  julien
 Type:  New feature   |   Status:  new
Component:  Internationalization  |  Version:  SVN
 Severity:  Normal|   Resolution:
 Keywords:  i18n  | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by claudep):

 * cc: claude@… (added)


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

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



Re: [Django] #14806: No template tag to support contextual translations

2011-10-14 Thread Django
#14806: No template tag to support contextual translations
--+
 Reporter:  jtiai |Owner:  julien
 Type:  New feature   |   Status:  new
Component:  Internationalization  |  Version:  SVN
 Severity:  Normal|   Resolution:
 Keywords:  i18n  | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by aaugustin):

 herve (who reported #17045, a duplicate) is already working on a patch.
 He's "herve" on FreeNode too, you may want to check his status first.

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

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



Re: [Django] #17050: add id attribute to individual model divs in the admin index (was: add id blah to individual msodel divs in the admin index)

2011-10-14 Thread Django
#17050: add id attribute to individual model divs in the admin index
---+--
 Reporter:  scytale|Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  SVN
 Severity:  Normal |   Resolution:
 Keywords:  admin  | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  1  |UI/UX:  1
---+--
Changes (by scytale):

 * 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-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Django] #17050: add id blah to individual msodel divs in the admin index

2011-10-14 Thread Django
#17050: add id blah to individual msodel divs in the admin index
---+
 Reporter:  scytale|  Owner:  nobody
 Type:  New feature| Status:  new
Component:  contrib.admin  |Version:  SVN
 Severity:  Normal |   Keywords:  admin
 Triage Stage:  Unreviewed |  Has patch:  1
Easy pickings:  1  |  UI/UX:  1
---+
 A client has requested color coding in the admin index page to help staff
 identify sections relevant to particular departments. In order to
 facilitate this I would like to give id attributes to the individual divs
 that enclose each "module" (app) section in the index page.

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

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



Re: [Django] #14806: No template tag to support contextual translations

2011-10-14 Thread Django
#14806: No template tag to support contextual translations
--+
 Reporter:  jtiai |Owner:  julien
 Type:  New feature   |   Status:  new
Component:  Internationalization  |  Version:  SVN
 Severity:  Normal|   Resolution:
 Keywords:  i18n  | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by julien):

 * owner:  nobody => julien
 * ui_ux:   => 0
 * easy:   => 0


Comment:

 I'm working on this. Will post a patch soon.

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

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



Re: [Django] #13843: 'destroy_geom' filling up the apache error logs.

2011-10-14 Thread Django
#13843: 'destroy_geom' filling up the apache error logs.
---+--
 Reporter:  Rozza  |Owner:  nobody
 Type:  Uncategorized  |   Status:  reopened
Component:  GIS|  Version:  1.3
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  1  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by anonymous):

 ok. this happens when running on apache/mod_wsgi and doesn't happen when
 launched as standalone django server (development mode in Eclipse)

 {{{
 Environment:


 Request Method: POST
 Request URL: http://localhost.com/admin/world/worldborder/239/

 Django Version: 1.3.1
 Python Version: 2.7.1
 Installed Applications:
 ['localeurl',
  'django.contrib.admin',
  'django.contrib.auth',
  'django.contrib.contenttypes',
  'django.contrib.sessions',
  'django.contrib.sites',
  'django.contrib.messages',
  'django.contrib.staticfiles',
  'django.contrib.gis',
  'login',
  'mainpage',
  'classifiers',
  'currency_rates',
  'exchange_points',
  'world',
  'south']
 Installed Middleware:
 ('django.middleware.cache.UpdateCacheMiddleware',
  'localeurl.middleware.LocaleURLMiddleware',
  'django.middleware.common.CommonMiddleware',
  'django.middleware.csrf.CsrfViewMiddleware',
  'django.middleware.csrf.CsrfResponseMiddleware',
  'django.contrib.sessions.middleware.SessionMiddleware',
  'django.contrib.auth.middleware.AuthenticationMiddleware',
  'django.contrib.messages.middleware.MessageMiddleware',
  'django.middleware.transaction.TransactionMiddleware',
  'django.middleware.cache.FetchFromCacheMiddleware')


 Traceback:
 File "/usr/local/src/virtualenvs/localhost.com/lib/python2.7/site-
 packages/django/core/handlers/base.py" in get_response
   111. response = callback(request,
 *callback_args, **callback_kwargs)
 File "/usr/local/src/virtualenvs/localhost.com/lib/python2.7/site-
 packages/django/contrib/admin/options.py" in wrapper
   307. return self.admin_site.admin_view(view)(*args,
 **kwargs)
 File "/usr/local/src/virtualenvs/localhost.com/lib/python2.7/site-
 packages/django/utils/decorators.py" in _wrapped_view
   93. response = view_func(request, *args, **kwargs)
 File "/usr/local/src/virtualenvs/localhost.com/lib/python2.7/site-
 packages/django/views/decorators/cache.py" in _wrapped_view_func
   79. response = view_func(request, *args, **kwargs)
 File "/usr/local/src/virtualenvs/localhost.com/lib/python2.7/site-
 packages/django/contrib/admin/sites.py" in inner
   197. return view(request, *args, **kwargs)
 File "/usr/local/src/virtualenvs/localhost.com/lib/python2.7/site-
 packages/django/utils/decorators.py" in _wrapper
   28. return bound_func(*args, **kwargs)
 File "/usr/local/src/virtualenvs/localhost.com/lib/python2.7/site-
 packages/django/utils/decorators.py" in _wrapped_view
   93. response = view_func(request, *args, **kwargs)
 File "/usr/local/src/virtualenvs/rates.bixority.com/lib/python2.7/site-
 packages/django/utils/decorators.py" in bound_func
   24. return func(self, *args2, **kwargs2)
 File "/usr/local/src/virtualenvs/localhost.com/lib/python2.7/site-
 packages/django/db/transaction.py" in inner
   217. res = func(*args, **kwargs)
 File "/usr/local/src/virtualenvs/localhost.com/lib/python2.7/site-
 packages/django/contrib/admin/options.py" in change_view
   982. self.save_model(request, new_object, form,
 change=True)
 File "/usr/local/src/virtualenvs/localhost.com/lib/python2.7/site-
 packages/django/contrib/admin/options.py" in save_model
   665. obj.save()
 File "/usr/local/src/virtualenvs/localhost.com/lib/python2.7/site-
 packages/django/db/models/base.py" in save
   460. self.save_base(using=using, force_insert=force_insert,
 force_update=force_update)
 File "/usr/local/src/virtualenvs/localhost.com/lib/python2.7/site-
 packages/django/db/models/base.py" in save_base
   526. rows =
 manager.using(using).filter(pk=pk_val)._update(values)
 File "/usr/local/src/virtualenvs/localhost.com/lib/python2.7/site-
 packages/django/db/models/query.py" in _update
   491. return query.get_compiler(self.db).execute_sql(None)
 File "/usr/local/src/virtualenvs/localhost.com/lib/python2.7/site-
 packages/django/db/models/sql/compiler.py" in execute_sql
   869. cursor = super(SQLUpdateCompiler,
 self).execute_sql(result_type)
 File "/usr/local/src/virtualenvs/localhost.com/lib/python2.7/site-
 packages/django/db/models/sql/compiler.py" in execute_sql
   735.