Re: [Django] #7835: Provide the ability for model definitions that are only availably during testing

2009-04-01 Thread Django
#7835: Provide the ability for model definitions that are only availably during
testing
+---
  Reporter:  russellm   | Owner:  nobody 
Status:  new| Milestone: 
 Component:  Testing framework  |   Version:  SVN
Resolution: |  Keywords:  feature test models
 Stage:  Accepted   | Has_patch:  0  
Needs_docs:  0  |   Needs_tests:  0  
Needs_better_patch:  0  |  
+---
Changes (by gonz):

 * cc: gonz (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
-~--~~~~--~~--~--~---



[Changeset] r10367 - django/branches/releases/1.0.X

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-02 00:28:44 -0500 (Thu, 02 Apr 2009)
New Revision: 10367

Modified:
   django/branches/releases/1.0.X/
Log:
Updated svnmerge metadata.


Property changes on: django/branches/releases/1.0.X
___
Name: svnmerge-blocked
   - 
/django/trunk:9098,9103,9110,9112,9145,9152,9157,9160,9188,9248,9263,9278,9299-9300,9303-9304,9332,9344,9346,9348-9349,9353-9354,9397-9398,9463-9465,9470,9489-9490,9527-9528,9530-9532,9537-9538,9551-9555,9558,9561,9569,9592-9594,9620,9625,9637,9643,9646,9690,9700-9702,9707-9708,9714-9715,9724,9727-9729,9739,9742-9749,9752-9756,9759-9760,9763-9766,9769,9781,9785-9788,9791-9792,9799-9800,9803-9805,9808,9814-9820,9838-9841,9844-9846,9860,9862,9876,9882,9888-9898,9904-9905,9910-9911,9913,9915,9918,9921,9928,9930,9938,9940-9941,9944,9951-9952,9955,9963-9965,9978,9985,9989,10002,10005-10006,10008,10011-10012,10018,10021,10026-10030,10032-10035,10042-10048,10053,10062-10065,10070,10077,10080-10084,10088-10103,10105,10107-10124,10128-10135,10137,10141-10142,10144,10148,10161-10162,10168-10169,10171-10172,10174,10177-10179,10181-10184,10186-10188,10190-10191,10197,10222,10229,10235,10248-10249,10258,10271-10272,10275,10281,10315,10317-10318,10323-10324,10326-10327,10330-10332,10345-10347,10352-10353
   + 
/django/trunk:9098,9103,9110,9112,9145,9152,9157,9160,9188,9248,9263,9278,9299-9300,9303-9304,9332,9344,9346,9348-9349,9353-9354,9397-9398,9463-9465,9470,9489-9490,9527-9528,9530-9532,9537-9538,9551-9555,9558,9561,9569,9592-9594,9620,9625,9637,9643,9646,9690,9700-9702,9707-9708,9714-9715,9724,9727-9729,9739,9742-9749,9752-9756,9759-9760,9763-9766,9769,9781,9785-9788,9791-9792,9799-9800,9803-9805,9808,9814-9820,9838-9841,9844-9846,9860,9862,9876,9882,9888-9898,9904-9905,9910-9911,9913,9915,9918,9921,9928,9930,9938,9940-9941,9944,9951-9952,9955,9963-9965,9978,9985,9989,10002,10005-10006,10008,10011-10012,10018,10021,10026-10030,10032-10035,10042-10048,10053,10062-10065,10070,10077,10080-10084,10088-10103,10105,10107-10124,10128-10135,10137,10141-10142,10144,10148,10161-10162,10168-10169,10171-10172,10174,10177-10179,10181-10184,10186-10188,10190-10191,10197,10222,10229,10235,10248-10249,10258,10271-10272,10275,10281,10315,10317-10318,10323-10324,10326-10327,10330-10332,10345-10347,10352-10353,10357,10364
Name: svnmerge-integrated
   - 
/django/trunk:1-9097,9099-9102,9104-9109,9111,9113-9144,9146-9151,9153-9156,9158-9159,9161-9187,9189-9247,9249-9262,9264-9277,9279-9298,9301-9302,9305-9331,9333-9343,9345,9347,9350-9352,9355-9396,9399-9462,9466-9469,9471-9488,9491-9526,9529,9533-9536,9539-9550,9556-9557,9559-9560,9562-9568,9570-9591,9595-9619,9621-9624,9626-9636,9638-9642,9644-9645,9647-9689,9691-9699,9703-9706,9709-9713,9716-9723,9725-9726,9730-9738,9740-9741,9750-9751,9757-9758,9761-9762,9767-9768,9770-9780,9782-9784,9789-9790,9793-9798,9801-9802,9806-9807,9809-9813,9821-9837,9842-9843,9847-9859,9861,9863-9875,9877-9881,9883-9887,9899-9903,9906-9909,9912,9914,9916-9917,9919-9920,9922-9927,9929,9931-9937,9939,9942-9943,9945-9950,9953-9954,9956-9962,9966-9977,9979-9984,9986-9988,9990,9992,9994,9996-9998,10003,10007,10009,10013,10015,10017,10022,10024,10031,10036-10037,10040,10049,10051,10054-10058,10071,10073-10074,10078,10104,10125,10136,10139,10143,10145-10147,10149-10152,10170,10175,10193,10195-10196,10198-10221,10223-10228,10230-10234,10236-10247,10250-10257,10259-10270,10273-10274,10276-10280,10282-10283,10303-10304,10309,10311,10314,10316,10319-10322,10325,10328-10329,10333-10344,10348-10350
   + 
/django/trunk:1-9097,9099-9102,9104-9109,9111,9113-9144,9146-9151,9153-9156,9158-9159,9161-9187,9189-9247,9249-9262,9264-9277,9279-9298,9301-9302,9305-9331,9333-9343,9345,9347,9350-9352,9355-9396,9399-9462,9466-9469,9471-9488,9491-9526,9529,9533-9536,9539-9550,9556-9557,9559-9560,9562-9568,9570-9591,9595-9619,9621-9624,9626-9636,9638-9642,9644-9645,9647-9689,9691-9699,9703-9706,9709-9713,9716-9723,9725-9726,9730-9738,9740-9741,9750-9751,9757-9758,9761-9762,9767-9768,9770-9780,9782-9784,9789-9790,9793-9798,9801-9802,9806-9807,9809-9813,9821-9837,9842-9843,9847-9859,9861,9863-9875,9877-9881,9883-9887,9899-9903,9906-9909,9912,9914,9916-9917,9919-9920,9922-9927,9929,9931-9937,9939,9942-9943,9945-9950,9953-9954,9956-9962,9966-9977,9979-9984,9986-9988,9990,9992,9994,9996-9998,10003,10007,10009,10013,10015,10017,10022,10024,10031,10036-10037,10040,10049,10051,10054-10058,10071,10073-10074,10078,10104,10125,10136,10139,10143,10145-10147,10149-10152,10170,10175,10193,10195-10196,10198-10221,10223-10228,10230-10234,10236-10247,10250-10257,10259-10270,10273-10274,10276-10280,10282-10283,10303-10304,10309,10311,10314,10316,10319-10322,10325,10328-10329,10333-10344,10348-10350,10355-10356,10358-10363,10365


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to 

Re: [Django] #8817: Accessing ImageField's dimensions doesn't close file

2009-04-01 Thread Django
#8817: Accessing ImageField's dimensions doesn't close file
---+
  Reporter:  tripediac | Owner:  nobody
Status:  new   | Milestone:  1.1   
 Component:  File uploads/storage  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by simon29):

 * cc: si...@s29.com.au (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
-~--~~~~--~~--~--~---



[Changeset] r10366 - in django/branches/releases/1.0.X: django/template tests/regressiontests/templates

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-02 00:22:17 -0500 (Thu, 02 Apr 2009)
New Revision: 10366

Modified:
   django/branches/releases/1.0.X/django/template/defaultfilters.py
   django/branches/releases/1.0.X/tests/regressiontests/templates/filters.py
Log:
[1.0.X] Fixed #9520: make the date filter fail silently for non-date values. 
Thanks, Andrew Badr and Eric Holscher. Backport of r10365 from trunk.

Modified: django/branches/releases/1.0.X/django/template/defaultfilters.py
===
--- django/branches/releases/1.0.X/django/template/defaultfilters.py
2009-04-02 05:20:25 UTC (rev 10365)
+++ django/branches/releases/1.0.X/django/template/defaultfilters.py
2009-04-02 05:22:17 UTC (rev 10366)
@@ -673,7 +673,10 @@
 return u''
 if arg is None:
 arg = settings.DATE_FORMAT
-return format(value, arg)
+try:
+return format(value, arg)
+except AttributeError:
+return ''
 date.is_safe = False
 
 def time(value, arg=None):
@@ -683,7 +686,10 @@
 return u''
 if arg is None:
 arg = settings.TIME_FORMAT
-return time_format(value, arg)
+try:
+return time_format(value, arg)
+except AttributeError:
+return ''
 time.is_safe = False
 
 def timesince(value, arg=None):

Modified: 
django/branches/releases/1.0.X/tests/regressiontests/templates/filters.py
===
--- django/branches/releases/1.0.X/tests/regressiontests/templates/filters.py   
2009-04-02 05:20:25 UTC (rev 10365)
+++ django/branches/releases/1.0.X/tests/regressiontests/templates/filters.py   
2009-04-02 05:22:17 UTC (rev 10366)
@@ -317,4 +317,10 @@
 'join02': (r'{% autoescape off %}{{ a|join:", " }}{% endautoescape 
%}', {'a': ['alpha', 'beta & me']}, 'alpha, beta & me'),
 'join03': (r'{{ a|join:"  " }}', {'a': ['alpha', 'beta & me']}, 
'alpha  beta  me'),
 'join04': (r'{% autoescape off %}{{ a|join:"  " }}{% 
endautoescape %}', {'a': ['alpha', 'beta & me']}, 'alpha  beta & me'),
+
+
+'date01': (r'{{ d|date:"m" }}', {'d': datetime(2008, 1, 1)}, '01'),
+'date02': (r'{{ d|date }}', {'d': datetime(2008, 1, 1)}, 'Jan. 1, 
2008'),
+#Ticket 9520: Make sure |date doesn't blow up on non-dates
+'date03': (r'{{ d|date:"m" }}', {'d': 'fail_string'}, ''),
 }


--~--~-~--~~~---~--~~
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] r10365 - in django/trunk: django/template tests/regressiontests/templates

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-02 00:20:25 -0500 (Thu, 02 Apr 2009)
New Revision: 10365

Modified:
   django/trunk/django/template/defaultfilters.py
   django/trunk/tests/regressiontests/templates/filters.py
Log:
Fixed #9520: make the date filter fail silently for non-date values. Thanks, 
Andrew Badr and Eric Holscher.

Modified: django/trunk/django/template/defaultfilters.py
===
--- django/trunk/django/template/defaultfilters.py  2009-04-02 05:02:39 UTC 
(rev 10364)
+++ django/trunk/django/template/defaultfilters.py  2009-04-02 05:20:25 UTC 
(rev 10365)
@@ -681,7 +681,10 @@
 return u''
 if arg is None:
 arg = settings.DATE_FORMAT
-return format(value, arg)
+try:
+return format(value, arg)
+except AttributeError:
+return ''
 date.is_safe = False
 
 def time(value, arg=None):
@@ -691,7 +694,10 @@
 return u''
 if arg is None:
 arg = settings.TIME_FORMAT
-return time_format(value, arg)
+try:
+return time_format(value, arg)
+except AttributeError:
+return ''
 time.is_safe = False
 
 def timesince(value, arg=None):

Modified: django/trunk/tests/regressiontests/templates/filters.py
===
--- django/trunk/tests/regressiontests/templates/filters.py 2009-04-02 
05:02:39 UTC (rev 10364)
+++ django/trunk/tests/regressiontests/templates/filters.py 2009-04-02 
05:20:25 UTC (rev 10365)
@@ -320,4 +320,10 @@
 'join02': (r'{% autoescape off %}{{ a|join:", " }}{% endautoescape 
%}', {'a': ['alpha', 'beta & me']}, 'alpha, beta & me'),
 'join03': (r'{{ a|join:"  " }}', {'a': ['alpha', 'beta & me']}, 
'alpha  beta  me'),
 'join04': (r'{% autoescape off %}{{ a|join:"  " }}{% 
endautoescape %}', {'a': ['alpha', 'beta & me']}, 'alpha  beta & me'),
+
+
+'date01': (r'{{ d|date:"m" }}', {'d': datetime(2008, 1, 1)}, '01'),
+'date02': (r'{{ d|date }}', {'d': datetime(2008, 1, 1)}, 'Jan. 1, 
2008'),
+#Ticket 9520: Make sure |date doesn't blow up on non-dates
+'date03': (r'{{ d|date:"m" }}', {'d': 'fail_string'}, ''),
 }


--~--~-~--~~~---~--~~
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] r10364 - django/trunk/django/db/backends/sqlite3

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-02 00:02:39 -0500 (Thu, 02 Apr 2009)
New Revision: 10364

Modified:
   django/trunk/django/db/backends/sqlite3/introspection.py
Log:
Fixed #9779: added support for relation detection to inspectdb under SQLite. 
Thanks, gabbott and ramiro.

Modified: django/trunk/django/db/backends/sqlite3/introspection.py
===
--- django/trunk/django/db/backends/sqlite3/introspection.py2009-04-02 
04:34:42 UTC (rev 10363)
+++ django/trunk/django/db/backends/sqlite3/introspection.py2009-04-02 
05:02:39 UTC (rev 10364)
@@ -1,3 +1,4 @@
+import re
 from django.db.backends import BaseDatabaseIntrospection
 
 # This light wrapper "fakes" a dictionary interface, because some SQLite data
@@ -55,8 +56,54 @@
  info['null_ok']) for info in self._table_info(cursor, 
table_name)]
 
 def get_relations(self, cursor, table_name):
-raise NotImplementedError
-
+""" 
+Returns a dictionary of {field_index: (field_index_other_table, 
other_table)} 
+representing all relationships to the given table. Indexes are 
0-based. 
+""" 
+ 
+# Dictionary of relations to return 
+relations = {} 
+ 
+# Schema for this table 
+cursor.execute("SELECT sql FROM sqlite_master WHERE tbl_name = %s", 
[table_name]) 
+results = cursor.fetchone()[0].strip() 
+results = results.split('(', 1)[1] 
+results = results.rsplit(')', 1)[0] 
+
+# Walk through and look for references to other tables. SQLite doesn't
+# really have enforced references, but since it echoes out the SQL used
+# to create the table we can look for REFERENCES statements used there.
+for field_index, field_desc in enumerate(results.split(',')): 
+field_desc = field_desc.strip() 
+if field_desc.startswith("UNIQUE"): 
+continue 
+
+m = re.search('references (.*) \(["|](.*)["|]\)', field_desc, re.I)
+if not m: 
+continue 
+ 
+table, column = [s.strip('"') for s in m.groups()]
+
+cursor.execute("SELECT sql FROM sqlite_master WHERE tbl_name = 
%s", [table])
+result = cursor.fetchone()
+if not result:
+continue
+other_table_results = result[0].strip() 
+other_table_results = other_table_results.split('(', 1)[1] 
+other_table_results = other_table_results.rsplit(')', 1)[0] 
+ 
+for other_index, other_desc in 
enumerate(other_table_results.split(',')): 
+other_desc = other_desc.strip() 
+if other_desc.startswith('UNIQUE'): 
+continue 
+
+name = other_desc.split(' ', 1)[0].strip('"') 
+if name == column: 
+relations[field_index] = (other_index, table)
+break
+
+return relations
+
 def get_indexes(self, cursor, table_name):
 """
 Returns a dictionary of fieldname -> infodict for the given table,


--~--~-~--~~~---~--~~
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] r10363 - in django/branches/releases/1.0.X/tests/regressiontests: . introspection

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 23:34:42 -0500 (Wed, 01 Apr 2009)
New Revision: 10363

Added:
   django/branches/releases/1.0.X/tests/regressiontests/introspection/
   
django/branches/releases/1.0.X/tests/regressiontests/introspection/__init__.py
   django/branches/releases/1.0.X/tests/regressiontests/introspection/models.py
   django/branches/releases/1.0.X/tests/regressiontests/introspection/tests.py
Log:
[1.0.X] Added tests for database introspection. Refs #9779. Backport r10362 
from trunk.

Added: 
django/branches/releases/1.0.X/tests/regressiontests/introspection/__init__.py
===

Added: 
django/branches/releases/1.0.X/tests/regressiontests/introspection/models.py
===
--- 
django/branches/releases/1.0.X/tests/regressiontests/introspection/models.py
(rev 0)
+++ 
django/branches/releases/1.0.X/tests/regressiontests/introspection/models.py
2009-04-02 04:34:42 UTC (rev 10363)
@@ -0,0 +1,20 @@
+from django.db import models
+
+class Reporter(models.Model):
+first_name = models.CharField(max_length=30)
+last_name = models.CharField(max_length=30)
+email = models.EmailField()
+
+def __unicode__(self):
+return u"%s %s" % (self.first_name, self.last_name)
+
+class Article(models.Model):
+headline = models.CharField(max_length=100)
+pub_date = models.DateField()
+reporter = models.ForeignKey(Reporter)
+
+def __unicode__(self):
+return self.headline
+
+class Meta:
+ordering = ('headline',)
\ No newline at end of file

Added: 
django/branches/releases/1.0.X/tests/regressiontests/introspection/tests.py
===
--- django/branches/releases/1.0.X/tests/regressiontests/introspection/tests.py 
(rev 0)
+++ django/branches/releases/1.0.X/tests/regressiontests/introspection/tests.py 
2009-04-02 04:34:42 UTC (rev 10363)
@@ -0,0 +1,99 @@
+from django.db import connection
+from django.test import TestCase
+from django.utils import functional
+
+from models import Reporter, Article
+
+#
+# The introspection module is optional, so methods tested here might raise
+# NotImplementedError. This is perfectly acceptable behavior for the backend
+# in question, but the tests need to handle this without failing. Ideally we'd
+# skip these tests, but until #4788 is done we'll just ignore them.
+#
+# The easiest way to accomplish this is to decorate every test case with a 
+# wrapper that ignores the exception.
+#
+# The metaclass is just for fun.
+#
+
+def ignore_not_implemented(func):
+def _inner(*args, **kwargs):
+try:
+return func(*args, **kwargs)
+except NotImplementedError:
+return None
+functional.update_wrapper(_inner, func)
+return _inner
+
+class IgnoreNotimplementedError(type):
+def __new__(cls, name, bases, attrs):
+for k,v in attrs.items():
+if k.startswith('test'):
+attrs[k] = ignore_not_implemented(v)
+return type.__new__(cls, name, bases, attrs)
+
+class IntrospectionTests(TestCase):
+__metaclass__ = IgnoreNotimplementedError
+
+def test_table_names(self):
+tl = connection.introspection.table_names()
+self.assert_(Reporter._meta.db_table in tl, 
+ "'%s' isn't in table_list()." % Reporter._meta.db_table)
+self.assert_(Article._meta.db_table in tl, 
+ "'%s' isn't in table_list()." % Article._meta.db_table)
+ 
+def test_django_table_names(self):
+cursor = connection.cursor()
+cursor.execute('CREATE TABLE django_introspection_testcase_table (id 
INTEGER);');
+tl = connection.introspection.django_table_names()
+self.assert_('django_introspection_testcase_table' not in tl,
+ "django_table_names() returned a non-Django table")
+cursor.execute("DROP TABLE django_introspection_testcase_table;")
+
+def test_installed_models(self):
+tables = [Article._meta.db_table, Reporter._meta.db_table]
+models = connection.introspection.installed_models(tables)
+self.assertEqual(models, set([Article, Reporter]))
+
+def test_sequence_list(self):
+sequences = connection.introspection.sequence_list()
+expected = {'table': Reporter._meta.db_table, 'column': 'id'}
+self.assert_(expected in sequences, 
+ 'Reporter sequence not found in sequence_list()')
+ 
+def test_get_table_description_names(self):
+cursor = connection.cursor()
+desc = connection.introspection.get_table_description(cursor, 
Reporter._meta.db_table)
+self.assertEqual([r[0] for r in desc],
+ [f.column for f in Reporter._meta.fields])
+
+   

[Changeset] r10362 - in django/trunk/tests/regressiontests: . introspection

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 23:32:48 -0500 (Wed, 01 Apr 2009)
New Revision: 10362

Added:
   django/trunk/tests/regressiontests/introspection/
   django/trunk/tests/regressiontests/introspection/__init__.py
   django/trunk/tests/regressiontests/introspection/models.py
   django/trunk/tests/regressiontests/introspection/tests.py
Log:
Added tests for database introspection. Refs #9779.

Added: django/trunk/tests/regressiontests/introspection/__init__.py
===

Added: django/trunk/tests/regressiontests/introspection/models.py
===
--- django/trunk/tests/regressiontests/introspection/models.py  
(rev 0)
+++ django/trunk/tests/regressiontests/introspection/models.py  2009-04-02 
04:32:48 UTC (rev 10362)
@@ -0,0 +1,20 @@
+from django.db import models
+
+class Reporter(models.Model):
+first_name = models.CharField(max_length=30)
+last_name = models.CharField(max_length=30)
+email = models.EmailField()
+
+def __unicode__(self):
+return u"%s %s" % (self.first_name, self.last_name)
+
+class Article(models.Model):
+headline = models.CharField(max_length=100)
+pub_date = models.DateField()
+reporter = models.ForeignKey(Reporter)
+
+def __unicode__(self):
+return self.headline
+
+class Meta:
+ordering = ('headline',)
\ No newline at end of file

Added: django/trunk/tests/regressiontests/introspection/tests.py
===
--- django/trunk/tests/regressiontests/introspection/tests.py   
(rev 0)
+++ django/trunk/tests/regressiontests/introspection/tests.py   2009-04-02 
04:32:48 UTC (rev 10362)
@@ -0,0 +1,99 @@
+from django.db import connection
+from django.test import TestCase
+from django.utils import functional
+
+from models import Reporter, Article
+
+#
+# The introspection module is optional, so methods tested here might raise
+# NotImplementedError. This is perfectly acceptable behavior for the backend
+# in question, but the tests need to handle this without failing. Ideally we'd
+# skip these tests, but until #4788 is done we'll just ignore them.
+#
+# The easiest way to accomplish this is to decorate every test case with a 
+# wrapper that ignores the exception.
+#
+# The metaclass is just for fun.
+#
+
+def ignore_not_implemented(func):
+def _inner(*args, **kwargs):
+try:
+return func(*args, **kwargs)
+except NotImplementedError:
+return None
+functional.update_wrapper(_inner, func)
+return _inner
+
+class IgnoreNotimplementedError(type):
+def __new__(cls, name, bases, attrs):
+for k,v in attrs.items():
+if k.startswith('test'):
+attrs[k] = ignore_not_implemented(v)
+return type.__new__(cls, name, bases, attrs)
+
+class IntrospectionTests(TestCase):
+__metaclass__ = IgnoreNotimplementedError
+
+def test_table_names(self):
+tl = connection.introspection.table_names()
+self.assert_(Reporter._meta.db_table in tl, 
+ "'%s' isn't in table_list()." % Reporter._meta.db_table)
+self.assert_(Article._meta.db_table in tl, 
+ "'%s' isn't in table_list()." % Article._meta.db_table)
+ 
+def test_django_table_names(self):
+cursor = connection.cursor()
+cursor.execute('CREATE TABLE django_introspection_testcase_table (id 
INTEGER);');
+tl = connection.introspection.django_table_names()
+self.assert_('django_introspection_testcase_table' not in tl,
+ "django_table_names() returned a non-Django table")
+cursor.execute("DROP TABLE django_introspection_testcase_table;")
+
+def test_installed_models(self):
+tables = [Article._meta.db_table, Reporter._meta.db_table]
+models = connection.introspection.installed_models(tables)
+self.assertEqual(models, set([Article, Reporter]))
+
+def test_sequence_list(self):
+sequences = connection.introspection.sequence_list()
+expected = {'table': Reporter._meta.db_table, 'column': 'id'}
+self.assert_(expected in sequences, 
+ 'Reporter sequence not found in sequence_list()')
+ 
+def test_get_table_description_names(self):
+cursor = connection.cursor()
+desc = connection.introspection.get_table_description(cursor, 
Reporter._meta.db_table)
+self.assertEqual([r[0] for r in desc],
+ [f.column for f in Reporter._meta.fields])
+
+def test_get_table_description_types(self):
+cursor = connection.cursor()
+desc = connection.introspection.get_table_description(cursor, 
Reporter._meta.db_table)
+
+# Convert the datatype into a string
+def 

Re: [Django] #10691: Comments feed not translated

2009-04-01 Thread Django
#10691: Comments feed not translated
--+-
  Reporter:  zgoda| Owner:  nobody  
  
Status:  new  | Milestone:  1.1 
  
 Component:  django.contrib.comments  |   Version:  SVN 
  
Resolution:   |  Keywords:  i18n 
translation feeds
 Stage:  Accepted | Has_patch:  1   
  
Needs_docs:  0|   Needs_tests:  0   
  
Needs_better_patch:  0|  
--+-
Changes (by thatch):

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

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



Re: [Django] #10696: manage.py throws away exception information

2009-04-01 Thread Django
#10696: manage.py throws away exception information
-+--
  Reporter:  Leo | Owner:  nobody
Status:  new | Milestone:  1.1   
 Component:  Core framework  |   Version:  SVN   
Resolution:  |  Keywords:
 Stage:  Design decision needed  | Has_patch:  0 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Changes (by thatch):

  * needs_better_patch:  => 0
  * needs_docs:  => 0
  * stage:  Unreviewed => Design decision needed
  * needs_tests:  => 0
  * milestone:  => 1.1

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



Re: [Django] #10588: pass status parameter through render_to_response

2009-04-01 Thread Django
#10588: pass status parameter through render_to_response
-+--
  Reporter:  novas0x2a   | Owner:  nobody
Status:  new | Milestone:  1.2   
 Component:  HTTP handling   |   Version:  SVN   
Resolution:  |  Keywords:
 Stage:  Design decision needed  | Has_patch:  1 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Changes (by thatch):

  * needs_better_patch:  => 0
  * component:  Uncategorized => HTTP handling
  * needs_tests:  => 0
  * milestone:  => 1.2
  * needs_docs:  => 0
  * stage:  Unreviewed => Design decision needed

-- 
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] #10532: An overridden get method on a custom manager passed to get_object_or_404 will not be called.

2009-04-01 Thread Django
#10532: An overridden get method on a custom manager passed to get_object_or_404
will not be called.
---+
  Reporter:  anonymous | Owner:  nobody
Status:  new   | Milestone:
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Design decision needed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by thatch):

  * needs_better_patch:  => 0
  * stage:  Unreviewed => Design decision needed
  * component:  Uncategorized => Database layer (models, ORM)
  * needs_tests:  => 0
  * needs_docs:  => 0

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



Re: [Django] #10630: [PATCH] GZipMiddleware does not handle all MSIE issues.

2009-04-01 Thread Django
#10630: [PATCH] GZipMiddleware does not handle all MSIE issues.
--+-
  Reporter:  sebastian_noack  | Owner:  nobody
Status:  new  | Milestone:  1.1   
 Component:  HTTP handling|   Version:  1.0   
Resolution:   |  Keywords:
 Stage:  Accepted | Has_patch:  1 
Needs_docs:  0|   Needs_tests:  0 
Needs_better_patch:  0|  
--+-
Changes (by thatch):

  * needs_better_patch:  => 0
  * component:  Uncategorized => HTTP handling
  * needs_tests:  => 0
  * milestone:  => 1.1
  * needs_docs:  => 0
  * stage:  Unreviewed => Accepted

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



Re: [Django] #10650: Clarify use of MEDIA_ROOT in default settings.py

2009-04-01 Thread Django
#10650: Clarify use of MEDIA_ROOT in default settings.py
-+--
  Reporter:  tvon| Owner:  nobody
Status:  new | Milestone:  1.2   
 Component:  File uploads/storage|   Version:  1.0   
Resolution:  |  Keywords:
 Stage:  Design decision needed  | Has_patch:  0 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Changes (by thatch):

  * needs_better_patch:  => 0
  * component:  Uncategorized => File uploads/storage
  * needs_tests:  => 0
  * milestone:  => 1.2
  * needs_docs:  => 0
  * stage:  Unreviewed => Design decision needed

-- 
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] #10360: allow customized forbidden message when using exceptions

2009-04-01 Thread Django
#10360: allow customized forbidden message when using exceptions
-+--
  Reporter:  tallfred| Owner:  ericholscher
Status:  assigned| Milestone:  1.1 
 Component:  Core framework  |   Version:  1.0 
Resolution:  |  Keywords:  
 Stage:  Accepted| Has_patch:  1   
Needs_docs:  1   |   Needs_tests:  1   
Needs_better_patch:  0   |  
-+--
Changes (by ericholscher):

  * owner:  nobody => ericholscher
  * needs_docs:  0 => 1
  * status:  new => assigned
  * needs_tests:  0 => 1

Comment:

 This patch needs tests. It should be pretty simple.

 It should probably also be documented.

-- 
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] #10326: Allow handler500, handler404 to be callables

2009-04-01 Thread Django
#10326: Allow handler500, handler404 to be callables
-+--
  Reporter:  miracle2k   | Owner:  nobody   
 
Status:  new | Milestone:  1.1  
 
 Component:  Core framework  |   Version:  1.0  
 
Resolution:  |  Keywords:  handler404 handler500 
callable
 Stage:  Accepted| Has_patch:  1
 
Needs_docs:  0   |   Needs_tests:  1
 
Needs_better_patch:  0   |  
-+--
Changes (by ericholscher):

  * needs_tests:  0 => 1

Comment:

 This patch needs tests. If someone could do that at some point, that'd be
 great, otherwise I'll do 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] #10685: markdown line breaks with 80-char wrapped text don't make sense with hanging paragraphs i iug ih

2009-04-01 Thread Django
#10685: markdown line breaks with 80-char wrapped text don't make sense with
hanging paragraphs i iug ih
---+
  Reporter:  aresnick  | Owner:  nobody 
   
Status:  closed| Milestone: 
   
 Component:  Contrib apps  |   Version:  1.0
   
Resolution:  wontfix   |  Keywords:  markdown, template, 
indent, markup
 Stage:  Unreviewed| Has_patch:  0  
   
Needs_docs:  0 |   Needs_tests:  0  
   
Needs_better_patch:  0 |  
---+
Comment (by wayla):

 For the record, this *was* a Markdown bug. Within the next four days we
 will be releasing Markdown 2.0 which has fixed this and many other bugs.
 Not to worry, this time we have maintained the API Django uses so no new
 changes to Django. ;-)

 Watch http://twitter.com/WaylanL for the announcement.

-- 
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] #10130: Support setting deletion

2009-04-01 Thread Django
#10130: Support setting deletion
-+--
  Reporter:  jcassee | Owner:  nobody  
Status:  new | Milestone:  1.1 
 Component:  Core framework  |   Version:  SVN 
Resolution:  |  Keywords:  settings
 Stage:  Accepted| Has_patch:  1   
Needs_docs:  0   |   Needs_tests:  1   
Needs_better_patch:  0   |  
-+--
Changes (by ericholscher):

  * needs_tests:  0 => 1

Comment:

 Need to provide tests.

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



Re: [Django] #10065: url patterns exception message missing space

2009-04-01 Thread Django
#10065: url patterns exception message missing space
+---
  Reporter:  Matthew Flanagan   | 
Owner:  nobody
Status:  new| 
Milestone:  1.1   
 Component:  Core framework |   
Version:  1.0   
Resolution: |  
Keywords:
 Stage:  Ready for checkin  | 
Has_patch:  1 
Needs_docs:  0  |   
Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by ericholscher):

  * stage:  Accepted => Ready for checkin

Comment:

 Not sure if it really needs tests, but it's certainly ready to go in.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-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] r10361 - django/branches/releases/1.0.X/django/db/backends/postgresql

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 21:04:59 -0500 (Wed, 01 Apr 2009)
New Revision: 10361

Modified:
   django/branches/releases/1.0.X/django/db/backends/postgresql/client.py
Log:
[1.0.X] Fixed #10063: stop passing the -W flag to psql since it isn't needed 
and interferes with .pgpass. Thanks, Walter. Backport of r10360 from trunk.

Modified: django/branches/releases/1.0.X/django/db/backends/postgresql/client.py
===
--- django/branches/releases/1.0.X/django/db/backends/postgresql/client.py  
2009-04-02 02:03:46 UTC (rev 10360)
+++ django/branches/releases/1.0.X/django/db/backends/postgresql/client.py  
2009-04-02 02:04:59 UTC (rev 10361)
@@ -9,8 +9,6 @@
 args = [self.executable_name]
 if settings.DATABASE_USER:
 args += ["-U", settings.DATABASE_USER]
-if settings.DATABASE_PASSWORD:
-args += ["-W"]
 if settings.DATABASE_HOST:
 args.extend(["-h", settings.DATABASE_HOST])
 if settings.DATABASE_PORT:


--~--~-~--~~~---~--~~
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] #9522: Python serializer doesn't use base Serializer.get_string_value

2009-04-01 Thread Django
#9522: Python serializer doesn't use base Serializer.get_string_value
+---
  Reporter:  alexkoshelev   | Owner:  alexkoshelev
Status:  new| Milestone:  1.1 
 Component:  Serialization  |   Version:  1.0 
Resolution: |  Keywords:  
 Stage:  Accepted   | Has_patch:  1   
Needs_docs:  0  |   Needs_tests:  0   
Needs_better_patch:  0  |  
+---
Changes (by alexkoshelev):

  * owner:  ericholscher => alexkoshelev
  * needs_better_patch:  1 => 0
  * status:  assigned => new

Comment:

 Oh, where do you find "adding value to every model"? Patch doesn't do it
 at all. It only adds flag attribute to model *field* and field already
 knows how to convert it to string. And this knowledge is used in
 serializers just now.

-- 
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] r10360 - django/trunk/django/db/backends/postgresql

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 21:03:46 -0500 (Wed, 01 Apr 2009)
New Revision: 10360

Modified:
   django/trunk/django/db/backends/postgresql/client.py
Log:
Fixed #10063: stop passing the -W flag to psql since it isn't needed and 
interferes with .pgpass. Thanks, Walter.

Modified: django/trunk/django/db/backends/postgresql/client.py
===
--- django/trunk/django/db/backends/postgresql/client.py2009-04-02 
01:57:12 UTC (rev 10359)
+++ django/trunk/django/db/backends/postgresql/client.py2009-04-02 
02:03:46 UTC (rev 10360)
@@ -9,8 +9,6 @@
 args = [self.executable_name]
 if settings_dict['DATABASE_USER']:
 args += ["-U", settings_dict['DATABASE_USER']]
-if settings_dict['DATABASE_PASSWORD']:
-args += ["-W"]
 if settings_dict['DATABASE_HOST']:
 args.extend(["-h", settings_dict['DATABASE_HOST']])
 if settings_dict['DATABASE_PORT']:


--~--~-~--~~~---~--~~
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] r10359 - django/branches/releases/1.0.X/django/template/loaders

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 20:57:12 -0500 (Wed, 01 Apr 2009)
New Revision: 10359

Modified:
   django/branches/releases/1.0.X/django/template/loaders/app_directories.py
Log:
[1.0.X] The most exciting *backport* you'll ever see.

Modified: 
django/branches/releases/1.0.X/django/template/loaders/app_directories.py
===
--- django/branches/releases/1.0.X/django/template/loaders/app_directories.py   
2009-04-02 01:55:49 UTC (rev 10358)
+++ django/branches/releases/1.0.X/django/template/loaders/app_directories.py   
2009-04-02 01:57:12 UTC (rev 10359)
@@ -1,5 +1,5 @@
 """
-Wrapper for loading templates from "template" directories in INSTALLED_APPS
+Wrapper for loading templates from "templates" directories in INSTALLED_APPS
 packages.
 """
 


--~--~-~--~~~---~--~~
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] #10053: Incorrect pydoc in django.template.loaders.app_directories.load_template_source

2009-04-01 Thread Django
#10053: Incorrect pydoc in
django.template.loaders.app_directories.load_template_source
+---
  Reporter:  kylev  | Owner:  nobody
Status:  closed | Milestone:  1.1   
 Component:  Documentation  |   Version:  1.0   
Resolution:  fixed  |  Keywords:
 Stage:  Ready for checkin  | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by jacob):

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

Comment:

 Fixed in [10358].

-- 
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] r10358 - django/trunk/django/template/loaders

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 20:55:49 -0500 (Wed, 01 Apr 2009)
New Revision: 10358

Modified:
   django/trunk/django/template/loaders/app_directories.py
Log:
Fixed #10053: the most exciting commit you'll ever see.

Modified: django/trunk/django/template/loaders/app_directories.py
===
--- django/trunk/django/template/loaders/app_directories.py 2009-04-02 
01:49:12 UTC (rev 10357)
+++ django/trunk/django/template/loaders/app_directories.py 2009-04-02 
01:55:49 UTC (rev 10358)
@@ -1,5 +1,5 @@
 """
-Wrapper for loading templates from "template" directories in INSTALLED_APPS
+Wrapper for loading templates from "templates" directories in INSTALLED_APPS
 packages.
 """
 


--~--~-~--~~~---~--~~
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] r10357 - in django/trunk: django/db/models/sql tests/regressiontests/aggregation_regress

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 20:49:12 -0500 (Wed, 01 Apr 2009)
New Revision: 10357

Modified:
   django/trunk/django/db/models/sql/query.py
   django/trunk/tests/regressiontests/aggregation_regress/models.py
Log:
Fixed #10670: fixed reusing QuerySets previously used in a filter expression. 
Thanks, Alex Gaynor.

Modified: django/trunk/django/db/models/sql/query.py
===
--- django/trunk/django/db/models/sql/query.py  2009-04-02 01:41:56 UTC (rev 
10356)
+++ django/trunk/django/db/models/sql/query.py  2009-04-02 01:49:12 UTC (rev 
10357)
@@ -196,7 +196,7 @@
 obj.distinct = self.distinct
 obj.select_related = self.select_related
 obj.related_select_cols = []
-obj.aggregates = self.aggregates.copy()
+obj.aggregates = deepcopy(self.aggregates)
 if self.aggregate_select_mask is None:
 obj.aggregate_select_mask = None
 else:
@@ -2366,4 +2366,3 @@
 data[key].add(value)
 else:
 data[key] = set([value])
-

Modified: django/trunk/tests/regressiontests/aggregation_regress/models.py
===
--- django/trunk/tests/regressiontests/aggregation_regress/models.py
2009-04-02 01:41:56 UTC (rev 10356)
+++ django/trunk/tests/regressiontests/aggregation_regress/models.py
2009-04-02 01:49:12 UTC (rev 10357)
@@ -259,6 +259,23 @@
 >>> Book.objects.annotate(Count('publisher')).values('publisher').count()
 6
 
+>>> publishers = Publisher.objects.filter(id__in=(1,2))
+>>> publishers
+[, ]
+
+>>> publishers = publishers.annotate(n_books=models.Count('book'))
+>>> publishers[0].n_books
+2
+
+>>> publishers
+[, ]
+
+>>> books = Book.objects.filter(publisher__in=publishers)
+>>> books
+[, , ]
+
+>>> publishers
+[, ]
 """
 }
 
@@ -307,4 +324,3 @@
 
 
 """
-


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



[Changeset] r10356 - django/branches/releases/1.0.X/tests/regressiontests/templates

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 20:41:56 -0500 (Wed, 01 Apr 2009)
New Revision: 10356

Modified:
   django/branches/releases/1.0.X/tests/regressiontests/templates/tests.py
Log:
[1.0.X] Fixed the test in [10351] to work reguardless of the test settings. 
Backport of r10355 from trunk.

Modified: 
django/branches/releases/1.0.X/tests/regressiontests/templates/tests.py
===
--- django/branches/releases/1.0.X/tests/regressiontests/templates/tests.py 
2009-04-02 01:40:56 UTC (rev 10355)
+++ django/branches/releases/1.0.X/tests/regressiontests/templates/tests.py 
2009-04-02 01:41:56 UTC (rev 10356)
@@ -152,8 +152,13 @@
 def test_url_reverse_no_settings_module(self):
 #Regression test for #9005
 from django.template import Template, Context, TemplateSyntaxError
+
 old_settings_module = settings.SETTINGS_MODULE
+old_template_debug = settings.TEMPLATE_DEBUG
+
 settings.SETTINGS_MODULE = None
+settings.TEMPLATE_DEBUG = True
+
 t = Template('{% url will_not_match %}')
 c = Context()
 try:
@@ -162,7 +167,9 @@
 #Assert that we are getting the template syntax error and not the
 #string encoding error.
 self.assertEquals(e.message, "Caught an exception while rendering: 
Reverse for 'will_not_match' with arguments '()' and keyword arguments '{}' not 
found.")
+
 settings.SETTINGS_MODULE = old_settings_module
+settings.TEMPLATE_DEBUG = old_template_debug
 
 def test_templates(self):
 template_tests = self.get_template_tests()


--~--~-~--~~~---~--~~
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] r10355 - django/trunk/tests/regressiontests/templates

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 20:40:56 -0500 (Wed, 01 Apr 2009)
New Revision: 10355

Modified:
   django/trunk/tests/regressiontests/templates/tests.py
Log:
Fixed the test in [10351] to work reguardless of the test settings.

Modified: django/trunk/tests/regressiontests/templates/tests.py
===
--- django/trunk/tests/regressiontests/templates/tests.py   2009-04-02 
01:15:43 UTC (rev 10354)
+++ django/trunk/tests/regressiontests/templates/tests.py   2009-04-02 
01:40:56 UTC (rev 10355)
@@ -156,8 +156,13 @@
 def test_url_reverse_no_settings_module(self):
 #Regression test for #9005
 from django.template import Template, Context, TemplateSyntaxError
+
 old_settings_module = settings.SETTINGS_MODULE
+old_template_debug = settings.TEMPLATE_DEBUG
+
 settings.SETTINGS_MODULE = None
+settings.TEMPLATE_DEBUG = True
+
 t = Template('{% url will_not_match %}')
 c = Context()
 try:
@@ -166,7 +171,9 @@
 #Assert that we are getting the template syntax error and not the
 #string encoding error.
 self.assertEquals(e.message, "Caught an exception while rendering: 
Reverse for 'will_not_match' with arguments '()' and keyword arguments '{}' not 
found.")
+
 settings.SETTINGS_MODULE = old_settings_module
+settings.TEMPLATE_DEBUG = old_template_debug
 
 def test_templates(self):
 template_tests = self.get_template_tests()


--~--~-~--~~~---~--~~
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] r10354 - django/branches/releases/1.0.X

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 20:15:43 -0500 (Wed, 01 Apr 2009)
New Revision: 10354

Modified:
   django/branches/releases/1.0.X/
Log:
Updated svnmerge metadata.


Property changes on: django/branches/releases/1.0.X
___
Name: svnmerge-blocked
   - 
/django/trunk:9098,9103,9110,9112,9145,9152,9157,9160,9188,9248,9263,9278,9299-9300,9303-9304,9332,9344,9346,9348-9349,9353-9354,9397-9398,9463-9465,9470,9489-9490,9527-9528,9530-9532,9537-9538,9551-9555,9558,9561,9569,9592-9594,9620,9625,9637,9643,9646,9690,9700-9702,9707-9708,9714-9715,9724,9727-9729,9739,9742-9749,9752-9756,9759-9760,9763-9766,9769,9781,9785-9788,9791-9792,9799-9800,9803-9805,9808,9814-9820,9838-9841,9844-9846,9860,9862,9876,9882,9888-9898,9904-9905,9910-9911,9913,9915,9918,9921,9928,9930,9938,9940-9941,9944,9951-9952,9955,9963-9965,9978,9985,9989,10002,10005-10006,10008,10011-10012,10018,10021,10026-10030,10032-10035,10042-10048,10053,10062-10065,10070,10077,10080-10084,10088-10103,10105,10107-10124,10128-10135,10137,10141-10142,10144,10148,10161-10162,10168-10169,10171-10172,10174,10177-10179,10181-10184,10186-10188,10190-10191,10197,10222,10229,10235,10248-10249,10258,10271-10272,10275,10281,10315,10317-10318,10323-10324
   + 
/django/trunk:9098,9103,9110,9112,9145,9152,9157,9160,9188,9248,9263,9278,9299-9300,9303-9304,9332,9344,9346,9348-9349,9353-9354,9397-9398,9463-9465,9470,9489-9490,9527-9528,9530-9532,9537-9538,9551-9555,9558,9561,9569,9592-9594,9620,9625,9637,9643,9646,9690,9700-9702,9707-9708,9714-9715,9724,9727-9729,9739,9742-9749,9752-9756,9759-9760,9763-9766,9769,9781,9785-9788,9791-9792,9799-9800,9803-9805,9808,9814-9820,9838-9841,9844-9846,9860,9862,9876,9882,9888-9898,9904-9905,9910-9911,9913,9915,9918,9921,9928,9930,9938,9940-9941,9944,9951-9952,9955,9963-9965,9978,9985,9989,10002,10005-10006,10008,10011-10012,10018,10021,10026-10030,10032-10035,10042-10048,10053,10062-10065,10070,10077,10080-10084,10088-10103,10105,10107-10124,10128-10135,10137,10141-10142,10144,10148,10161-10162,10168-10169,10171-10172,10174,10177-10179,10181-10184,10186-10188,10190-10191,10197,10222,10229,10235,10248-10249,10258,10271-10272,10275,10281,10315,10317-10318,10323-10324,10326-10327,10330-10332,10345-10347,10352-10353
Name: svnmerge-integrated
   - 
/django/trunk:1-9097,9099-9102,9104-9109,9111,9113-9144,9146-9151,9153-9156,9158-9159,9161-9187,9189-9247,9249-9262,9264-9277,9279-9298,9301-9302,9305-9331,9333-9343,9345,9347,9350-9352,9355-9396,9399-9462,9466-9469,9471-9488,9491-9526,9529,9533-9536,9539-9550,9556-9557,9559-9560,9562-9568,9570-9591,9595-9619,9621-9624,9626-9636,9638-9642,9644-9645,9647-9689,9691-9699,9703-9706,9709-9713,9716-9723,9725-9726,9730-9738,9740-9741,9750-9751,9757-9758,9761-9762,9767-9768,9770-9780,9782-9784,9789-9790,9793-9798,9801-9802,9806-9807,9809-9813,9821-9837,9842-9843,9847-9859,9861,9863-9875,9877-9881,9883-9887,9899-9903,9906-9909,9912,9914,9916-9917,9919-9920,9922-9927,9929,9931-9937,9939,9942-9943,9945-9950,9953-9954,9956-9962,9966-9977,9979-9984,9986-9988,9990,9992,9994,9996-9998,10003,10007,10009,10013,10015,10017,10022,10024,10031,10036-10037,10040,10049,10051,10054-10058,10071,10073-10074,10078,10104,10125,10136,10139,10143,10145-10147,10149-10152,10170,10175,10193,10195-10196,10198-10221,10223-10228,10230-10234,10236-10247,10250-10257,10259-10270,10273-10274,10276-10280,10282-10283,10303-10304,10309,10311,10314,10316,10319,10348
   + 
/django/trunk:1-9097,9099-9102,9104-9109,9111,9113-9144,9146-9151,9153-9156,9158-9159,9161-9187,9189-9247,9249-9262,9264-9277,9279-9298,9301-9302,9305-9331,9333-9343,9345,9347,9350-9352,9355-9396,9399-9462,9466-9469,9471-9488,9491-9526,9529,9533-9536,9539-9550,9556-9557,9559-9560,9562-9568,9570-9591,9595-9619,9621-9624,9626-9636,9638-9642,9644-9645,9647-9689,9691-9699,9703-9706,9709-9713,9716-9723,9725-9726,9730-9738,9740-9741,9750-9751,9757-9758,9761-9762,9767-9768,9770-9780,9782-9784,9789-9790,9793-9798,9801-9802,9806-9807,9809-9813,9821-9837,9842-9843,9847-9859,9861,9863-9875,9877-9881,9883-9887,9899-9903,9906-9909,9912,9914,9916-9917,9919-9920,9922-9927,9929,9931-9937,9939,9942-9943,9945-9950,9953-9954,9956-9962,9966-9977,9979-9984,9986-9988,9990,9992,9994,9996-9998,10003,10007,10009,10013,10015,10017,10022,10024,10031,10036-10037,10040,10049,10051,10054-10058,10071,10073-10074,10078,10104,10125,10136,10139,10143,10145-10147,10149-10152,10170,10175,10193,10195-10196,10198-10221,10223-10228,10230-10234,10236-10247,10250-10257,10259-10270,10273-10274,10276-10280,10282-10283,10303-10304,10309,10311,10314,10316,10319-10322,10325,10328-10329,10333-10344,10348-10350


--~--~-~--~~~---~--~~
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 

[Changeset] r10353 - in django/trunk: django/forms tests/regressiontests/admin_views

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 19:01:15 -0500 (Wed, 01 Apr 2009)
New Revision: 10353

Modified:
   django/trunk/django/forms/models.py
   django/trunk/tests/regressiontests/admin_views/models.py
   django/trunk/tests/regressiontests/admin_views/tests.py
Log:
Fixed #9651: fixed save_as with inline forms. Thanks, kmike and Mnewman.

Modified: django/trunk/django/forms/models.py
===
--- django/trunk/django/forms/models.py 2009-04-01 23:41:36 UTC (rev 10352)
+++ django/trunk/django/forms/models.py 2009-04-02 00:01:15 UTC (rev 10353)
@@ -530,6 +530,9 @@
 # Remove the primary key from the form's data, we are only
 # creating new instances
 form.data[form.add_prefix(self._pk_field.name)] = None
+
+# Remove the foreign key from the form's data
+form.data[form.add_prefix(self.fk.name)] = None
 return form
 
 #...@classmethod

Modified: django/trunk/tests/regressiontests/admin_views/models.py
===
--- django/trunk/tests/regressiontests/admin_views/models.py2009-04-01 
23:41:36 UTC (rev 10352)
+++ django/trunk/tests/regressiontests/admin_views/models.py2009-04-02 
00:01:15 UTC (rev 10353)
@@ -287,7 +287,7 @@
 
 admin.site.register(Article, ArticleAdmin)
 admin.site.register(CustomArticle, CustomArticleAdmin)
-admin.site.register(Section, inlines=[ArticleInline])
+admin.site.register(Section, save_as=True, inlines=[ArticleInline])
 admin.site.register(ModelWithStringPrimaryKey)
 admin.site.register(Color)
 admin.site.register(Thing, ThingAdmin)

Modified: django/trunk/tests/regressiontests/admin_views/tests.py
===
--- django/trunk/tests/regressiontests/admin_views/tests.py 2009-04-01 
23:41:36 UTC (rev 10352)
+++ django/trunk/tests/regressiontests/admin_views/tests.py 2009-04-02 
00:01:15 UTC (rev 10353)
@@ -78,48 +78,66 @@
 response = self.client.post('/test_admin/%s/admin_views/section/add/' 
% self.urlbit, post_data)
 self.failUnlessEqual(response.status_code, 302) # redirect somewhere
 
+# Post data for edit inline
+inline_post_data = {
+"name": u"Test section",
+# inline data
+"article_set-TOTAL_FORMS": u"6",
+"article_set-INITIAL_FORMS": u"3",
+"article_set-0-id": u"1",
+# there is no title in database, give one here or formset will fail.
+"article_set-0-title": u"Norske bostaver æøå skaper problemer",
+"article_set-0-content": u"pMiddle content/p",
+"article_set-0-date_0": u"2008-03-18",
+"article_set-0-date_1": u"11:54:58",
+"article_set-0-section": u"1",
+"article_set-1-id": u"2",
+"article_set-1-title": u"Need a title.",
+"article_set-1-content": u"pOldest content/p",
+"article_set-1-date_0": u"2000-03-18",
+"article_set-1-date_1": u"11:54:58",
+"article_set-2-id": u"3",
+"article_set-2-title": u"Need a title.",
+"article_set-2-content": u"pNewest content/p",
+"article_set-2-date_0": u"2009-03-18",
+"article_set-2-date_1": u"11:54:58",
+"article_set-3-id": u"",
+"article_set-3-title": u"",
+"article_set-3-content": u"",
+"article_set-3-date_0": u"",
+"article_set-3-date_1": u"",
+"article_set-4-id": u"",
+"article_set-4-title": u"",
+"article_set-4-content": u"",
+"article_set-4-date_0": u"",
+"article_set-4-date_1": u"",
+"article_set-5-id": u"",
+"article_set-5-title": u"",
+"article_set-5-content": u"",
+"article_set-5-date_0": u"",
+"article_set-5-date_1": u"",
+}
+
 def testBasicEditPost(self):
 """
 A smoke test to ensure POST on edit_view works.
 """
-post_data = {
-"name": u"Test section",
-# inline data
-"article_set-TOTAL_FORMS": u"6",
-"article_set-INITIAL_FORMS": u"3",
-"article_set-0-id": u"1",
-# there is no title in database, give one here or formset
-# will fail.
-"article_set-0-title": u"Norske bostaver æøå skaper problemer",
-"article_set-0-content": u"pMiddle content/p",
-"article_set-0-date_0": u"2008-03-18",
-"article_set-0-date_1": u"11:54:58",
-"article_set-1-id": u"2",
-"article_set-1-title": u"Need a title.",
-"article_set-1-content": u"pOldest content/p",
-"article_set-1-date_0": u"2000-03-18",
-"article_set-1-date_1": u"11:54:58",
-"article_set-2-id": u"3",
-"article_set-2-title": u"Need a title.",
-"article_set-2-content": u"pNewest content/p",
-"article_set-2-date_0": u"2009-03-18",
-"article_set-2-date_1": 

Re: [Django] #9957: Feeds discard timezone information from pubdate

2009-04-01 Thread Django
#9957: Feeds discard timezone information from pubdate
+---
  Reporter:  urajat | Owner:  ericholscher   
Status:  assigned   | Milestone:  1.1
 Component:  RSS framework  |   Version:  SVN
Resolution: |  Keywords:  atom rss feeds timezone
 Stage:  Accepted   | Has_patch:  1  
Needs_docs:  0  |   Needs_tests:  1  
Needs_better_patch:  0  |  
+---
Changes (by ericholscher):

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

Comment:

 Make that, I'll do that later.

-- 
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] #10458: next_month and previous_month in views.generic.date_based.archive_month return wrong dates

2009-04-01 Thread Django
#10458: next_month and previous_month in views.generic.date_based.archive_month
return wrong dates
+---
  Reporter:  alasdair   | Owner:  fperetti  
   
Status:  reopened   | Milestone:  1.1   
   
 Component:  Generic views  |   Version:  1.0   
   
Resolution: |  Keywords:  next_month 
previous_month, pycamp2009
 Stage:  Accepted   | Has_patch:  1 
   
Needs_docs:  0  |   Needs_tests:  0 
   
Needs_better_patch:  0  |  
+---
Comment (by ramiro):

 #10688 reported the same next_month issue and provided a patch with
 another approach.

-- 
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] #9957: Feeds discard timezone information from pubdate

2009-04-01 Thread Django
#9957: Feeds discard timezone information from pubdate
+---
  Reporter:  urajat | Owner:  nobody 
Status:  new| Milestone:  1.1
 Component:  RSS framework  |   Version:  SVN
Resolution: |  Keywords:  atom rss feeds timezone
 Stage:  Accepted   | Has_patch:  1  
Needs_docs:  0  |   Needs_tests:  1  
Needs_better_patch:  0  |  
+---
Changes (by ericholscher):

  * needs_tests:  0 => 1

Comment:

 Looks sane to me. Skips the timezone creation magic when it already
 exists.

 Needs tests. I'll do that now.

-- 
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] r10352 - in django/trunk: django/template tests/regressiontests/templates

2009-04-01 Thread noreply

Author: brosner
Date: 2009-04-01 18:41:36 -0500 (Wed, 01 Apr 2009)
New Revision: 10352

Modified:
   django/trunk/django/template/defaulttags.py
   django/trunk/tests/regressiontests/templates/tests.py
Log:
Fixed #10043 -- widthratio tag now accepts a variable for the max_width 
argument.

The max_width argument now passes through FilterExpression which by side-affect
allows float values, but will be truncated.

Thanks obeattie and Eric Holscher for patches.

Modified: django/trunk/django/template/defaulttags.py
===
--- django/trunk/django/template/defaulttags.py 2009-04-01 23:09:45 UTC (rev 
10351)
+++ django/trunk/django/template/defaulttags.py 2009-04-01 23:41:36 UTC (rev 
10352)
@@ -402,12 +402,15 @@
 try:
 value = self.val_expr.resolve(context)
 maxvalue = self.max_expr.resolve(context)
+max_width = int(self.max_width.resolve(context))
 except VariableDoesNotExist:
 return ''
+except ValueError:
+raise TemplateSyntaxError("widthratio final argument must be an 
number")
 try:
 value = float(value)
 maxvalue = float(maxvalue)
-ratio = (value / maxvalue) * int(self.max_width)
+ratio = (value / maxvalue) * max_width
 except (ValueError, ZeroDivisionError):
 return ''
 return str(int(round(ratio)))
@@ -1143,12 +1146,10 @@
 if len(bits) != 4:
 raise TemplateSyntaxError("widthratio takes three arguments")
 tag, this_value_expr, max_value_expr, max_width = bits
-try:
-max_width = int(max_width)
-except ValueError:
-raise TemplateSyntaxError("widthratio final argument must be an 
integer")
+
 return WidthRatioNode(parser.compile_filter(this_value_expr),
-  parser.compile_filter(max_value_expr), max_width)
+  parser.compile_filter(max_value_expr),
+  parser.compile_filter(max_width))
 widthratio = register.tag(widthratio)
 
 #...@register.tag

Modified: django/trunk/tests/regressiontests/templates/tests.py
===
--- django/trunk/tests/regressiontests/templates/tests.py   2009-04-01 
23:09:45 UTC (rev 10351)
+++ django/trunk/tests/regressiontests/templates/tests.py   2009-04-01 
23:41:36 UTC (rev 10352)
@@ -923,7 +923,10 @@
 # Raise exception if we don't have 3 args, last one an integer
 'widthratio08': ('{% widthratio %}', {}, 
template.TemplateSyntaxError),
 'widthratio09': ('{% widthratio a b %}', {'a':50,'b':100}, 
template.TemplateSyntaxError),
-'widthratio10': ('{% widthratio a b 100.0 %}', {'a':50,'b':100}, 
template.TemplateSyntaxError),
+'widthratio10': ('{% widthratio a b 100.0 %}', {'a':50,'b':100}, 
'50'),
+
+# #10043: widthratio should allow max_width to be a variable
+'widthratio11': ('{% widthratio a b c %}', {'a':50,'b':100, 'c': 
100}, '50'),
 
 ### WITH TAG 

 'with01': ('{% with dict.key as key %}{{ key }}{% endwith %}', 
{'dict': {'key':50}}, '50'),


--~--~-~--~~~---~--~~
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] #10685: markdown line breaks with 80-char wrapped text don't make sense with hanging paragraphs i iug ih

2009-04-01 Thread Django
#10685: markdown line breaks with 80-char wrapped text don't make sense with
hanging paragraphs i iug ih
---+
  Reporter:  aresnick  | Owner:  nobody 
   
Status:  closed| Milestone: 
   
 Component:  Contrib apps  |   Version:  1.0
   
Resolution:  wontfix   |  Keywords:  markdown, template, 
indent, markup
 Stage:  Unreviewed| Has_patch:  0  
   
Needs_docs:  0 |   Needs_tests:  0  
   
Needs_better_patch:  0 |  
---+
Comment (by alec resnick ):

 Turns out it's a problem in Python Markdown.  Pasting the hanging indent
 text into [Dingus](http://daringfireball.net/projects/markdown/dingus)
 works, but converting the text using markdown as a module, I get:

 {{{
 '\n \n bench space :: Our http://sproutward.org/greenhouse;>space and\n\nequipment are available for use by individuals and groups.
 If\n  you or your friends (or your research partners or your classmates
 or\n  your children) want to figure out a way to make a project of yours\n
 happen at sprout--mailto:spr...@sproutward.org;>let\'s see how we
 can make it\n  happen.\n \n'
 }}}

 Thanks for the help!  I'll follow up with Python Markdown.

-- 
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] #9522: Python serializer doesn't use base Serializer.get_string_value

2009-04-01 Thread Django
#9522: Python serializer doesn't use base Serializer.get_string_value
+---
  Reporter:  alexkoshelev   | Owner:  ericholscher
Status:  assigned   | Milestone:  1.1 
 Component:  Serialization  |   Version:  1.0 
Resolution: |  Keywords:  
 Stage:  Accepted   | Has_patch:  1   
Needs_docs:  0  |   Needs_tests:  0   
Needs_better_patch:  1  |  
+---
Changes (by ericholscher):

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

-- 
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] #9522: Python serializer doesn't use base Serializer.get_string_value

2009-04-01 Thread Django
#9522: Python serializer doesn't use base Serializer.get_string_value
+---
  Reporter:  alexkoshelev   | Owner:  nobody
Status:  new| Milestone:  1.1   
 Component:  Serialization  |   Version:  1.0   
Resolution: |  Keywords:
 Stage:  Accepted   | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  1  |  
+---
Changes (by ericholscher):

  * needs_better_patch:  0 => 1

Comment:

 This patch is adding a value to every model in Django. I don't think this
 is the correct implementation. Models know nothing about serialization,
 and if we're going to start adding serialization information to them,
 we're going to need to have a much bigger discussion about it.

 This change should be contained to the serializers, perhaps with a third
 party serializer that provides the functionality. Something along the
 lines of ./manage.py dumpdata --full-serialize=ModelName perhaps.

-- 
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] #9596: Comparing a DateTimeField to a date is too hard

2009-04-01 Thread Django
#9596: Comparing a DateTimeField to a date is too hard
---+
  Reporter:  dja...@mashi.org  | Owner:  nobody 
  
Status:  new   | Milestone: 
  
 Component:  Database layer (models, ORM)  |   Version:  SVN
  
Resolution:|  Keywords:  
lookup_type date datetimefield compare comparison query_term field lookup
 Stage:  Accepted  | Has_patch:  1  
  
Needs_docs:  0 |   Needs_tests:  0  
  
Needs_better_patch:  0 |  
---+
Comment (by ssadler):

 Replying to [comment:14 Alex]:
 > Any particular reason this patch is implemented as an __range as opposed
 to doing __year, __month, and __day (genuinely curious).

 It didn't occur to me at the time, but I don't think it would be better.
 I'm not sure how the year, month and day lookups are implemented in
 Django, but if they aren't also done as ranges then the SQL engine has to
 convert column for each row, which means that it can't use any indexes
 that may exist on that column. If they are done as ranges it would produce
 three range lookups instead of one.

-- 
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] #9520: date filter should not crash when dealing with non date objects

2009-04-01 Thread Django
#9520: date filter should not crash when dealing with non date objects
--+-
  Reporter:  hotani   | Owner:  ericholscher
  
Status:  assigned | Milestone:  1.1 
  
 Component:  Template system  |   Version:  SVN 
  
Resolution:   |  Keywords:  date format filter 
template pycamp2009
 Stage:  Accepted | Has_patch:  1   
  
Needs_docs:  0|   Needs_tests:  0   
  
Needs_better_patch:  0|  
--+-
Changes (by ericholscher):

  * owner:  andrewbadr => ericholscher
  * status:  new => assigned

-- 
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] #8735: Lack of Portuguese LocalFlavor

2009-04-01 Thread Django
#8735: Lack of Portuguese LocalFlavor
-+--
  Reporter:  alcides | Owner: 
Status:  new | Milestone:  1.1
 Component:  django.contrib.localflavor  |   Version:  SVN
Resolution:  |  Keywords: 
 Stage:  Design decision needed  | Has_patch:  1  
Needs_docs:  1   |   Needs_tests:  0  
Needs_better_patch:  0   |  
-+--
Changes (by anonymous):

  * milestone:  => 1.1

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



Re: [Django] #9520: date filter should not crash when dealing with non date objects

2009-04-01 Thread Django
#9520: date filter should not crash when dealing with non date objects
--+-
  Reporter:  hotani   | Owner:  andrewbadr  
  
Status:  new  | Milestone:  1.1 
  
 Component:  Template system  |   Version:  SVN 
  
Resolution:   |  Keywords:  date format filter 
template pycamp2009
 Stage:  Accepted | Has_patch:  1   
  
Needs_docs:  0|   Needs_tests:  0   
  
Needs_better_patch:  0|  
--+-
Comment (by ericholscher):

 Added simple tests of the date filter. Also made it so that the filter
 returns the empty string on error, instead of the original value, which is
 a Django convention.

-- 
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] r10351 - in django/branches/releases/1.0.X: django/core/management django/template tests/regressiontests/templates

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 18:09:45 -0500 (Wed, 01 Apr 2009)
New Revision: 10351

Modified:
   django/branches/releases/1.0.X/django/core/management/__init__.py
   django/branches/releases/1.0.X/django/template/defaulttags.py
   django/branches/releases/1.0.X/tests/regressiontests/templates/tests.py
Log:
[1.0.X] Fixed #9005: don't wig out when reversing a URL if SETTINGS_MODULE 
isn't set. While I was there, I fixed #10599 by re-raising the original error 
message, which is almost always a better idea. Thanks, Eric. Backport of r10350 
from trunk.

Modified: django/branches/releases/1.0.X/django/core/management/__init__.py
===
--- django/branches/releases/1.0.X/django/core/management/__init__.py   
2009-04-01 22:46:46 UTC (rev 10350)
+++ django/branches/releases/1.0.X/django/core/management/__init__.py   
2009-04-01 23:09:45 UTC (rev 10351)
@@ -325,7 +325,7 @@
 else:
 os.environ['DJANGO_SETTINGS_MODULE'] = '%s.%s' % (project_name, 
settings_name)
 
-# Import the project module. We add the parent directory to PYTHONPATH to 
+# Import the project module. We add the parent directory to PYTHONPATH to
 # avoid some of the path errors new users can have.
 sys.path.append(os.path.join(project_directory, os.pardir))
 project_module = __import__(project_name, {}, {}, [''])

Modified: django/branches/releases/1.0.X/django/template/defaulttags.py
===
--- django/branches/releases/1.0.X/django/template/defaulttags.py   
2009-04-01 22:46:46 UTC (rev 10350)
+++ django/branches/releases/1.0.X/django/template/defaulttags.py   
2009-04-01 23:09:45 UTC (rev 10351)
@@ -371,15 +371,22 @@
 url = ''
 try:
 url = reverse(self.view_name, args=args, kwargs=kwargs)
-except NoReverseMatch:
-project_name = settings.SETTINGS_MODULE.split('.')[0]
-try:
-url = reverse(project_name + '.' + self.view_name,
+except NoReverseMatch, e:
+if settings.SETTINGS_MODULE:
+project_name = settings.SETTINGS_MODULE.split('.')[0]
+try:
+url = reverse(project_name + '.' + self.view_name,
   args=args, kwargs=kwargs)
-except NoReverseMatch:
+except NoReverseMatch:
+if self.asvar is None:
+# Re-raise the original exception, not the one with
+# the path relative to the project. This makes a 
+# better error message.
+raise e
+else:
 if self.asvar is None:
-raise
-
+raise e
+
 if self.asvar:
 context[self.asvar] = url
 return ''

Modified: 
django/branches/releases/1.0.X/tests/regressiontests/templates/tests.py
===
--- django/branches/releases/1.0.X/tests/regressiontests/templates/tests.py 
2009-04-01 22:46:46 UTC (rev 10350)
+++ django/branches/releases/1.0.X/tests/regressiontests/templates/tests.py 
2009-04-01 23:09:45 UTC (rev 10351)
@@ -149,6 +149,21 @@
 split = token.split_contents()
 self.assertEqual(split, ["sometag", '_("Page not found")', 
'value|yesno:_("yes,no")'])
 
+def test_url_reverse_no_settings_module(self):
+#Regression test for #9005
+from django.template import Template, Context, TemplateSyntaxError
+old_settings_module = settings.SETTINGS_MODULE
+settings.SETTINGS_MODULE = None
+t = Template('{% url will_not_match %}')
+c = Context()
+try:
+rendered = t.render(c)
+except TemplateSyntaxError, e:
+#Assert that we are getting the template syntax error and not the
+#string encoding error.
+self.assertEquals(e.message, "Caught an exception while rendering: 
Reverse for 'will_not_match' with arguments '()' and keyword arguments '{}' not 
found.")
+settings.SETTINGS_MODULE = old_settings_module
+
 def test_templates(self):
 template_tests = self.get_template_tests()
 filter_tests = filters.get_filter_tests()


--~--~-~--~~~---~--~~
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] r10350 - in django/trunk: django/core/management django/template tests/regressiontests/templates

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 17:46:46 -0500 (Wed, 01 Apr 2009)
New Revision: 10350

Modified:
   django/trunk/django/core/management/__init__.py
   django/trunk/django/template/defaulttags.py
   django/trunk/tests/regressiontests/templates/tests.py
Log:
Fixed #9005: don't wig out when reversing a URL if SETTINGS_MODULE isn't set. 
While I was there, I fixed #10599 by re-raising the original error message, 
which is almost always a better idea. Thanks, Eric

Modified: django/trunk/django/core/management/__init__.py
===
--- django/trunk/django/core/management/__init__.py 2009-04-01 22:35:41 UTC 
(rev 10349)
+++ django/trunk/django/core/management/__init__.py 2009-04-01 22:46:46 UTC 
(rev 10350)
@@ -323,7 +323,7 @@
 else:
 os.environ['DJANGO_SETTINGS_MODULE'] = '%s.%s' % (project_name, 
settings_name)
 
-# Import the project module. We add the parent directory to PYTHONPATH to 
+# Import the project module. We add the parent directory to PYTHONPATH to
 # avoid some of the path errors new users can have.
 sys.path.append(os.path.join(project_directory, os.pardir))
 project_module = import_module(project_name)

Modified: django/trunk/django/template/defaulttags.py
===
--- django/trunk/django/template/defaulttags.py 2009-04-01 22:35:41 UTC (rev 
10349)
+++ django/trunk/django/template/defaulttags.py 2009-04-01 22:46:46 UTC (rev 
10350)
@@ -370,14 +370,21 @@
 url = ''
 try:
 url = reverse(self.view_name, args=args, kwargs=kwargs)
-except NoReverseMatch:
-project_name = settings.SETTINGS_MODULE.split('.')[0]
-try:
-url = reverse(project_name + '.' + self.view_name,
+except NoReverseMatch, e:
+if settings.SETTINGS_MODULE:
+project_name = settings.SETTINGS_MODULE.split('.')[0]
+try:
+url = reverse(project_name + '.' + self.view_name,
   args=args, kwargs=kwargs)
-except NoReverseMatch:
+except NoReverseMatch:
+if self.asvar is None:
+# Re-raise the original exception, not the one with
+# the path relative to the project. This makes a 
+# better error message.
+raise e
+else:
 if self.asvar is None:
-raise
+raise e
 
 if self.asvar:
 context[self.asvar] = url

Modified: django/trunk/tests/regressiontests/templates/tests.py
===
--- django/trunk/tests/regressiontests/templates/tests.py   2009-04-01 
22:35:41 UTC (rev 10349)
+++ django/trunk/tests/regressiontests/templates/tests.py   2009-04-01 
22:46:46 UTC (rev 10350)
@@ -153,6 +153,21 @@
 split = token.split_contents()
 self.assertEqual(split, ["sometag", '_("Page not found")', 
'value|yesno:_("yes,no")'])
 
+def test_url_reverse_no_settings_module(self):
+#Regression test for #9005
+from django.template import Template, Context, TemplateSyntaxError
+old_settings_module = settings.SETTINGS_MODULE
+settings.SETTINGS_MODULE = None
+t = Template('{% url will_not_match %}')
+c = Context()
+try:
+rendered = t.render(c)
+except TemplateSyntaxError, e:
+#Assert that we are getting the template syntax error and not the
+#string encoding error.
+self.assertEquals(e.message, "Caught an exception while rendering: 
Reverse for 'will_not_match' with arguments '()' and keyword arguments '{}' not 
found.")
+settings.SETTINGS_MODULE = old_settings_module
+
 def test_templates(self):
 template_tests = self.get_template_tests()
 filter_tests = filters.get_filter_tests()


--~--~-~--~~~---~--~~
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] #9666: ssi tag don't works with context variables

2009-04-01 Thread Django
#9666: ssi tag don't works with context variables
--+-
  Reporter:  andrews  | Owner:  ericholscher  
Status:  assigned | Milestone:  1.1   
 Component:  Template system  |   Version:  SVN   
Resolution:   |  Keywords:  tag, ssi, template
 Stage:  Accepted | Has_patch:  1 
Needs_docs:  0|   Needs_tests:  1 
Needs_better_patch:  0|  
--+-
Changes (by ericholscher):

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

Comment:

 Note that currently I don't see any tests associated with ssi. I'll work
 on this later, if nobody else wants to.

-- 
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] r10349 - in django/branches/releases/1.0.X: . tests/modeltests/model_formsets tests/regressiontests/inline_formsets

2009-04-01 Thread noreply

Author: jkocherhans
Date: 2009-04-01 17:35:41 -0500 (Wed, 01 Apr 2009)
New Revision: 10349

Added:
   django/branches/releases/1.0.X/tests/modeltests/model_formsets/tests.py
   django/branches/releases/1.0.X/tests/regressiontests/inline_formsets/tests.py
Modified:
   django/branches/releases/1.0.X/
Log:
[1.0.x] Backport of r10348 from trunk, plus missing tests that should have been 
in r10286.



Property changes on: django/branches/releases/1.0.X
___
Name: svnmerge-integrated
   - 
/django/trunk:1-9097,9099-9102,9104-9109,9111,9113-9144,9146-9151,9153-9156,9158-9159,9161-9187,9189-9247,9249-9262,9264-9277,9279-9298,9301-9302,9305-9331,9333-9343,9345,9347,9350-9352,9355-9396,9399-9462,9466-9469,9471-9488,9491-9526,9529,9533-9536,9539-9550,9556-9557,9559-9560,9562-9568,9570-9591,9595-9619,9621-9624,9626-9636,9638-9642,9644-9645,9647-9689,9691-9699,9703-9706,9709-9713,9716-9723,9725-9726,9730-9738,9740-9741,9750-9751,9757-9758,9761-9762,9767-9768,9770-9780,9782-9784,9789-9790,9793-9798,9801-9802,9806-9807,9809-9813,9821-9837,9842-9843,9847-9859,9861,9863-9875,9877-9881,9883-9887,9899-9903,9906-9909,9912,9914,9916-9917,9919-9920,9922-9927,9929,9931-9937,9939,9942-9943,9945-9950,9953-9954,9956-9962,9966-9977,9979-9984,9986-9988,9990,9992,9994,9996-9998,10003,10007,10009,10013,10015,10017,10022,10024,10031,10036-10037,10040,10049,10051,10054-10058,10071,10073-10074,10078,10104,10125,10136,10139,10143,10145-10147,10149-10152,10170,10175,10193,10195-10196,10198-10221,10223-10228,10230-10234,10236-10247,10250-10257,10259-10270,10273-10274,10276-10280,10282-10283,10303-10304,10309,10311,10314,10316,10319
   + 
/django/trunk:1-9097,9099-9102,9104-9109,9111,9113-9144,9146-9151,9153-9156,9158-9159,9161-9187,9189-9247,9249-9262,9264-9277,9279-9298,9301-9302,9305-9331,9333-9343,9345,9347,9350-9352,9355-9396,9399-9462,9466-9469,9471-9488,9491-9526,9529,9533-9536,9539-9550,9556-9557,9559-9560,9562-9568,9570-9591,9595-9619,9621-9624,9626-9636,9638-9642,9644-9645,9647-9689,9691-9699,9703-9706,9709-9713,9716-9723,9725-9726,9730-9738,9740-9741,9750-9751,9757-9758,9761-9762,9767-9768,9770-9780,9782-9784,9789-9790,9793-9798,9801-9802,9806-9807,9809-9813,9821-9837,9842-9843,9847-9859,9861,9863-9875,9877-9881,9883-9887,9899-9903,9906-9909,9912,9914,9916-9917,9919-9920,9922-9927,9929,9931-9937,9939,9942-9943,9945-9950,9953-9954,9956-9962,9966-9977,9979-9984,9986-9988,9990,9992,9994,9996-9998,10003,10007,10009,10013,10015,10017,10022,10024,10031,10036-10037,10040,10049,10051,10054-10058,10071,10073-10074,10078,10104,10125,10136,10139,10143,10145-10147,10149-10152,10170,10175,10193,10195-10196,10198-10221,10223-10228,10230-10234,10236-10247,10250-10257,10259-10270,10273-10274,10276-10280,10282-10283,10303-10304,10309,10311,10314,10316,10319,10348

Added: django/branches/releases/1.0.X/tests/modeltests/model_formsets/tests.py
===
--- django/branches/releases/1.0.X/tests/modeltests/model_formsets/tests.py 
(rev 0)
+++ django/branches/releases/1.0.X/tests/modeltests/model_formsets/tests.py 
2009-04-01 22:35:41 UTC (rev 10349)
@@ -0,0 +1,70 @@
+from django.test import TestCase
+from django.forms.models import modelformset_factory
+from modeltests.model_formsets.models import Poet, Poem
+
+class DeletionTests(TestCase):
+def test_deletion(self):
+PoetFormSet = modelformset_factory(Poet, can_delete=True)
+poet = Poet.objects.create(name='test')
+data = {
+'form-TOTAL_FORMS': u'1',
+'form-INITIAL_FORMS': u'1',
+'form-0-id': str(poet.pk),
+'form-0-name': u'test',
+'form-0-DELETE': u'on',
+}
+formset = PoetFormSet(data, queryset=Poet.objects.all())
+formset.save()
+self.assertTrue(formset.is_valid())
+self.assertEqual(Poet.objects.count(), 0)
+
+def test_add_form_deletion_when_invalid(self):
+"""
+Make sure that an add form that is filled out, but marked for deletion
+doesn't cause validation errors.
+"""
+PoetFormSet = modelformset_factory(Poet, can_delete=True)
+data = {
+'form-TOTAL_FORMS': u'1',
+'form-INITIAL_FORMS': u'0',
+'form-0-id': u'',
+'form-0-name': u'x' * 1000,
+}
+formset = PoetFormSet(data, queryset=Poet.objects.all())
+# Make sure this form doesn't pass validation.
+self.assertEqual(formset.is_valid(), False)
+self.assertEqual(Poet.objects.count(), 0)
+
+# Then make sure that it *does* pass validation and delete the object,
+# even though the data isn't actually valid.
+data['form-0-DELETE'] = 'on'
+formset = PoetFormSet(data, queryset=Poet.objects.all())
+self.assertEqual(formset.is_valid(), True)
+formset.save()
+

Re: [Django] #10674: Arabic translation update

2009-04-01 Thread Django
#10674: Arabic translation update
---+
  Reporter:  okhayat   | Owner:  nobody
Status:  new   | Milestone:  1.1   
 Component:  Translations  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by Alex):

  * 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] #10043: widthratio tag does not accept a variable as the max_width argument

2009-04-01 Thread Django
#10043: widthratio tag does not accept a variable as the max_width argument
+---
  Reporter:  obeattie   | Owner:  nobody
Status:  new| Milestone:  1.1   
 Component:  Template system|   Version:  1.0   
Resolution: |  Keywords:  widthratio
 Stage:  Ready for checkin  | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Comment (by ericholscher):

 Note that I changed widthratio10 from a test to a working implementation.
 It is now possible to pass a float to the max_width argument instead of it
 failing on floats.

 I talked to Jacob and Brian about this and they said it made sense.

-- 
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] #10043: widthratio tag does not accept a variable as the max_width argument

2009-04-01 Thread Django
#10043: widthratio tag does not accept a variable as the max_width argument
+---
  Reporter:  obeattie   | Owner:  nobody
Status:  new| Milestone:  1.1   
 Component:  Template system|   Version:  1.0   
Resolution: |  Keywords:  widthratio
 Stage:  Ready for checkin  | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by Alex):

  * stage:  Accepted => Ready for checkin

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



Re: [Django] #10674: Arabic translation update

2009-04-01 Thread Django
#10674: Arabic translation update
---+
  Reporter:  okhayat   | Owner:  nobody
Status:  new   | Milestone:  1.1   
 Component:  Translations  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by okhayat):

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

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



[Changeset] r10348 - in django/trunk/tests: modeltests/model_formsets regressiontests/inline_formsets

2009-04-01 Thread noreply

Author: jkocherhans
Date: 2009-04-01 17:16:34 -0500 (Wed, 01 Apr 2009)
New Revision: 10348

Modified:
   django/trunk/tests/modeltests/model_formsets/tests.py
   django/trunk/tests/regressiontests/inline_formsets/tests.py
Log:
Fixed some silly assumptions about pk's that broke the test suite under 
postgresql.

Modified: django/trunk/tests/modeltests/model_formsets/tests.py
===
--- django/trunk/tests/modeltests/model_formsets/tests.py   2009-04-01 
21:58:38 UTC (rev 10347)
+++ django/trunk/tests/modeltests/model_formsets/tests.py   2009-04-01 
22:16:34 UTC (rev 10348)
@@ -9,7 +9,7 @@
 data = {
 'form-TOTAL_FORMS': u'1',
 'form-INITIAL_FORMS': u'1',
-'form-0-id': u'1',
+'form-0-id': str(poet.pk),
 'form-0-name': u'test',
 'form-0-DELETE': u'on',
 }

Modified: django/trunk/tests/regressiontests/inline_formsets/tests.py
===
--- django/trunk/tests/regressiontests/inline_formsets/tests.py 2009-04-01 
21:58:38 UTC (rev 10347)
+++ django/trunk/tests/regressiontests/inline_formsets/tests.py 2009-04-01 
22:16:34 UTC (rev 10348)
@@ -6,12 +6,12 @@
 def test_deletion(self):
 PoemFormSet = inlineformset_factory(Poet, Poem, can_delete=True)
 poet = Poet.objects.create(name='test')
-poet.poem_set.create(name='test poem')
+poem = poet.poem_set.create(name='test poem')
 data = {
 'poem_set-TOTAL_FORMS': u'1',
 'poem_set-INITIAL_FORMS': u'1',
-'poem_set-0-id': u'1',
-'poem_set-0-poem': u'1',
+'poem_set-0-id': str(poem.pk),
+'poem_set-0-poet': str(poet.pk),
 'poem_set-0-name': u'test',
 'poem_set-0-DELETE': u'on',
 }


--~--~-~--~~~---~--~~
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] #5691: Add the active language to generate the cache key

2009-04-01 Thread Django
#5691: Add the active language to generate the cache key
-+--
  Reporter:  aa...@apsl.net  | Owner:  aaloy
Status:  assigned| Milestone:   
 Component:  Cache system|   Version:  SVN  
Resolution:  |  Keywords:  cache i18n jgd-blackboard
 Stage:  Accepted| Has_patch:  1
Needs_docs:  0   |   Needs_tests:  0
Needs_better_patch:  0   |  
-+--
Comment (by ramiro):

 I've updated Antoni Aloy's patch to apply cleanly after r10335 and
 simplified tests to only include what's needed to run them as part of the
 Django test suite, also fixed them so they don't break other tests leaving
 test environment umodified.

-- 
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] #9847: hardcoded string in core/handlers/base.py

2009-04-01 Thread Django
#9847: hardcoded string in core/handlers/base.py
-+--
  Reporter:  drakkan | Owner:  kgrandis
Status:  reopened| Milestone:  1.1 
 Component:  Core framework  |   Version:  1.0 
Resolution:  |  Keywords:  
 Stage:  Accepted| Has_patch:  1   
Needs_docs:  0   |   Needs_tests:  0   
Needs_better_patch:  0   |  
-+--
Changes (by jacob):

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

Comment:

 Reopening - the fix was a bad idea; see [10347].

-- 
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] r10347 - django/trunk/django/core/handlers

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 16:58:38 -0500 (Wed, 01 Apr 2009)
New Revision: 10347

Modified:
   django/trunk/django/core/handlers/base.py
Log:
Reverted [10346] because it effectively breaks USE_I18N by forcing import of 
translation before settings are ready.

Modified: django/trunk/django/core/handlers/base.py
===
--- django/trunk/django/core/handlers/base.py   2009-04-01 21:46:42 UTC (rev 
10346)
+++ django/trunk/django/core/handlers/base.py   2009-04-01 21:58:38 UTC (rev 
10347)
@@ -4,7 +4,6 @@
 from django.core import signals
 from django.utils.encoding import force_unicode
 from django.utils.importlib import import_module
-from django.utils.translation import ugettext_lazy as _
 
 class BaseHandler(object):
 # Changes that are always applied to a response (in this order).
@@ -124,7 +123,7 @@
 finally:
 receivers = 
signals.got_request_exception.send(sender=self.__class__, request=request)
 except exceptions.PermissionDenied:
-return http.HttpResponseForbidden('%s' % _("Permission 
denied"))
+return http.HttpResponseForbidden('Permission denied')
 except SystemExit:
 # Allow sys.exit() to actually exit. See tickets #1023 and #4701
 raise


--~--~-~--~~~---~--~~
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] r10346 - django/trunk/django/core/handlers

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 16:46:42 -0500 (Wed, 01 Apr 2009)
New Revision: 10346

Modified:
   django/trunk/django/core/handlers/base.py
Log:
Fixed #9847: mark the permission denied message for translation.

Modified: django/trunk/django/core/handlers/base.py
===
--- django/trunk/django/core/handlers/base.py   2009-04-01 21:37:34 UTC (rev 
10345)
+++ django/trunk/django/core/handlers/base.py   2009-04-01 21:46:42 UTC (rev 
10346)
@@ -4,6 +4,7 @@
 from django.core import signals
 from django.utils.encoding import force_unicode
 from django.utils.importlib import import_module
+from django.utils.translation import ugettext_lazy as _
 
 class BaseHandler(object):
 # Changes that are always applied to a response (in this order).
@@ -123,7 +124,7 @@
 finally:
 receivers = 
signals.got_request_exception.send(sender=self.__class__, request=request)
 except exceptions.PermissionDenied:
-return http.HttpResponseForbidden('Permission denied')
+return http.HttpResponseForbidden('%s' % _("Permission 
denied"))
 except SystemExit:
 # Allow sys.exit() to actually exit. See tickets #1023 and #4701
 raise


--~--~-~--~~~---~--~~
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] r10345 - django/trunk/django/core/servers

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 16:37:34 -0500 (Wed, 01 Apr 2009)
New Revision: 10345

Modified:
   django/trunk/django/core/servers/fastcgi.py
Log:
Fixed #8895: expose the debug setting to fastcgi. Thanks, paulegan.

Modified: django/trunk/django/core/servers/fastcgi.py
===
--- django/trunk/django/core/servers/fastcgi.py 2009-04-01 21:35:00 UTC (rev 
10344)
+++ django/trunk/django/core/servers/fastcgi.py 2009-04-01 21:37:34 UTC (rev 
10345)
@@ -39,6 +39,7 @@
   daemonize=BOOL   whether to detach from terminal.
   pidfile=FILE write the spawned process-id to this file.
   workdir=DIRECTORYchange to this directory when daemonizing.
+  debug=BOOL   set to true to enable flup tracebacks
   outlog=FILE  write stdout to this file.
   errlog=FILE  write stderr to this file.
   umask=UMASK  umask to use when daemonizing (default 022).
@@ -73,6 +74,7 @@
 'minspare': 2,
 'maxchildren': 50,
 'maxrequests': 0,
+'debug': None,
 'outlog': None,
 'errlog': None,
 'umask': None,
@@ -126,7 +128,7 @@
 else:
 return fastcgi_help("ERROR: Implementation must be one of prefork or 
thread.")
 
-wsgi_opts['debug'] = False # Turn off flup tracebacks
+wsgi_opts['debug'] = options['debug'] is not None
 
 try:
 module = importlib.import_module('.%s' % flup_module, 'flup')


--~--~-~--~~~---~--~~
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] r10344 - django/branches/releases/1.0.X/django/contrib/admindocs/templates/admin_doc

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 16:35:00 -0500 (Wed, 01 Apr 2009)
New Revision: 10344

Modified:
   
django/branches/releases/1.0.X/django/contrib/admindocs/templates/admin_doc/model_index.html
Log:
[1.0.X] Fixed #10538: use a prefix for HTML ids on the admin doc page to avoid 
conflicts with existing elements. Thanks, Justin Lilly. Backport of r10343 from 
trunk.

Modified: 
django/branches/releases/1.0.X/django/contrib/admindocs/templates/admin_doc/model_index.html
===
--- 
django/branches/releases/1.0.X/django/contrib/admindocs/templates/admin_doc/model_index.html
2009-04-01 21:33:22 UTC (rev 10343)
+++ 
django/branches/releases/1.0.X/django/contrib/admindocs/templates/admin_doc/model_index.html
2009-04-01 21:35:00 UTC (rev 10344)
@@ -14,7 +14,7 @@
 
 {% for group in grouped_models %}
 
-{{ group.grouper|capfirst }}
+{{ group.grouper|capfirst }}
 
 
 {% for model in group.list %}


--~--~-~--~~~---~--~~
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] r10343 - django/trunk/django/contrib/admindocs/templates/admin_doc

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 16:33:22 -0500 (Wed, 01 Apr 2009)
New Revision: 10343

Modified:
   django/trunk/django/contrib/admindocs/templates/admin_doc/model_index.html
Log:
Fixed #10538: use a prefix for HTML ids on the admin doc page to avoid 
conflicts with existing elements. Thanks, Justin Lilly.

Modified: 
django/trunk/django/contrib/admindocs/templates/admin_doc/model_index.html
===
--- django/trunk/django/contrib/admindocs/templates/admin_doc/model_index.html  
2009-04-01 21:26:55 UTC (rev 10342)
+++ django/trunk/django/contrib/admindocs/templates/admin_doc/model_index.html  
2009-04-01 21:33:22 UTC (rev 10343)
@@ -14,7 +14,7 @@
 
 {% for group in grouped_models %}
 
-{{ group.grouper|capfirst }}
+{{ group.grouper|capfirst }}
 
 
 {% for model in group.list %}


--~--~-~--~~~---~--~~
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] #9356: CSRFMiddleware should take session key from request.session

2009-04-01 Thread Django
#9356: CSRFMiddleware should take session key from request.session
---+
  Reporter:  bthomas   | Owner:  nobody
Status:  new   | Milestone:  1.1   
 Component:  Contrib apps  |   Version:  1.0   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  1 
Needs_better_patch:  1 |  
---+
Comment (by jacob):

 Ah, OK, I'd remembered the discussion but not the conclusion. Thanks.

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



Re: [Django] #10053: Incorrect pydoc in django.template.loaders.app_directories.load_template_source

2009-04-01 Thread Django
#10053: Incorrect pydoc in
django.template.loaders.app_directories.load_template_source
+---
  Reporter:  kylev  | Owner:  nobody
Status:  new| Milestone:  1.1   
 Component:  Documentation  |   Version:  1.0   
Resolution: |  Keywords:
 Stage:  Ready for checkin  | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by ericholscher):

  * component:  Template system => Documentation
  * stage:  Accepted => Ready for checkin

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



[Changeset] r10342 - in django/branches/releases/1.0.X/django/contrib/auth: . tests

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 16:26:55 -0500 (Wed, 01 Apr 2009)
New Revision: 10342

Modified:
   django/branches/releases/1.0.X/django/contrib/auth/tests/tokens.py
   django/branches/releases/1.0.X/django/contrib/auth/tokens.py
Log:
[1.0.X] Fixed #10265: fixed a bug when generating a password reset token for a 
user created on the same request. Thanks, crucialfelix. Backport of r10341 from 
trunk.

Modified: django/branches/releases/1.0.X/django/contrib/auth/tests/tokens.py
===
--- django/branches/releases/1.0.X/django/contrib/auth/tests/tokens.py  
2009-04-01 21:25:24 UTC (rev 10341)
+++ django/branches/releases/1.0.X/django/contrib/auth/tests/tokens.py  
2009-04-01 21:26:55 UTC (rev 10342)
@@ -8,6 +8,14 @@
 >>> p0.check_token(u, tk1)
 True
 
+>>> u = User.objects.create_user('comebackkid', 'te...@example.com', 'testpw')
+>>> p0 = PasswordResetTokenGenerator()
+>>> tk1 = p0.make_token(u)
+>>> reload = User.objects.get(username='comebackkid')
+>>> tk2 = p0.make_token(reload)
+>>> tk1 == tk2
+True
+
 Tests to ensure we can use the token after n days, but no greater.
 Use a mocked version of PasswordResetTokenGenerator so we can change
 the value of 'today'

Modified: django/branches/releases/1.0.X/django/contrib/auth/tokens.py
===
--- django/branches/releases/1.0.X/django/contrib/auth/tokens.py
2009-04-01 21:25:24 UTC (rev 10341)
+++ django/branches/releases/1.0.X/django/contrib/auth/tokens.py
2009-04-01 21:26:55 UTC (rev 10342)
@@ -52,7 +52,7 @@
 # We limit the hash to 20 chars to keep URL short
 from django.utils.hashcompat import sha_constructor
 hash = sha_constructor(settings.SECRET_KEY + unicode(user.id) +
-   user.password + unicode(user.last_login) +
+   user.password + 
user.last_login.strftime('%Y-%m-%d %H:%M:%S') +
unicode(timestamp)).hexdigest()[::2]
 return "%s-%s" % (ts_b36, hash)
 


--~--~-~--~~~---~--~~
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] r10341 - in django/trunk/django/contrib/auth: . tests

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 16:25:24 -0500 (Wed, 01 Apr 2009)
New Revision: 10341

Modified:
   django/trunk/django/contrib/auth/tests/tokens.py
   django/trunk/django/contrib/auth/tokens.py
Log:
Fixed #10265: fixed a bug when generating a password reset token for a user 
created on the same request. Thanks, crucialfelix.

Modified: django/trunk/django/contrib/auth/tests/tokens.py
===
--- django/trunk/django/contrib/auth/tests/tokens.py2009-04-01 21:17:54 UTC 
(rev 10340)
+++ django/trunk/django/contrib/auth/tests/tokens.py2009-04-01 21:25:24 UTC 
(rev 10341)
@@ -8,6 +8,14 @@
 >>> p0.check_token(u, tk1)
 True
 
+>>> u = User.objects.create_user('comebackkid', 'te...@example.com', 'testpw')
+>>> p0 = PasswordResetTokenGenerator()
+>>> tk1 = p0.make_token(u)
+>>> reload = User.objects.get(username='comebackkid')
+>>> tk2 = p0.make_token(reload)
+>>> tk1 == tk2
+True
+
 Tests to ensure we can use the token after n days, but no greater.
 Use a mocked version of PasswordResetTokenGenerator so we can change
 the value of 'today'

Modified: django/trunk/django/contrib/auth/tokens.py
===
--- django/trunk/django/contrib/auth/tokens.py  2009-04-01 21:17:54 UTC (rev 
10340)
+++ django/trunk/django/contrib/auth/tokens.py  2009-04-01 21:25:24 UTC (rev 
10341)
@@ -52,7 +52,7 @@
 # We limit the hash to 20 chars to keep URL short
 from django.utils.hashcompat import sha_constructor
 hash = sha_constructor(settings.SECRET_KEY + unicode(user.id) +
-   user.password + unicode(user.last_login) +
+   user.password + 
user.last_login.strftime('%Y-%m-%d %H:%M:%S') +
unicode(timestamp)).hexdigest()[::2]
 return "%s-%s" % (ts_b36, hash)
 


--~--~-~--~~~---~--~~
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] r10340 - in django/branches/releases/1.0.X: django/contrib/admin django/contrib/admin/templatetags tests/regressiontests/admin_views tests/regressiontests/admin_views/fixtures

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 16:17:54 -0500 (Wed, 01 Apr 2009)
New Revision: 10340

Added:
   
django/branches/releases/1.0.X/tests/regressiontests/admin_views/fixtures/admin-views-fabrics.xml
Modified:
   django/branches/releases/1.0.X/django/contrib/admin/filterspecs.py
   
django/branches/releases/1.0.X/django/contrib/admin/templatetags/admin_list.py
   django/branches/releases/1.0.X/tests/regressiontests/admin_views/models.py
   django/branches/releases/1.0.X/tests/regressiontests/admin_views/tests.py
Log:
[1.0.X] Fixed #9969: choices with options groups (added in [7977]) now work 
correctly in the admin with list_display and list_filter. Thanks, ramiro. 
Backport of r10318 from trunk; thanks, cramm.

Modified: django/branches/releases/1.0.X/django/contrib/admin/filterspecs.py
===
--- django/branches/releases/1.0.X/django/contrib/admin/filterspecs.py  
2009-04-01 18:46:17 UTC (rev 10339)
+++ django/branches/releases/1.0.X/django/contrib/admin/filterspecs.py  
2009-04-01 21:17:54 UTC (rev 10340)
@@ -90,7 +90,7 @@
 yield {'selected': self.lookup_val is None,
'query_string': cl.get_query_string({}, [self.lookup_kwarg]),
'display': _('All')}
-for k, v in self.field.choices:
+for k, v in self.field.flatchoices:
 yield {'selected': smart_unicode(k) == self.lookup_val,
 'query_string': cl.get_query_string({self.lookup_kwarg: 
k}),
 'display': v}

Modified: 
django/branches/releases/1.0.X/django/contrib/admin/templatetags/admin_list.py
===
--- 
django/branches/releases/1.0.X/django/contrib/admin/templatetags/admin_list.py  
2009-04-01 18:46:17 UTC (rev 10339)
+++ 
django/branches/releases/1.0.X/django/contrib/admin/templatetags/admin_list.py  
2009-04-01 21:17:54 UTC (rev 10340)
@@ -205,8 +205,8 @@
 result_repr = EMPTY_CHANGELIST_VALUE
 # Fields with choices are special: Use the representation
 # of the choice.
-elif f.choices:
-result_repr = dict(f.choices).get(field_val, 
EMPTY_CHANGELIST_VALUE)
+elif f.flatchoices:
+result_repr = dict(f.flatchoices).get(field_val, 
EMPTY_CHANGELIST_VALUE)
 else:
 result_repr = escape(field_val)
 if force_unicode(result_repr) == '':

Added: 
django/branches/releases/1.0.X/tests/regressiontests/admin_views/fixtures/admin-views-fabrics.xml
===
--- 
django/branches/releases/1.0.X/tests/regressiontests/admin_views/fixtures/admin-views-fabrics.xml
   (rev 0)
+++ 
django/branches/releases/1.0.X/tests/regressiontests/admin_views/fixtures/admin-views-fabrics.xml
   2009-04-01 21:17:54 UTC (rev 10340)
@@ -0,0 +1,12 @@
+
+
+  
+x
+  
+  
+y
+  
+  
+plain
+  
+

Modified: 
django/branches/releases/1.0.X/tests/regressiontests/admin_views/models.py
===
--- django/branches/releases/1.0.X/tests/regressiontests/admin_views/models.py  
2009-04-01 18:46:17 UTC (rev 10339)
+++ django/branches/releases/1.0.X/tests/regressiontests/admin_views/models.py  
2009-04-01 21:17:54 UTC (rev 10340)
@@ -134,6 +134,21 @@
 class ThingAdmin(admin.ModelAdmin):
 list_filter = ('color',)
 
+class Fabric(models.Model):
+NG_CHOICES = (
+('Textured', (
+('x', 'Horizontal'),
+('y', 'Vertical'),
+)
+),
+('plain', 'Smooth'),
+)
+surface = models.CharField(max_length=20, choices=NG_CHOICES)
+
+class FabricAdmin(admin.ModelAdmin):
+list_display = ('surface',)
+list_filter = ('surface',)
+
 class Persona(models.Model):
 """
 A simple persona associated with accounts, to test inlining of related
@@ -208,6 +223,7 @@
 admin.site.register(Persona, PersonaAdmin)
 admin.site.register(Parent, ParentAdmin)
 admin.site.register(EmptyModel, EmptyModelAdmin)
+admin.site.register(Fabric, FabricAdmin)
 
 # We intentionally register Promo and ChapterXtra1 but not Chapter nor 
ChapterXtra2.
 # That way we cover all four cases:

Modified: 
django/branches/releases/1.0.X/tests/regressiontests/admin_views/tests.py
===
--- django/branches/releases/1.0.X/tests/regressiontests/admin_views/tests.py   
2009-04-01 18:46:17 UTC (rev 10339)
+++ django/branches/releases/1.0.X/tests/regressiontests/admin_views/tests.py   
2009-04-01 21:17:54 UTC (rev 10340)
@@ -19,7 +19,7 @@
 from sets import Set as set
 
 class AdminViewBasicTest(TestCase):
-fixtures = ['admin-views-users.xml', 'admin-views-colors.xml']
+fixtures = ['admin-views-users.xml', 'admin-views-colors.xml', 
'admin-views-fabrics.xml']
 
 def setUp(self):
 

Re: [Django] #5176: Bug in django.utils.cache._generate_cache_key(request, headerlist, key_prefix)

2009-04-01 Thread Django
#5176: Bug in django.utils.cache._generate_cache_key(request, headerlist,
key_prefix)
---+
  Reporter:  Eratothene| Owner:  nobody   
Status:  reopened  | Milestone:   
 Component:  Cache system  |   Version:  SVN  
Resolution:|  Keywords:  cache session
 Stage:  Accepted  | Has_patch:  1
Needs_docs:  0 |   Needs_tests:  1
Needs_better_patch:  1 |  
---+
Comment (by jki):

 Situation that "01/23/09 07:20:19 changed by jcharpentier" describes may
 happen when default cache interval (CACHE_MIDDLEWARE_SECONDS) in
 settings.py > 0:

 What happens:

 1) "test_confirm_invalid" is performed first- response (for invalid
 password reset link) is generated and cached for
 django.contrib.auth.views.password_reset_confirm

 2) "test_confirm_valid" runs after "test_confirm_invalid" and gets the
 cached response for django.contrib.auth.views.password_reset_confirm, so
 test fails

-- 
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] #5691: Add the active language to generate the cache key

2009-04-01 Thread Django
#5691: Add the active language to generate the cache key
-+--
  Reporter:  aa...@apsl.net  | Owner:  aaloy
Status:  assigned| Milestone:   
 Component:  Cache system|   Version:  SVN  
Resolution:  |  Keywords:  cache i18n jgd-blackboard
 Stage:  Accepted| Has_patch:  1
Needs_docs:  0   |   Needs_tests:  0
Needs_better_patch:  0   |  
-+--
Comment (by mrts):

 /me wonders how the heck did my totally unrelated comments end up in this
 ticket!? My guess: nazi transgender aliens did it (it's still April 1 in
 my timezone, so don't you dare to disagree!).

-- 
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] #10183: assertContains fails when there is unicode in the response content

2009-04-01 Thread Django
#10183: assertContains fails when there is unicode in the response content
+---
  Reporter:  drakonen   | Owner:  nobody
  
Status:  closed | Milestone:  1.1   
  
 Component:  Testing framework  |   Version:  1.0   
  
Resolution:  invalid|  Keywords:  testcases, 
assertContains, assertNotContains
 Stage:  Accepted   | Has_patch:  1 
  
Needs_docs:  0  |   Needs_tests:  0 
  
Needs_better_patch:  0  |  
+---
Changes (by ericholscher):

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

Comment:

 I couldn't reproduce this. I have attached a test case to Django that
 passes. If you can make one that fails, please attach it to the case and
 reopen the ticket.

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



Re: [Django] #10695: defer() uses the same cached value for all models

2009-04-01 Thread Django
#10695: defer() uses the same cached value for all models
---+
  Reporter:  jbronn| Owner:  mtreddinick
Status:  new   | Milestone:  1.1
 Component:  Database layer (models, ORM)  |   Version:  SVN
Resolution:|  Keywords:  defer qs   
 Stage:  Accepted  | Has_patch:  1  
Needs_docs:  0 |   Needs_tests:  0  
Needs_better_patch:  0 |  
---+
Comment (by Alex):

 An alternate approach would be to put the pk in the class name, however
 that would mean creating O(n) classes, which strikes me as silly and
 wasteful of memory, given that this  approach works.

-- 
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] #9356: CSRFMiddleware should take session key from request.session

2009-04-01 Thread Django
#9356: CSRFMiddleware should take session key from request.session
---+
  Reporter:  bthomas   | Owner:  nobody
Status:  new   | Milestone:  1.1   
 Component:  Contrib apps  |   Version:  1.0   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  1 
Needs_better_patch:  1 |  
---+
Changes (by bthomas):

  * needs_better_patch:  0 => 1
  * needs_tests:  0 => 1
  * stage:  Design decision needed => Accepted

Comment:

 The reasoning behind this was discussed in more detail on #9977, and the
 patch on that ticket includes the fix for this. Since #9977 is not going
 to be included in 1.1 (and possibly not ever), either myself or Luke need
 to make a better patch for this bug based on his improved fix in the #9977
 patch.

 Also needs tests.

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



Re: [Django] #10695: defer() uses the same cached value for all models

2009-04-01 Thread Django
#10695: defer() uses the same cached value for all models
---+
  Reporter:  jbronn| Owner:  mtreddinick
Status:  new   | Milestone:  1.1
 Component:  Database layer (models, ORM)  |   Version:  SVN
Resolution:|  Keywords:  defer qs   
 Stage:  Accepted  | Has_patch:  1  
Needs_docs:  0 |   Needs_tests:  0  
Needs_better_patch:  0 |  
---+
Changes (by Alex):

  * has_patch:  0 => 1

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



Re: [Django] #10695: defer() uses the same cached value for all models

2009-04-01 Thread Django
#10695: defer() uses the same cached value for all models
---+
  Reporter:  jbronn| Owner:  mtreddinick
Status:  new   | Milestone:  1.1
 Component:  Database layer (models, ORM)  |   Version:  SVN
Resolution:|  Keywords:  defer qs   
 Stage:  Accepted  | Has_patch:  0  
Needs_docs:  0 |   Needs_tests:  0  
Needs_better_patch:  0 |  
---+
Changes (by Alex):

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

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-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] #10696: manage.py throws away exception information

2009-04-01 Thread Django
#10696: manage.py throws away exception information
+---
 Reporter:  Leo |   Owner:  nobody
   Status:  new |   Milestone:
Component:  Core framework  | Version:  SVN   
 Keywords:  |   Stage:  Unreviewed
Has_patch:  0   |  
+---
 When an ImportError occurs in manage.py, the exception is caught and
 stored in a variable - e, but that data isn't used in the error message at
 all.

 Because settings.py is a python file, there could be a variety of issues
 that come up and its useful to see what the actual underlying error is. In
 my usecase, I have the line
 {{{
 from settings_local import *
 }}}
 at the end of the main settings.py file. If settings_local.py doesn't
 exist, then an import error gets thrown but the exception handling in
 manage.py swallows it. It would be great to add something like:
 {{{
 sys.stderr.write(e.message + '\n')
 }}}
 to manage.py to surface the actual error that's occurring.

-- 
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] #10146: Support for contrib/markdown extension_configs in settings.py

2009-04-01 Thread Django
#10146: Support for contrib/markdown extension_configs in settings.py
---+
  Reporter:  bdejong   | Owner:  nobody 
 
Status:  new   | Milestone:  1.2
 
 Component:  Contrib apps  |   Version:  SVN
 
Resolution:|  Keywords:  markdown config extensions 
extension_configs
 Stage:  Accepted  | Has_patch:  1  
 
Needs_docs:  0 |   Needs_tests:  0  
 
Needs_better_patch:  0 |  
---+
Changes (by jacob):

  * milestone:  1.1 => 1.2

Comment:

 This is a feature add -- bump to 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-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] #9356: CSRFMiddleware should take session key from request.session

2009-04-01 Thread Django
#9356: CSRFMiddleware should take session key from request.session
-+--
  Reporter:  bthomas | Owner:  nobody
Status:  new | Milestone:  1.1   
 Component:  Contrib apps|   Version:  1.0   
Resolution:  |  Keywords:
 Stage:  Design decision needed  | Has_patch:  1 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Changes (by jacob):

  * stage:  Accepted => Design decision needed

Comment:

 I actually think there's a good reason for this, but I can't recall why
 right now. So bumping back to DDN in case someone else can confirm if I'm
 right or mistaken.

-- 
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] r10339 - django/branches/releases/1.0.X/django/contrib/admindocs

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 13:46:17 -0500 (Wed, 01 Apr 2009)
New Revision: 10339

Modified:
   django/branches/releases/1.0.X/django/contrib/admindocs/views.py
Log:
[1.0.X] Fixed #8889: make admindocs function view work with class-based views. 
Backport of r10337-r10338 from trunk.

Modified: django/branches/releases/1.0.X/django/contrib/admindocs/views.py
===
--- django/branches/releases/1.0.X/django/contrib/admindocs/views.py
2009-04-01 18:44:25 UTC (rev 10338)
+++ django/branches/releases/1.0.X/django/contrib/admindocs/views.py
2009-04-01 18:46:17 UTC (rev 10339)
@@ -128,7 +128,7 @@
 site_obj = GenericSite()
 for (func, regex) in view_functions:
 views.append({
-'name': func.__name__,
+'name': getattr(func, '__name__', func.__class__.__name__),
 'module': func.__module__,
 'site_id': settings_mod.SITE_ID,
 'site': site_obj,


--~--~-~--~~~---~--~~
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] r10338 - django/trunk/django/contrib/admindocs

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 13:44:25 -0500 (Wed, 01 Apr 2009)
New Revision: 10338

Modified:
   django/trunk/django/contrib/admindocs/views.py
Log:
Do [10337] correctly; thanks, Alex.

Modified: django/trunk/django/contrib/admindocs/views.py
===
--- django/trunk/django/contrib/admindocs/views.py  2009-04-01 18:34:31 UTC 
(rev 10337)
+++ django/trunk/django/contrib/admindocs/views.py  2009-04-01 18:44:25 UTC 
(rev 10338)
@@ -129,7 +129,7 @@
 site_obj = GenericSite()
 for (func, regex) in view_functions:
 views.append({
-'name': hasattr(func, '__class__') and func.__class__.__name__ 
or func.__name__,
+'name': getattr(func, '__name__', func.__class__.__name__),
 'module': func.__module__,
 'site_id': settings_mod.SITE_ID,
 'site': site_obj,


--~--~-~--~~~---~--~~
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] #7437: SelectDateWidget is not documented

2009-04-01 Thread Django
#7437: SelectDateWidget is not documented
+---
  Reporter:  Beetle_B   | Owner:  nobody
Status:  reopened   | Milestone:
 Component:  Documentation  |   Version:  SVN   
Resolution: |  Keywords:
 Stage:  Accepted   | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by timo):

  * needs_docs:  1 => 0

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



Re: [Django] #5253: serializer for csv format for loaddata and dumpdata

2009-04-01 Thread Django
#5253: serializer for csv format for loaddata and dumpdata
+---
  Reporter:  Adam Schmideg   | Owner:  
nobody
Status:  new| Milestone:

 Component:  Serialization  |   Version:  SVN   

Resolution: |  Keywords:  csv, 
foreign keys, feature
 Stage:  Accepted   | Has_patch:  1 

Needs_docs:  1  |   Needs_tests:  1 

Needs_better_patch:  1  |  
+---
Changes (by Mnewman):

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

Comment:

 Backing out of this. Sorry.

-- 
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] #6674: Missing widget documentation

2009-04-01 Thread Django
#6674: Missing widget documentation
+---
  Reporter:  Karen Tracey   | Owner:  
holdenweb
Status:  new| Milestone:
   
 Component:  Documentation  |   Version:  SVN   
   
Resolution: |  Keywords:
   
 Stage:  Accepted   | Has_patch:  1 
   
Needs_docs:  0  |   Needs_tests:  0 
   
Needs_better_patch:  0  |  
+---
Changes (by timo):

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

Comment:

 forma parameter in DateTimeInput has already been documented

-- 
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] #9651: [9297] breaks save_as in inline admin forms

2009-04-01 Thread Django
#9651: [9297] breaks save_as in inline admin forms
---+
  Reporter:  yamad | Owner:  nobody
Status:  new   | Milestone:  1.1   
 Component:  django.contrib.admin  |   Version:
Resolution:|  Keywords:
 Stage:  Ready for checkin | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by Mnewman):

  * stage:  Accepted => Ready for checkin

Comment:

 This patch looks good as is. Tests pass and make sense, also working on
 site. Just updating to current trunk and marking 'ready for checkin'

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



[Changeset] r10337 - django/trunk/django/contrib/admindocs

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 13:34:31 -0500 (Wed, 01 Apr 2009)
New Revision: 10337

Modified:
   django/trunk/django/contrib/admindocs/views.py
Log:
Fixed #8889: make admindocs function view work with class-based views.

Modified: django/trunk/django/contrib/admindocs/views.py
===
--- django/trunk/django/contrib/admindocs/views.py  2009-04-01 18:20:53 UTC 
(rev 10336)
+++ django/trunk/django/contrib/admindocs/views.py  2009-04-01 18:34:31 UTC 
(rev 10337)
@@ -129,7 +129,7 @@
 site_obj = GenericSite()
 for (func, regex) in view_functions:
 views.append({
-'name': func.__name__,
+'name': hasattr(func, '__class__') and func.__class__.__name__ 
or func.__name__,
 'module': func.__module__,
 'site_id': settings_mod.SITE_ID,
 'site': site_obj,


--~--~-~--~~~---~--~~
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] #9005: url templatetag incorrectly assumes settings.SETTINGS_MODULE is not set to None

2009-04-01 Thread Django
#9005: url templatetag incorrectly assumes settings.SETTINGS_MODULE is not set 
to
None
+---
  Reporter:  metzen | Owner:  nobody
Status:  new| Milestone:  1.1   
 Component:  Template system|   Version:  SVN   
Resolution: |  Keywords:
 Stage:  Ready for checkin  | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by Alex):

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

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



[Changeset] r10336 - in django/branches/releases/1.0.X: django/utils tests/regressiontests/cache

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 13:20:53 -0500 (Wed, 01 Apr 2009)
New Revision: 10336

Modified:
   django/branches/releases/1.0.X/django/utils/cache.py
   django/branches/releases/1.0.X/tests/regressiontests/cache/tests.py
Log:
[1.0.X] Fixed #10016: the cache middleware no longer vomits when handed long 
URLs. Thanks, Matt Croydon. Backport of r10335 from trunk.

Modified: django/branches/releases/1.0.X/django/utils/cache.py
===
--- django/branches/releases/1.0.X/django/utils/cache.py2009-04-01 
18:19:32 UTC (rev 10335)
+++ django/branches/releases/1.0.X/django/utils/cache.py2009-04-01 
18:20:53 UTC (rev 10336)
@@ -29,6 +29,7 @@
 from django.utils.encoding import smart_str, iri_to_uri
 from django.utils.http import http_date
 from django.utils.hashcompat import md5_constructor
+from django.http import HttpRequest
 
 cc_delim_re = re.compile(r'\s*,\s*')
 
@@ -143,13 +144,14 @@
 value = request.META.get(header, None)
 if value is not None:
 ctx.update(value)
+path = md5_constructor(iri_to_uri(request.path))
 return 'views.decorators.cache.cache_page.%s.%s.%s' % (
-   key_prefix, iri_to_uri(request.path), ctx.hexdigest())
+   key_prefix, path.hexdigest(), ctx.hexdigest())
 
 def _generate_cache_header_key(key_prefix, request):
 """Returns a cache key for the header cache."""
-return 'views.decorators.cache.cache_header.%s.%s' % (
-key_prefix, iri_to_uri(request.path))
+path = md5_constructor(iri_to_uri(request.path))
+return 'views.decorators.cache.cache_header.%s.%s' % (key_prefix, 
path.hexdigest())
 
 def get_cache_key(request, key_prefix=None):
 """

Modified: django/branches/releases/1.0.X/tests/regressiontests/cache/tests.py
===
--- django/branches/releases/1.0.X/tests/regressiontests/cache/tests.py 
2009-04-01 18:19:32 UTC (rev 10335)
+++ django/branches/releases/1.0.X/tests/regressiontests/cache/tests.py 
2009-04-01 18:20:53 UTC (rev 10336)
@@ -13,8 +13,8 @@
 from django.core import management
 from django.core.cache import get_cache
 from django.core.cache.backends.base import InvalidCacheBackendError
-from django.http import HttpResponse
-from django.utils.cache import patch_vary_headers
+from django.http import HttpResponse, HttpRequest
+from django.utils.cache import patch_vary_headers, get_cache_key, 
learn_cache_key
 from django.utils.hashcompat import md5_constructor
 
 # functions/classes for complex data type tests
@@ -264,6 +264,26 @@
 class CacheUtils(unittest.TestCase):
 """TestCase for django.utils.cache functions."""
 
+def setUp(self):
+self.path = '/cache/test/'
+self.old_settings_key_prefix = settings.CACHE_MIDDLEWARE_KEY_PREFIX
+self.old_middleware_seconds = settings.CACHE_MIDDLEWARE_SECONDS
+settings.CACHE_MIDDLEWARE_KEY_PREFIX = 'settingsprefix'
+settings.CACHE_MIDDLEWARE_SECONDS = 1
+
+def tearDown(self):
+settings.CACHE_MIDDLEWARE_KEY_PREFIX = self.old_settings_key_prefix
+settings.CACHE_MIDDLEWARE_SECONDS = self.old_middleware_seconds
+
+def _get_request(self, path):
+request = HttpRequest()
+request.META = {
+'SERVER_NAME': 'testserver',
+'SERVER_PORT': 80,
+}
+request.path = request.path_info = "/cache/%s" % path
+return request
+
 def test_patch_vary_headers(self):
 headers = (
 # Initial vary, new headers, resulting vary.
@@ -284,6 +304,26 @@
 patch_vary_headers(response, newheaders)
 self.assertEqual(response['Vary'], resulting_vary)
 
+def test_get_cache_key(self):
+request = self._get_request(self.path)
+response = HttpResponse()
+key_prefix = 'localprefix'
+# Expect None if no headers have been set yet.
+self.assertEqual(get_cache_key(request), None)
+# Set headers to an empty list.
+learn_cache_key(request, response)
+self.assertEqual(get_cache_key(request), 
'views.decorators.cache.cache_page.settingsprefix.a8c87a3d8c44853d7f79474f7ffe4ad5.d41d8cd98f00b204e9800998ecf8427e')
+# Verify that a specified key_prefix is taken in to account.
+learn_cache_key(request, response, key_prefix=key_prefix)
+self.assertEqual(get_cache_key(request, key_prefix=key_prefix), 
'views.decorators.cache.cache_page.localprefix.a8c87a3d8c44853d7f79474f7ffe4ad5.d41d8cd98f00b204e9800998ecf8427e')
 
+def test_learn_cache_key(self):
+request = self._get_request(self.path)
+response = HttpResponse()
+response['Vary'] = 'Pony'
+# Make sure that the Vary header is added to the key hash
+learn_cache_key(request, response)
+self.assertEqual(get_cache_key(request), 

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

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 13:19:32 -0500 (Wed, 01 Apr 2009)
New Revision: 10335

Modified:
   django/trunk/django/utils/cache.py
   django/trunk/tests/regressiontests/cache/tests.py
Log:
Fixed #10016: the cache middleware no longer vomits when handed long URLs. 
Thanks, Matt Croydon.

Modified: django/trunk/django/utils/cache.py
===
--- django/trunk/django/utils/cache.py  2009-04-01 17:06:20 UTC (rev 10334)
+++ django/trunk/django/utils/cache.py  2009-04-01 18:19:32 UTC (rev 10335)
@@ -29,6 +29,7 @@
 from django.utils.encoding import smart_str, iri_to_uri
 from django.utils.http import http_date
 from django.utils.hashcompat import md5_constructor
+from django.http import HttpRequest
 
 cc_delim_re = re.compile(r'\s*,\s*')
 
@@ -143,13 +144,14 @@
 value = request.META.get(header, None)
 if value is not None:
 ctx.update(value)
+path = md5_constructor(iri_to_uri(request.path))
 return 'views.decorators.cache.cache_page.%s.%s.%s' % (
-   key_prefix, iri_to_uri(request.path), ctx.hexdigest())
+   key_prefix, path.hexdigest(), ctx.hexdigest())
 
 def _generate_cache_header_key(key_prefix, request):
 """Returns a cache key for the header cache."""
-return 'views.decorators.cache.cache_header.%s.%s' % (
-key_prefix, iri_to_uri(request.path))
+path = md5_constructor(iri_to_uri(request.path))
+return 'views.decorators.cache.cache_header.%s.%s' % (key_prefix, 
path.hexdigest())
 
 def get_cache_key(request, key_prefix=None):
 """

Modified: django/trunk/tests/regressiontests/cache/tests.py
===
--- django/trunk/tests/regressiontests/cache/tests.py   2009-04-01 17:06:20 UTC 
(rev 10334)
+++ django/trunk/tests/regressiontests/cache/tests.py   2009-04-01 18:19:32 UTC 
(rev 10335)
@@ -13,8 +13,8 @@
 from django.core import management
 from django.core.cache import get_cache
 from django.core.cache.backends.base import InvalidCacheBackendError
-from django.http import HttpResponse
-from django.utils.cache import patch_vary_headers
+from django.http import HttpResponse, HttpRequest
+from django.utils.cache import patch_vary_headers, get_cache_key, 
learn_cache_key
 from django.utils.hashcompat import md5_constructor
 
 # functions/classes for complex data type tests
@@ -294,6 +294,26 @@
 class CacheUtils(unittest.TestCase):
 """TestCase for django.utils.cache functions."""
 
+def setUp(self):
+self.path = '/cache/test/'
+self.old_settings_key_prefix = settings.CACHE_MIDDLEWARE_KEY_PREFIX
+self.old_middleware_seconds = settings.CACHE_MIDDLEWARE_SECONDS
+settings.CACHE_MIDDLEWARE_KEY_PREFIX = 'settingsprefix'
+settings.CACHE_MIDDLEWARE_SECONDS = 1
+
+def tearDown(self):
+settings.CACHE_MIDDLEWARE_KEY_PREFIX = self.old_settings_key_prefix
+settings.CACHE_MIDDLEWARE_SECONDS = self.old_middleware_seconds
+
+def _get_request(self, path):
+request = HttpRequest()
+request.META = {
+'SERVER_NAME': 'testserver',
+'SERVER_PORT': 80,
+}
+request.path = request.path_info = "/cache/%s" % path
+return request
+
 def test_patch_vary_headers(self):
 headers = (
 # Initial vary, new headers, resulting vary.
@@ -314,6 +334,26 @@
 patch_vary_headers(response, newheaders)
 self.assertEqual(response['Vary'], resulting_vary)
 
+def test_get_cache_key(self):
+request = self._get_request(self.path)
+response = HttpResponse()
+key_prefix = 'localprefix'
+# Expect None if no headers have been set yet.
+self.assertEqual(get_cache_key(request), None)
+# Set headers to an empty list.
+learn_cache_key(request, response)
+self.assertEqual(get_cache_key(request), 
'views.decorators.cache.cache_page.settingsprefix.a8c87a3d8c44853d7f79474f7ffe4ad5.d41d8cd98f00b204e9800998ecf8427e')
+# Verify that a specified key_prefix is taken in to account.
+learn_cache_key(request, response, key_prefix=key_prefix)
+self.assertEqual(get_cache_key(request, key_prefix=key_prefix), 
'views.decorators.cache.cache_page.localprefix.a8c87a3d8c44853d7f79474f7ffe4ad5.d41d8cd98f00b204e9800998ecf8427e')
 
+def test_learn_cache_key(self):
+request = self._get_request(self.path)
+response = HttpResponse()
+response['Vary'] = 'Pony'
+# Make sure that the Vary header is added to the key hash
+learn_cache_key(request, response)
+self.assertEqual(get_cache_key(request), 
'views.decorators.cache.cache_page.settingsprefix.a8c87a3d8c44853d7f79474f7ffe4ad5.d41d8cd98f00b204e9800998ecf8427e')
+
 if __name__ == '__main__':
 unittest.main()


--~--~-~--~~~---~--~~
You received this message because you are subscribed to 

Re: [Django] #5423: "dumpdata" should stream output one row at a time

2009-04-01 Thread Django
#5423: "dumpdata" should stream output one row at a time
--+-
  Reporter:  adrian   | Owner:  nobody  
 
Status:  new  | Milestone:  
 
 Component:  django-admin.py  |   Version:  SVN 
 
Resolution:   |  Keywords:  dumpdata loaddata 
fixtures memory
 Stage:  Accepted | Has_patch:  1   
 
Needs_docs:  0|   Needs_tests:  0   
 
Needs_better_patch:  0|  
--+-
Changes (by jmcvetta):

 * cc: jmcvetta (added)
  * keywords:  => dumpdata loaddata fixtures memory

Comment:

 It appears [attachment:dumpdata_streamed_output_django1.0-fix.diff the
 latest patch] has already been applied to trunk:
 {{{
 $ patch -p1 < ~/incoming/dumpdata_streamed_output_django1.0-fix.diff
 patching file django/core/management/commands/dumpdata.py
 Reversed (or previously applied) patch detected!  Assume -R? [n]
 }}}

 I experienced no problems using {{{dumpdata}}} to export a ~160,000 record
 fixture, in both json and yaml formats.  However, while I was able run
 {{{loaddata}}} on the json fixture without incident, attempting to load
 the yaml fixture quickly overwhelmed the memory on my 4GB workstation.

-- 
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] #10576: file lost when transaction was rollbacked

2009-04-01 Thread Django
#10576: file lost when transaction was rollbacked
---+
  Reporter:  liangent  | Owner:  nobody
Status:  new   | Milestone:  1.1   
 Component:  File uploads/storage  |   Version:  1.0   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by Alex):

  * component:  Uncategorized => File uploads/storage

-- 
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] #10609: Permissions on admin actions

2009-04-01 Thread Django
#10609: Permissions on admin actions
---+
  Reporter:  leitjohn  | Owner:  leitjohn  
Status:  assigned  | Milestone:  1.1   
 Component:  django.contrib.admin  |   Version:  1.1-beta-1
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by Alex):

  * component:  Uncategorized => django.contrib.admin

-- 
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] #10163: Admin view redirection failures

2009-04-01 Thread Django
#10163: Admin view redirection failures
+---
  Reporter:  Vinay Sajip   | Owner:  
nobody
Status:  reopened   | Milestone:  
1.1   
 Component:  Forms  |   Version:  
SVN   
Resolution: |  Keywords:  
admin view redirection
 Stage:  Accepted   | Has_patch:  0 

Needs_docs:  0  |   Needs_tests:  0 

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

  * component:  Uncategorized => Forms

-- 
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] #9146: handlers/base.py relies on cpython-specific behavior

2009-04-01 Thread Django
#9146: handlers/base.py relies on cpython-specific behavior
-+--
  Reporter:  fijal   | Owner:  jacobkm 
Status:  new | Milestone:  1.1 
 Component:  Core framework  |   Version:  1.0 
Resolution:  |  Keywords:  pypy obscure
 Stage:  Accepted| Has_patch:  0   
Needs_docs:  0   |   Needs_tests:  0   
Needs_better_patch:  0   |  
-+--
Changes (by Alex):

  * component:  Uncategorized => Core framework

-- 
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] r10334 - django/branches/releases/1.0.X/django/core/cache/backends

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 12:06:20 -0500 (Wed, 01 Apr 2009)
New Revision: 10334

Modified:
   django/branches/releases/1.0.X/django/core/cache/backends/locmem.py
Log:
[1.0.X] Fixed #9644: fix a thread sync issue in the locmem cache. Thanks, mrts. 
Backport of r10333 from trunk.

Modified: django/branches/releases/1.0.X/django/core/cache/backends/locmem.py
===
--- django/branches/releases/1.0.X/django/core/cache/backends/locmem.py 
2009-04-01 17:05:19 UTC (rev 10333)
+++ django/branches/releases/1.0.X/django/core/cache/backends/locmem.py 
2009-04-01 17:06:20 UTC (rev 10334)
@@ -58,8 +58,11 @@
 self._lock.reader_leaves()
 self._lock.writer_enters()
 try:
-del self._cache[key]
-del self._expire_info[key]
+try:
+del self._cache[key]
+del self._expire_info[key]
+except KeyError:
+pass
 return default
 finally:
 self._lock.writer_leaves()


--~--~-~--~~~---~--~~
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] r10333 - django/trunk/django/core/cache/backends

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 12:05:19 -0500 (Wed, 01 Apr 2009)
New Revision: 10333

Modified:
   django/trunk/django/core/cache/backends/locmem.py
Log:
Fixed #9644: fix a thread sync issue in the locmem cache. Thanks, mrts.

Modified: django/trunk/django/core/cache/backends/locmem.py
===
--- django/trunk/django/core/cache/backends/locmem.py   2009-04-01 17:02:32 UTC 
(rev 10332)
+++ django/trunk/django/core/cache/backends/locmem.py   2009-04-01 17:05:19 UTC 
(rev 10333)
@@ -58,8 +58,11 @@
 self._lock.reader_leaves()
 self._lock.writer_enters()
 try:
-del self._cache[key]
-del self._expire_info[key]
+try:
+del self._cache[key]
+del self._expire_info[key]
+except KeyError:
+pass
 return default
 finally:
 self._lock.writer_leaves()


--~--~-~--~~~---~--~~
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] r10332 - in django/trunk/django/contrib/auth: . tests

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 12:02:32 -0500 (Wed, 01 Apr 2009)
New Revision: 10332

Added:
   django/trunk/django/contrib/auth/tests/urls.py
Modified:
   django/trunk/django/contrib/auth/tests/__init__.py
   django/trunk/django/contrib/auth/tests/views.py
   django/trunk/django/contrib/auth/views.py
Log:
Fixed #10460: the logout view can now redirect like the rest of the auth views. 
Thanks, chronos and steingrd.

Modified: django/trunk/django/contrib/auth/tests/__init__.py
===
--- django/trunk/django/contrib/auth/tests/__init__.py  2009-04-01 16:43:01 UTC 
(rev 10331)
+++ django/trunk/django/contrib/auth/tests/__init__.py  2009-04-01 17:02:32 UTC 
(rev 10332)
@@ -1,6 +1,6 @@
 from django.contrib.auth.tests.basic import BASIC_TESTS
 from django.contrib.auth.tests.views \
-import PasswordResetTest, ChangePasswordTest, LoginTest
+import PasswordResetTest, ChangePasswordTest, LoginTest, LogoutTest
 from django.contrib.auth.tests.forms import FORM_TESTS
 from django.contrib.auth.tests.remote_user \
 import RemoteUserTest, RemoteUserNoCreateTest, RemoteUserCustomTest
@@ -15,4 +15,5 @@
 'TOKEN_GENERATOR_TESTS': TOKEN_GENERATOR_TESTS,
 'CHANGEPASSWORD_TESTS': ChangePasswordTest,
 'LOGIN_TESTS': LoginTest,
+'LOGOUT_TESTS': LogoutTest,
 }

Added: django/trunk/django/contrib/auth/tests/urls.py
===
--- django/trunk/django/contrib/auth/tests/urls.py  
(rev 0)
+++ django/trunk/django/contrib/auth/tests/urls.py  2009-04-01 17:02:32 UTC 
(rev 10332)
@@ -0,0 +1,9 @@
+from django.conf.urls.defaults import patterns
+from django.contrib.auth.urls import urlpatterns
+
+# special urls for auth test cases
+urlpatterns += patterns('',
+(r'^logout/custom_query/$', 'django.contrib.auth.views.logout', 
dict(redirect_field_name='follow')),
+(r'^logout/next_page/$', 'django.contrib.auth.views.logout', 
dict(next_page='/somewhere/')),
+)
+

Modified: django/trunk/django/contrib/auth/tests/views.py
===
--- django/trunk/django/contrib/auth/tests/views.py 2009-04-01 16:43:01 UTC 
(rev 10331)
+++ django/trunk/django/contrib/auth/tests/views.py 2009-04-01 17:02:32 UTC 
(rev 10332)
@@ -1,8 +1,8 @@
-
 import os
 import re
 
 from django.conf import settings
+from django.contrib.auth import SESSION_KEY
 from django.contrib.auth.forms import AuthenticationForm
 from django.contrib.sites.models import Site, RequestSite
 from django.contrib.auth.models import User
@@ -184,4 +184,52 @@
 self.assertEquals(response.context['site_name'], site.name)
 self.assert_(isinstance(response.context['form'], AuthenticationForm), 
  'Login form is not an AuthenticationForm')
-
\ No newline at end of file
+
+class LogoutTest(TestCase):
+fixtures = ['authtestdata.json']
+urls = 'django.contrib.auth.tests.urls'
+
+def login(self, password='password'):
+response = self.client.post('/login/', {
+'username': 'testclient',
+'password': password
+}
+)
+self.assertEquals(response.status_code, 302)
+
self.assert_(response['Location'].endswith(settings.LOGIN_REDIRECT_URL))
+self.assert_(SESSION_KEY in self.client.session)
+
+def confirm_logged_out(self):
+self.assert_(SESSION_KEY not in self.client.session)
+
+def test_logout_default(self):
+"Logout without next_page option renders the default template"
+self.login()
+response = self.client.get('/logout/')
+self.assertEquals(200, response.status_code)
+self.assert_('Logged out' in response.content)
+self.confirm_logged_out()
+
+def test_logout_with_next_page_specified(self): 
+"Logout with next_page option given redirects to specified resource"
+self.login()
+response = self.client.get('/logout/next_page/')
+self.assertEqual(response.status_code, 302)
+self.assert_(response['Location'].endswith('/somewhere/'))
+self.confirm_logged_out()
+
+def test_logout_with_redirect_argument(self):
+"Logout with query string redirects to specified resource"
+self.login()
+response = self.client.get('/logout/?next=/login/')
+self.assertEqual(response.status_code, 302)
+self.assert_(response['Location'].endswith('/login/'))
+self.confirm_logged_out()
+
+def test_logout_with_custom_redirect_argument(self):
+"Logout with custom query string redirects to specified resource"
+self.login()
+response = self.client.get('/logout/custom_query/?follow=/somewhere/')
+self.assertEqual(response.status_code, 302)
+self.assert_(response['Location'].endswith('/somewhere/'))
+self.confirm_logged_out()
\ No newline at end 

Re: [Django] #10647: Many-to-many tables are created even with managed=False

2009-04-01 Thread Django
#10647: Many-to-many tables are created even with managed=False
---+
  Reporter:  Anossov   | Owner:  jacob  

Status:  new   | Milestone:  1.1

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

Resolution:|  Keywords:  managed, 
manytomany
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  1 |   Needs_tests:  0  

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

 "In the face of ambiguity refuse the temptation to guess."  In other
 words, we should only explicitly omit creation if both are unmanaged.

-- 
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] #10647: Many-to-many tables are created even with managed=False

2009-04-01 Thread Django
#10647: Many-to-many tables are created even with managed=False
---+
  Reporter:  Anossov   | Owner:  jacob  

Status:  new   | Milestone:  1.1

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

Resolution:|  Keywords:  managed, 
manytomany
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  1 |   Needs_tests:  0  

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

  * owner:  jbronn => jacob
  * needs_docs:  0 => 1
  * stage:  Design decision needed => 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] #10340: Multiple content_type queries on "Change User" page in admin

2009-04-01 Thread Django
#10340: Multiple content_type queries on "Change User" page in admin
-+--
  Reporter:  dc  | Owner:  ramiro
Status:  closed  | Milestone:  1.1   
 Component:  Authentication  |   Version:  1.0   
Resolution:  wontfix |  Keywords:  pycamp2009
 Stage:  Accepted| Has_patch:  1 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Changes (by jacob):

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

Comment:

 I'd rather just leave this alone -- it's not clear that select_related
 will actually make this any faster, and on top of that the admin doesn't
 need to be a highly optimized beast.

-- 
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] #10647: Many-to-many tables are created even with managed=False

2009-04-01 Thread Django
#10647: Many-to-many tables are created even with managed=False
---+
  Reporter:  Anossov   | Owner:  jbronn 

Status:  new   | Milestone:  1.1

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

Resolution:|  Keywords:  managed, 
manytomany
 Stage:  Design decision needed| Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

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

  * stage:  Accepted => Design decision needed

-- 
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] #10166: Cookie test fails in login() view

2009-04-01 Thread Django
#10166: Cookie test fails in login() view
-+--
  Reporter:  iakbar  | Owner:  nobody   

Status:  closed  | Milestone:  1.1  

 Component:  Authentication  |   Version:  1.0  

Resolution:  wontfix |  Keywords:  authentication, cookie, 
login
 Stage:  Accepted| Has_patch:  1

Needs_docs:  0   |   Needs_tests:  1

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

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

Comment:

 Yeah, the cookie test is deliberately disabled by default in the login
 view, and we'll keep it that way.

-- 
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] r10331 - django/trunk/django/contrib/auth

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 11:43:01 -0500 (Wed, 01 Apr 2009)
New Revision: 10331

Modified:
   django/trunk/django/contrib/auth/admin.py
Log:
Fixed #10106: added is_active to user admin's list_display.

Modified: django/trunk/django/contrib/auth/admin.py
===
--- django/trunk/django/contrib/auth/admin.py   2009-04-01 16:37:48 UTC (rev 
10330)
+++ django/trunk/django/contrib/auth/admin.py   2009-04-01 16:43:01 UTC (rev 
10331)
@@ -27,7 +27,7 @@
 add_form = UserCreationForm
 change_password_form = AdminPasswordChangeForm
 list_display = ('username', 'email', 'first_name', 'last_name', 'is_staff')
-list_filter = ('is_staff', 'is_superuser')
+list_filter = ('is_staff', 'is_superuser', 'is_active')
 search_fields = ('username', 'first_name', 'last_name', 'email')
 ordering = ('username',)
 filter_horizontal = ('user_permissions',)


--~--~-~--~~~---~--~~
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] r10330 - in django/trunk/django/contrib/auth: . tests

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 11:37:48 -0500 (Wed, 01 Apr 2009)
New Revision: 10330

Modified:
   django/trunk/django/contrib/auth/tests/__init__.py
   django/trunk/django/contrib/auth/tests/views.py
   django/trunk/django/contrib/auth/views.py
Log:
Fixed #9881: Added the  to the login view context, not just the site's name. 
Thanks, nessita.

Modified: django/trunk/django/contrib/auth/tests/__init__.py
===
--- django/trunk/django/contrib/auth/tests/__init__.py  2009-04-01 16:18:25 UTC 
(rev 10329)
+++ django/trunk/django/contrib/auth/tests/__init__.py  2009-04-01 16:37:48 UTC 
(rev 10330)
@@ -1,6 +1,6 @@
 from django.contrib.auth.tests.basic import BASIC_TESTS
 from django.contrib.auth.tests.views \
-import PasswordResetTest, ChangePasswordTest
+import PasswordResetTest, ChangePasswordTest, LoginTest
 from django.contrib.auth.tests.forms import FORM_TESTS
 from django.contrib.auth.tests.remote_user \
 import RemoteUserTest, RemoteUserNoCreateTest, RemoteUserCustomTest
@@ -14,4 +14,5 @@
 'FORM_TESTS': FORM_TESTS,
 'TOKEN_GENERATOR_TESTS': TOKEN_GENERATOR_TESTS,
 'CHANGEPASSWORD_TESTS': ChangePasswordTest,
+'LOGIN_TESTS': LoginTest,
 }

Modified: django/trunk/django/contrib/auth/tests/views.py
===
--- django/trunk/django/contrib/auth/tests/views.py 2009-04-01 16:18:25 UTC 
(rev 10329)
+++ django/trunk/django/contrib/auth/tests/views.py 2009-04-01 16:37:48 UTC 
(rev 10330)
@@ -3,9 +3,12 @@
 import re
 
 from django.conf import settings
+from django.contrib.auth.forms import AuthenticationForm
+from django.contrib.sites.models import Site, RequestSite
 from django.contrib.auth.models import User
 from django.test import TestCase
 from django.core import mail
+from django.core.urlresolvers import reverse
 
 class PasswordResetTest(TestCase):
 fixtures = ['authtestdata.json']
@@ -162,3 +165,23 @@
 self.fail_login()
 self.login(password='password1')
 
+class LoginTest(TestCase):
+fixtures = ['authtestdata.json']
+urls = 'django.contrib.auth.urls'
+
+def setUp(self):
+self.old_TEMPLATE_DIRS = settings.TEMPLATE_DIRS
+settings.TEMPLATE_DIRS = (os.path.join(os.path.dirname(__file__), 
'templates'),)
+
+def tearDown(self):
+settings.TEMPLATE_DIRS = self.old_TEMPLATE_DIRS
+
+def test_current_site_in_context_after_login(self):
+response = self.client.get(reverse('django.contrib.auth.views.login'))
+self.assertEquals(response.status_code, 200)
+site = Site.objects.get_current()
+self.assertEquals(response.context['site'], site)
+self.assertEquals(response.context['site_name'], site.name)
+self.assert_(isinstance(response.context['form'], AuthenticationForm), 
+ 'Login form is not an AuthenticationForm')
+
\ No newline at end of file

Modified: django/trunk/django/contrib/auth/views.py
===
--- django/trunk/django/contrib/auth/views.py   2009-04-01 16:18:25 UTC (rev 
10329)
+++ django/trunk/django/contrib/auth/views.py   2009-04-01 16:37:48 UTC (rev 
10330)
@@ -38,6 +38,7 @@
 return render_to_response(template_name, {
 'form': form,
 redirect_field_name: redirect_to,
+'site': current_site,
 'site_name': current_site.name,
 }, context_instance=RequestContext(request))
 login = never_cache(login)


--~--~-~--~~~---~--~~
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] r10329 - in django/branches/releases/1.0.X: django/contrib/auth tests/regressiontests/decorators

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 11:18:25 -0500 (Wed, 01 Apr 2009)
New Revision: 10329

Modified:
   django/branches/releases/1.0.X/django/contrib/auth/decorators.py
   django/branches/releases/1.0.X/tests/regressiontests/decorators/tests.py
Log:
[1.0.X] Fixed #9474: user_passes_test may now be applied multiple times. 
Backport of r10328 from trunk.

Modified: django/branches/releases/1.0.X/django/contrib/auth/decorators.py
===
--- django/branches/releases/1.0.X/django/contrib/auth/decorators.py
2009-04-01 16:17:38 UTC (rev 10328)
+++ django/branches/releases/1.0.X/django/contrib/auth/decorators.py
2009-04-01 16:18:25 UTC (rev 10329)
@@ -56,8 +56,19 @@
 self.test_func = test_func
 self.login_url = login_url
 self.redirect_field_name = redirect_field_name
-update_wrapper(self, view_func)
 
+# We can't blindly apply update_wrapper because it udpates __dict__ 
and 
+# if the view function is already a _CheckLogin object then 
+# self.test_func and friends will get stomped. However, we also can't 
+# *not* update the wrapper's dict because then view function attributes
+# don't get updated into the wrapper. So we need to split the
+# difference: don't let update_wrapper update __dict__, but then update
+# the (parts of) __dict__ that we care about ourselves.
+update_wrapper(self, view_func, updated=())
+for k in view_func.__dict__:
+if k not in self.__dict__:
+self.__dict__[k] = view_func.__dict__[k]
+
 def __get__(self, obj, cls=None):
 view_func = self.view_func.__get__(obj, cls)
 return _CheckLogin(view_func, self.test_func, self.login_url, 
self.redirect_field_name)

Modified: 
django/branches/releases/1.0.X/tests/regressiontests/decorators/tests.py
===
--- django/branches/releases/1.0.X/tests/regressiontests/decorators/tests.py
2009-04-01 16:17:38 UTC (rev 10328)
+++ django/branches/releases/1.0.X/tests/regressiontests/decorators/tests.py
2009-04-01 16:18:25 UTC (rev 10329)
@@ -29,6 +29,7 @@
 fully_decorated = never_cache(fully_decorated)
 
 # django.contrib.auth.decorators
+# Apply user_passes_test twice to check #9474
 fully_decorated = user_passes_test(lambda u:True)(fully_decorated)
 fully_decorated = login_required(fully_decorated)
 fully_decorated = permission_required('change_world')(fully_decorated)
@@ -54,3 +55,33 @@
 self.assertEquals(fully_decorated.__name__, 'fully_decorated')
 self.assertEquals(fully_decorated.__doc__, 'Expected __doc__')
 self.assertEquals(fully_decorated.__dict__['anything'], 'Expected 
__dict__')
+
+def test_user_passes_test_composition(self):
+"""
+Test that the user_passes_test decorator can be applied multiple times
+(#9474).
+"""
+def test1(user):
+user.decorators_applied.append('test1')
+return True
+
+def test2(user):
+user.decorators_applied.append('test2')
+return True
+
+def callback(request):
+return request.user.decorators_applied
+
+callback = user_passes_test(test1)(callback)
+callback = user_passes_test(test2)(callback)
+
+class DummyUser(object): pass
+class DummyRequest(object): pass
+
+request = DummyRequest()
+request.user = DummyUser()
+request.user.decorators_applied = []
+response = callback(request)
+
+self.assertEqual(response, ['test2', 'test1'])
+


--~--~-~--~~~---~--~~
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] r10328 - in django/trunk: django/contrib/auth tests/regressiontests/decorators

2009-04-01 Thread noreply

Author: jacob
Date: 2009-04-01 11:17:38 -0500 (Wed, 01 Apr 2009)
New Revision: 10328

Modified:
   django/trunk/django/contrib/auth/decorators.py
   django/trunk/tests/regressiontests/decorators/tests.py
Log:
Fixed #9474: user_passes_test may now be applied multiple times.

Modified: django/trunk/django/contrib/auth/decorators.py
===
--- django/trunk/django/contrib/auth/decorators.py  2009-04-01 16:06:22 UTC 
(rev 10327)
+++ django/trunk/django/contrib/auth/decorators.py  2009-04-01 16:17:38 UTC 
(rev 10328)
@@ -56,8 +56,19 @@
 self.test_func = test_func
 self.login_url = login_url
 self.redirect_field_name = redirect_field_name
-update_wrapper(self, view_func)
 
+# We can't blindly apply update_wrapper because it udpates __dict__ 
and 
+# if the view function is already a _CheckLogin object then 
+# self.test_func and friends will get stomped. However, we also can't 
+# *not* update the wrapper's dict because then view function attributes
+# don't get updated into the wrapper. So we need to split the
+# difference: don't let update_wrapper update __dict__, but then update
+# the (parts of) __dict__ that we care about ourselves.
+update_wrapper(self, view_func, updated=())
+for k in view_func.__dict__:
+if k not in self.__dict__:
+self.__dict__[k] = view_func.__dict__[k]
+
 def __get__(self, obj, cls=None):
 view_func = self.view_func.__get__(obj, cls)
 return _CheckLogin(view_func, self.test_func, self.login_url, 
self.redirect_field_name)

Modified: django/trunk/tests/regressiontests/decorators/tests.py
===
--- django/trunk/tests/regressiontests/decorators/tests.py  2009-04-01 
16:06:22 UTC (rev 10327)
+++ django/trunk/tests/regressiontests/decorators/tests.py  2009-04-01 
16:17:38 UTC (rev 10328)
@@ -29,6 +29,7 @@
 fully_decorated = never_cache(fully_decorated)
 
 # django.contrib.auth.decorators
+# Apply user_passes_test twice to check #9474
 fully_decorated = user_passes_test(lambda u:True)(fully_decorated)
 fully_decorated = login_required(fully_decorated)
 fully_decorated = permission_required('change_world')(fully_decorated)
@@ -54,3 +55,33 @@
 self.assertEquals(fully_decorated.__name__, 'fully_decorated')
 self.assertEquals(fully_decorated.__doc__, 'Expected __doc__')
 self.assertEquals(fully_decorated.__dict__['anything'], 'Expected 
__dict__')
+
+def test_user_passes_test_composition(self):
+"""
+Test that the user_passes_test decorator can be applied multiple times
+(#9474).
+"""
+def test1(user):
+user.decorators_applied.append('test1')
+return True
+
+def test2(user):
+user.decorators_applied.append('test2')
+return True
+
+def callback(request):
+return request.user.decorators_applied
+
+callback = user_passes_test(test1)(callback)
+callback = user_passes_test(test2)(callback)
+
+class DummyUser(object): pass
+class DummyRequest(object): pass
+
+request = DummyRequest()
+request.user = DummyUser()
+request.user.decorators_applied = []
+response = callback(request)
+
+self.assertEqual(response, ['test2', 'test1'])
+


--~--~-~--~~~---~--~~
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] #10692: DecimalField raises "InvalidOperation: Rescale > prec"

2009-04-01 Thread Django
#10692: DecimalField raises "InvalidOperation: Rescale > prec"
---+
  Reporter:  krylatij  | Owner:  gwilson
Status:  assigned  | Milestone:  1.1
 Component:  Database layer (models, ORM)  |   Version:  SVN
Resolution:|  Keywords: 
 Stage:  Unreviewed| Has_patch:  0  
Needs_docs:  0 |   Needs_tests:  0  
Needs_better_patch:  0 |  
---+
Changes (by gwilson):

  * status:  new => assigned
  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * owner:  nobody => gwilson
  * needs_docs:  => 0

Old description:

> Create simple model:
>
> class Test(models.Model):
> area = models.DecimalField(default=0, max_digits=7, decimal_places=2)
>
> run:
> Test.objects.filter(area__lte=10)
>
> it will raise InvalidOperation: Rescale > prec in decimal.py

New description:

 Create simple model:

 {{{
 class Test(models.Model):
 area = models.DecimalField(default=0, max_digits=7, decimal_places=2)
 }}}

 run:
 {{{
 Test.objects.filter(area__lte=10)
 }}}

 it will raise `InvalidOperation: Rescale > prec` in decimal.py

-- 
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
-~--~~~~--~~--~--~---



  1   2   >