Re: [Django] #6773: Confusing error when ForeignKey lookup fails while serializing

2010-04-04 Thread Django
#6773: Confusing error when ForeignKey lookup fails while serializing
-+--
  Reporter:  kcarnold| Owner:  nobody   
 
Status:  new | Milestone:   
 
 Component:  Serialization   |   Version:  SVN  
 
Resolution:  |  Keywords:  dumpdata 
exception
 Stage:  Design decision needed  | Has_patch:  0
 
Needs_docs:  0   |   Needs_tests:  0
 
Needs_better_patch:  0   |  
-+--
Changes (by gabrielhurley):

 * cc: gabrielhurley (added)

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

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



Re: [Django] #12882: jQuery.noConflict() in admin breaks site specific code with jQuery

2010-04-04 Thread Django
#12882: jQuery.noConflict() in admin breaks site specific code with jQuery
---+
  Reporter:  krej...@i3.cz | Owner:  jezdez  
Status:  assigned  | Milestone:  1.2 
 Component:  django.contrib.admin  |   Version:  SVN 
Resolution:|  Keywords:  jQuery admin
 Stage:  Accepted  | Has_patch:  1   
Needs_docs:  0 |   Needs_tests:  1   
Needs_better_patch:  1 |  
---+
Changes (by anonymous):

 * cc: michael.c.strickl...@gmail.com (added)

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

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



[Changeset] r12915 - django/trunk/tests/regressiontests/delete_regress

2010-04-04 Thread noreply
Author: kmtracey
Date: 2010-04-04 12:42:23 -0500 (Sun, 04 Apr 2010)
New Revision: 12915

Modified:
   django/trunk/tests/regressiontests/delete_regress/models.py
Log:
Tweaked a test model in delete_regress to avoid having a column name that 
causes a failure on Oracle.


Modified: django/trunk/tests/regressiontests/delete_regress/models.py
===
--- django/trunk/tests/regressiontests/delete_regress/models.py 2010-04-04 
17:17:46 UTC (rev 12914)
+++ django/trunk/tests/regressiontests/delete_regress/models.py 2010-04-04 
17:42:23 UTC (rev 12915)
@@ -30,7 +30,7 @@
 class PlayedWith(models.Model):
 child = models.ForeignKey(Child)
 toy = models.ForeignKey(Toy)
-date = models.DateField()
+date = models.DateField(db_column='date_col')
 
 class PlayedWithNote(models.Model):
 played = models.ForeignKey(PlayedWith)

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



[Changeset] r12914 - in django/branches/releases/1.1.X: django/db/backends django/db/backends/mysql django/db/backends/oracle django/db/models django/db/models/sql tests/regressiontests/queries

2010-04-04 Thread noreply
Author: russellm
Date: 2010-04-04 12:17:46 -0500 (Sun, 04 Apr 2010)
New Revision: 12914

Modified:
   django/branches/releases/1.1.X/django/db/backends/__init__.py
   django/branches/releases/1.1.X/django/db/backends/mysql/base.py
   django/branches/releases/1.1.X/django/db/backends/oracle/base.py
   django/branches/releases/1.1.X/django/db/models/query.py
   django/branches/releases/1.1.X/django/db/models/sql/query.py
   django/branches/releases/1.1.X/tests/regressiontests/queries/tests.py
Log:
[1.1.X] Fixed #12328 -- Corrected the handling of subqueries with ordering and 
slicing, especially when used in delete subqueries. Thanks to Walter Doekes for 
the report.

This fixes a feature that isn't available under MySQL and Oracle (Refs #10099).

Backport of r12912 from trunk.

Modified: django/branches/releases/1.1.X/django/db/backends/__init__.py
===
--- django/branches/releases/1.1.X/django/db/backends/__init__.py   
2010-04-04 17:06:13 UTC (rev 12913)
+++ django/branches/releases/1.1.X/django/db/backends/__init__.py   
2010-04-04 17:17:46 UTC (rev 12914)
@@ -102,6 +102,7 @@
 # If True, don't use integer foreign keys referring to, e.g., positive
 # integer primary keys.
 related_fields_match_type = False
+allow_sliced_subqueries = True
 
 class BaseDatabaseOperations(object):
 """

Modified: django/branches/releases/1.1.X/django/db/backends/mysql/base.py
===
--- django/branches/releases/1.1.X/django/db/backends/mysql/base.py 
2010-04-04 17:06:13 UTC (rev 12913)
+++ django/branches/releases/1.1.X/django/db/backends/mysql/base.py 
2010-04-04 17:17:46 UTC (rev 12914)
@@ -113,6 +113,7 @@
 update_can_self_select = False
 allows_group_by_pk = True
 related_fields_match_type = True
+allow_sliced_subqueries = False
 
 class DatabaseOperations(BaseDatabaseOperations):
 def date_extract_sql(self, lookup_type, field_name):

Modified: django/branches/releases/1.1.X/django/db/backends/oracle/base.py
===
--- django/branches/releases/1.1.X/django/db/backends/oracle/base.py
2010-04-04 17:06:13 UTC (rev 12913)
+++ django/branches/releases/1.1.X/django/db/backends/oracle/base.py
2010-04-04 17:17:46 UTC (rev 12914)
@@ -51,6 +51,7 @@
 interprets_empty_strings_as_nulls = True
 uses_savepoints = True
 can_return_id_from_insert = True
+allow_sliced_subqueries = False
 
 
 class DatabaseOperations(BaseDatabaseOperations):

Modified: django/branches/releases/1.1.X/django/db/models/query.py
===
--- django/branches/releases/1.1.X/django/db/models/query.py2010-04-04 
17:06:13 UTC (rev 12913)
+++ django/branches/releases/1.1.X/django/db/models/query.py2010-04-04 
17:17:46 UTC (rev 12914)
@@ -7,6 +7,8 @@
 except NameError:
 from sets import Set as set # Python 2.3 fallback
 
+from itertools import izip
+
 from django.db import connection, transaction, IntegrityError
 from django.db.models.aggregates import Aggregate
 from django.db.models.fields import DateField
@@ -387,11 +389,13 @@
 # becoming too long.
 seen_objs = None
 while 1:
-# Collect all the objects to be deleted in this chunk, and all the
+# Collect a chunk of objects to be deleted, and then all the
 # objects that are related to the objects that are to be deleted.
+# The chunking *isn't* done by slicing the del_query because we
+# need to maintain the query cache on del_query (see #12328)
 seen_objs = CollectedObjects(seen_objs)
-for object in del_query[:CHUNK_SIZE]:
-object._collect_sub_objects(seen_objs)
+for i, obj in izip(xrange(CHUNK_SIZE), del_query):
+obj._collect_sub_objects(seen_objs)
 
 if not seen_objs:
 break

Modified: django/branches/releases/1.1.X/django/db/models/sql/query.py
===
--- django/branches/releases/1.1.X/django/db/models/sql/query.py
2010-04-04 17:06:13 UTC (rev 12913)
+++ django/branches/releases/1.1.X/django/db/models/sql/query.py
2010-04-04 17:17:46 UTC (rev 12914)
@@ -456,13 +456,14 @@
 """
 Perform the same functionality as the as_sql() method, returning an
 SQL string and parameters. However, the alias prefixes are bumped
-beforehand (in a copy -- the current query isn't changed) and any
-ordering is removed.
-
+beforehand (in a copy -- the current query isn't changed), and any
+ordering is removed if the query is unsliced.
 Used when nesting this query inside another.
 """
 obj = self.clone()
-obj.clear_ordering(True)
+if obj.low_mark == 0 and o

[Changeset] r12913 - django/trunk/tests/regressiontests/backends

2010-04-04 Thread noreply
Author: russellm
Date: 2010-04-04 12:06:13 -0500 (Sun, 04 Apr 2010)
New Revision: 12913

Modified:
   django/trunk/tests/regressiontests/backends/tests.py
Log:
Fixed #13082 -- Slight modification to an Oracle test to avoid a problem cause 
by teardown behavior. Thanks to stvsmth for the report and patch.

Modified: django/trunk/tests/regressiontests/backends/tests.py
===
--- django/trunk/tests/regressiontests/backends/tests.py2010-04-04 
17:05:43 UTC (rev 12912)
+++ django/trunk/tests/regressiontests/backends/tests.py2010-04-04 
17:06:13 UTC (rev 12913)
@@ -34,8 +34,8 @@
 c.execute('INSERT INTO ltext VALUES (%s)',[long_str])
 c.execute('SELECT text FROM ltext')
 row = c.fetchone()
+self.assertEquals(long_str, row[0].read())
 c.execute('DROP TABLE ltext')
-self.assertEquals(long_str, row[0].read())
 
 class DateQuotingTest(TestCase):
 

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



[Changeset] r12912 - in django/trunk: django/db/backends django/db/backends/mysql django/db/backends/oracle django/db/models django/db/models/sql tests/regressiontests/queries

2010-04-04 Thread noreply
Author: russellm
Date: 2010-04-04 12:05:43 -0500 (Sun, 04 Apr 2010)
New Revision: 12912

Modified:
   django/trunk/django/db/backends/__init__.py
   django/trunk/django/db/backends/mysql/base.py
   django/trunk/django/db/backends/oracle/base.py
   django/trunk/django/db/models/query.py
   django/trunk/django/db/models/sql/compiler.py
   django/trunk/tests/regressiontests/queries/tests.py
Log:
Fixed #12328 -- Corrected the handling of subqueries with ordering and slicing, 
especially when used in delete subqueries. Thanks to Walter Doekes for the 
report.

This fixes a feature that isn't available under MySQL and Oracle (Refs #10099).

Modified: django/trunk/django/db/backends/__init__.py
===
--- django/trunk/django/db/backends/__init__.py 2010-04-03 11:47:46 UTC (rev 
12911)
+++ django/trunk/django/db/backends/__init__.py 2010-04-04 17:05:43 UTC (rev 
12912)
@@ -95,6 +95,7 @@
 # If True, don't use integer foreign keys referring to, e.g., positive
 # integer primary keys.
 related_fields_match_type = False
+allow_sliced_subqueries = True
 
 class BaseDatabaseOperations(object):
 """

Modified: django/trunk/django/db/backends/mysql/base.py
===
--- django/trunk/django/db/backends/mysql/base.py   2010-04-03 11:47:46 UTC 
(rev 12911)
+++ django/trunk/django/db/backends/mysql/base.py   2010-04-04 17:05:43 UTC 
(rev 12912)
@@ -123,6 +123,7 @@
 update_can_self_select = False
 allows_group_by_pk = True
 related_fields_match_type = True
+allow_sliced_subqueries = False
 
 class DatabaseOperations(BaseDatabaseOperations):
 compiler_module = "django.db.backends.mysql.compiler"

Modified: django/trunk/django/db/backends/oracle/base.py
===
--- django/trunk/django/db/backends/oracle/base.py  2010-04-03 11:47:46 UTC 
(rev 12911)
+++ django/trunk/django/db/backends/oracle/base.py  2010-04-04 17:05:43 UTC 
(rev 12912)
@@ -52,6 +52,7 @@
 interprets_empty_strings_as_nulls = True
 uses_savepoints = True
 can_return_id_from_insert = True
+allow_sliced_subqueries = False
 
 
 class DatabaseOperations(BaseDatabaseOperations):

Modified: django/trunk/django/db/models/query.py
===
--- django/trunk/django/db/models/query.py  2010-04-03 11:47:46 UTC (rev 
12911)
+++ django/trunk/django/db/models/query.py  2010-04-04 17:05:43 UTC (rev 
12912)
@@ -3,6 +3,7 @@
 """
 
 from copy import deepcopy
+from itertools import izip
 
 from django.db import connections, router, transaction, IntegrityError
 from django.db.models.aggregates import Aggregate
@@ -429,11 +430,13 @@
 # becoming too long.
 seen_objs = None
 while 1:
-# Collect all the objects to be deleted in this chunk, and all the
+# Collect a chunk of objects to be deleted, and then all the
 # objects that are related to the objects that are to be deleted.
+# The chunking *isn't* done by slicing the del_query because we
+# need to maintain the query cache on del_query (see #12328)
 seen_objs = CollectedObjects(seen_objs)
-for object in del_query[:CHUNK_SIZE]:
-object._collect_sub_objects(seen_objs)
+for i, obj in izip(xrange(CHUNK_SIZE), del_query):
+obj._collect_sub_objects(seen_objs)
 
 if not seen_objs:
 break

Modified: django/trunk/django/db/models/sql/compiler.py
===
--- django/trunk/django/db/models/sql/compiler.py   2010-04-03 11:47:46 UTC 
(rev 12911)
+++ django/trunk/django/db/models/sql/compiler.py   2010-04-04 17:05:43 UTC 
(rev 12912)
@@ -120,13 +120,15 @@
 """
 Perform the same functionality as the as_sql() method, returning an
 SQL string and parameters. However, the alias prefixes are bumped
-beforehand (in a copy -- the current query isn't changed) and any
-ordering is removed.
+beforehand (in a copy -- the current query isn't changed), and any
+ordering is removed if the query is unsliced.
 
 Used when nesting this query inside another.
 """
 obj = self.query.clone()
-obj.clear_ordering(True)
+if obj.low_mark == 0 and obj.high_mark is None:
+# If there is no slicing in use, then we can safely drop all 
ordering
+obj.clear_ordering(True)
 obj.bump_prefix()
 return obj.get_compiler(connection=self.connection).as_sql()
 

Modified: django/trunk/tests/regressiontests/queries/tests.py
===
--- django/trunk/tests/regressiontests/queries/tests.py 2010-04-03 11:47:46 UTC 
(rev 12911)
+++ django/trunk/tes

Re: [Django] #11716: Various methods in django.db.models.fields don't wrap ValueErrors and allow them to escape

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

 I understand that this ticket isn't crucial to the 1.2 release (even
 though it fixes functionality that was changed in 1.2) but it would be
 really fantastic if it got addressed/landed early in the 1.3 cycle. It
 would be incredibly frustrating to do a third version of this patch if
 there were significant DB layer changes as part of 1.3.

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

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



Re: [Django] #12990: New Field Type: JSONField

2010-04-04 Thread Django
#12990: New Field Type: JSONField
---+
  Reporter:  paltman   | Owner:  nobody  
Status:  new   | Milestone:  
 Component:  Database layer (models, ORM)  |   Version:  1.2-beta
Resolution:|  Keywords:  
 Stage:  Design decision needed| Has_patch:  1   
Needs_docs:  0 |   Needs_tests:  0   
Needs_better_patch:  0 |  
---+
Comment (by rubic):

 +1 me too, vote.  I'd really like to see this added to Django.  A single
 implementation of JSONField would be an improvement over the current
 state.

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

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



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

2010-04-04 Thread Django
#5253: serializer for csv format for loaddata and dumpdata
+---
  Reporter:  Adam Schmideg   | Owner:  erob  

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 erob):

 * cc: e.robill...@nfb.ca (removed)
 * cc: e...@gthcfoundation.org (added)

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

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