[Django] #12400: column "X" named in key does not exist error when models.PointField used in unique_together

2009-12-17 Thread Django
#12400: column "X" named in key does not exist error when models.PointField 
used in
unique_together
---+
 Reporter:  monkut |   Owner:  nobody
   Status:  new|   Milestone:
Component:  Uncategorized  | Version:  1.1   
 Keywords: |   Stage:  Unreviewed
Has_patch:  0  |  
---+
 Hit the following error when trying to use a geometry together with Meta:
 unique_together.
 Using posgresql/PostGIS


 Model:


 {{{
 class Data(models.Model):
 X = models.PointField(null=True, blank=True)
 Y = models.IntegerField()
 Meta:
 unique_together = ('X', 'Y')

 }}}


 Exception on trying to syncdb/run test:
 {{{
 Creating table mydata_data
 Traceback (most recent call last):
   File "manage.py", line 11, in 
 execute_manager(settings)
   File "C:\Python26\lib\site-packages\django\core\management\__init__.py",
 line 362, in execute_manager
 utility.execute()
   File "C:\Python26\lib\site-packages\django\core\management\__init__.py",
 line 303, in execute
 self.fetch_command(subcommand).run_from_argv(self.argv)
   File "C:\Python26\lib\site-packages\django\core\management\base.py",
 line 195, in run_from_argv
 self.execute(*args, **options.__dict__)
   File "C:\Python26\lib\site-packages\django\core\management\base.py",
 line 222, in execute
 output = self.handle(*args, **options)
   File "C:\Python26\lib\site-
 packages\django\core\management\commands\test.py", line 23, in handle
 failures = test_runner(test_labels, verbosity=verbosity,
 interactive=interactive)
   File "C:\Python26\lib\site-
 packages\django\contrib\gis\tests\__init__.py", line 135, in run_tests
 create_test_spatial_db(verbosity=verbosity, autoclobber=not
 interactive)
   File "C:\Python26\lib\site-
 packages\django\contrib\gis\db\backend\postgis\creation.py", line 135, in
 create_test_spatial_db
 call_command('syncdb', verbosity=verbosity, interactive=interactive)
   File "C:\Python26\lib\site-packages\django\core\management\__init__.py",
 line 166, in call_command
 return klass.execute(*args, **defaults)
   File "C:\Python26\lib\site-packages\django\core\management\base.py",
 line 222, in execute
 output = self.handle(*args, **options)
   File "C:\Python26\lib\site-packages\django\core\management\base.py",
 line 351, in handle
 return self.handle_noargs(**options)
   File "C:\Python26\lib\site-
 packages\django\core\management\commands\syncdb.py", line 78, in
 handle_noargs
 cursor.execute(statement)
 psycopg2.ProgrammingError: column "X" named in key does not exist
 }}}

 I checked the sql generated and it seems this problem occurs because the
 the geometry column is added *after* the initial table is created.  And
 the UNIQUE restriction is applied on initial table creation.

-- 
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] #12399: cached_db session backend and memcached not working as expected with expiry > 30 days

2009-12-17 Thread Django
#12399: cached_db session backend and memcached not working as expected with 
expiry
> 30 days
---+
  Reporter:  houdinihound  | Owner:  nobody 
Status:  new   | Milestone: 
 Component:  Cache system  |   Version:  1.1
Resolution:|  Keywords:  cached_db session memcached
 Stage:  Unreviewed| Has_patch:  1  
Needs_docs:  0 |   Needs_tests:  0  
Needs_better_patch:  0 |  
---+
Changes (by houdinihound):

  * needs_better_patch:  => 0
  * component:  Uncategorized => Cache system
  * needs_tests:  => 0
  * needs_docs:  => 0

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

--

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




[Django] #12399: cached_db session backend and memcached not working as expected with expiry > 30 days

2009-12-17 Thread Django
#12399: cached_db session backend and memcached not working as expected with 
expiry
> 30 days
-+--
 Reporter:  houdinihound |   Owner:  nobody
   Status:  new  |   Milestone:
Component:  Uncategorized| Version:  1.1   
 Keywords:  cached_db session memcached  |   Stage:  Unreviewed
Has_patch:  1|  
-+--
 Using the  'django.contrib.sessions.backends.cached_db' and setting
 SESSION_COOKIE_AGE to any number of seconds greater than 2592000 (i.e. >
 30 days) with memcached does not to work as intended in that the session
 info is never sent back from the cache.

 Memcached takes an 'expire_in_seconds' argument which can be up to 2592000
 (30 days).  For numbers greater than that it requires a Unix timestamp to
 set the expiry date.

 Currently cached_db.py passes in settings.SESSION_COOKIE_AGE which is
 always a number of seconds. Consequently this works up to 30 days (2592000
 seconds) but if SESSION_COOKIE_AGE is greater than that it does not.

 To illustrate:
 Memcached output with SESSION_COOKIE_AGE = 2592000 (i.e. 30 days):
 {{{
 <280 server listening (udp)
 <288 new client connection
 <288 get 4c35074ef4038b16a2db4f728324206a
 >288 END
 <288 set 4c35074ef4038b16a2db4f728324206a 1 2592000 334
 >288 STORED
 <288 connection closed.
 <288 new client connection
 <288 get 4c35074ef4038b16a2db4f728324206a
 >288 sending key 4c35074ef4038b16a2db4f728324206a
 >288 END
 <288 connection closed.
 <288 new client connection
 <288 get 4c35074ef4038b16a2db4f728324206a
 >288 sending key 4c35074ef4038b16a2db4f728324206a
 >288 END
 }}}

 Works.  After the initial store, the key is requested and sent as
 expected.

 Now with SESSION_COOKIE_AGE = 2592001 (i.e. 30 days + 1 second):
 {{{
 <288 new client connection
 <288 get 4c35074ef4038b16a2db4f728324206a
 >288 END
 <288 set 4c35074ef4038b16a2db4f728324206a 1 2592001 337
 >288 STORED
 <288 connection closed.
 <288 new client connection
 <288 get 4c35074ef4038b16a2db4f728324206a
 >288 END
 <288 set 4c35074ef4038b16a2db4f728324206a 1 2592001 337
 >288 STORED
 <288 connection closed.
 <288 new client connection
 <288 get 4c35074ef4038b16a2db4f728324206a
 >288 END
 <288 set 4c35074ef4038b16a2db4f728324206a 1 2592001 337
 >288 STORED
 <288 connection closed.
 }}}
 The key is initially stored, but each time it is requested it doesn't send
 the data but rather gets it from the db and keeps re-setting the same key
 each time.

 I've patched `load` and `save` in cached_db.py to:[[BR]]
 1) Check if memcached is being used[[BR]]
 2) If so, check if settings.SESSION_COOKIE_AGE > 2592000[[BR]]
 3) If so, add settings.SESSION_COOKIE_AGE to the unix timestamp
 (time.time()) and pass that to memcached.

 which now works as expected when SESSION_COOKIE_AGE > 2592000:
 {{{
 <292 new client connection
 <292 get 4c35074ef4038b16a2db4f728324206a
 >292 END
 <292 set 4c35074ef4038b16a2db4f728324206a 1 1263689307 337
 >292 STORED
 <292 connection closed.
 <292 new client connection
 <292 get 4c35074ef4038b16a2db4f728324206a
 >292 sending key 4c35074ef4038b16a2db4f728324206a
 >292 END
 <292 connection closed.
 <292 new client connection
 <292 get 4c35074ef4038b16a2db4f728324206a
 >292 sending key 4c35074ef4038b16a2db4f728324206a
 >292 END
 <292 connection closed.
 }}}

-- 
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] r11908 - in django/branches/soc2009/multidb: . django/contrib/auth django/contrib/contenttypes django/core/serializers django/db/models docs/topics/db tests/modeltests/fixtures tests/regre

2009-12-17 Thread noreply
Author: Alex
Date: 2009-12-17 19:31:53 -0600 (Thu, 17 Dec 2009)
New Revision: 11908

Modified:
   django/branches/soc2009/multidb/TODO
   django/branches/soc2009/multidb/django/contrib/auth/models.py
   django/branches/soc2009/multidb/django/contrib/contenttypes/generic.py
   django/branches/soc2009/multidb/django/contrib/contenttypes/models.py
   django/branches/soc2009/multidb/django/core/serializers/python.py
   django/branches/soc2009/multidb/django/core/serializers/pyyaml.py
   django/branches/soc2009/multidb/django/core/serializers/xml_serializer.py
   django/branches/soc2009/multidb/django/db/models/manager.py
   django/branches/soc2009/multidb/docs/topics/db/multi-db.txt
   django/branches/soc2009/multidb/tests/modeltests/fixtures/models.py
   
django/branches/soc2009/multidb/tests/regressiontests/fixtures_regress/models.py
   
django/branches/soc2009/multidb/tests/regressiontests/multiple_database/models.py
   
django/branches/soc2009/multidb/tests/regressiontests/multiple_database/tests.py
Log:
[soc2009/multidb]  Cleaned up the interaction between managers and the using() 
method by the addition of a db_manager() method.

Modified: django/branches/soc2009/multidb/TODO
===
--- django/branches/soc2009/multidb/TODO2009-12-18 00:32:10 UTC (rev 
11907)
+++ django/branches/soc2009/multidb/TODO2009-12-18 01:31:53 UTC (rev 
11908)
@@ -7,8 +7,6 @@
  * Modify the admin interface to support multiple databases (doh).
 - Document how it is done
 
- * Make sure we can't get rid of using= arguments everywhere
-
  * Resolve uses of _default_manager
 * django/contrib/databrowse/datastructures.py
 * django/contrib/databrowse/fieldchoices.py

Modified: django/branches/soc2009/multidb/django/contrib/auth/models.py
===
--- django/branches/soc2009/multidb/django/contrib/auth/models.py   
2009-12-18 00:32:10 UTC (rev 11907)
+++ django/branches/soc2009/multidb/django/contrib/auth/models.py   
2009-12-18 01:31:53 UTC (rev 11908)
@@ -10,13 +10,9 @@
 from django.utils.hashcompat import md5_constructor, sha_constructor
 from django.utils.translation import ugettext_lazy as _
 
+
 UNUSABLE_PASSWORD = '!' # This will never be a valid hash
 
-try:
-set
-except NameError:
-from sets import Set as set   # Python 2.3 fallback
-
 def get_hexdigest(algorithm, salt, raw_password):
 """
 Returns a string of the hexdigest of the given plaintext password and salt
@@ -48,8 +44,8 @@
 pass
 
 class PermissionManager(models.Manager):
-def get_by_natural_key(self, codename, app_label, model, using=None):
-return self.using(using).get(
+def get_by_natural_key(self, codename, app_label, model):
+return self.get(
 codename=codename,
 content_type=ContentType.objects.get_by_natural_key(app_label, 
model)
 )
@@ -106,7 +102,7 @@
 return self.name
 
 class UserManager(models.Manager):
-def create_user(self, username, email, password=None, using=None):
+def create_user(self, username, email, password=None):
 "Creates and saves a User with the given username, e-mail and 
password."
 now = datetime.datetime.now()
 user = self.model(None, username, '', '', email.strip().lower(), 
'placeholder', False, True, False, now, now)
@@ -114,15 +110,15 @@
 user.set_password(password)
 else:
 user.set_unusable_password()
-user.save(using=using)
+user.save(using=self.db)
 return user
 
-def create_superuser(self, username, email, password, using=None):
+def create_superuser(self, username, email, password):
 u = self.create_user(username, email, password)
 u.is_staff = True
 u.is_active = True
 u.is_superuser = True
-u.save(using=using)
+u.save(using=self.db)
 return u
 
 def make_random_password(self, length=10, 
allowed_chars='abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'):

Modified: django/branches/soc2009/multidb/django/contrib/contenttypes/generic.py
===
--- django/branches/soc2009/multidb/django/contrib/contenttypes/generic.py  
2009-12-18 00:32:10 UTC (rev 11907)
+++ django/branches/soc2009/multidb/django/contrib/contenttypes/generic.py  
2009-12-18 01:31:53 UTC (rev 11908)
@@ -50,9 +50,9 @@
 # using this model
 ContentType = get_model("contenttypes", "contenttype")
 if obj:
- return ContentType.objects.get_for_model(obj, using=obj._state.db)
+ return 
ContentType.objects.db_manager(obj._state.db).get_for_model(obj)
 elif id:
- return ContentType.objects.get_for_id(id, using=using)
+ return ContentType.objects.db_manager(using).get_for_id(id)
 else:
 # This should never happen. I

Re: [Django] #12398: Add `TypedMultipleChoiceField` to compliment `TypedChoiceField`.

2009-12-17 Thread Django
#12398: Add `TypedMultipleChoiceField` to compliment `TypedChoiceField`.
-+--
  Reporter:  mrmachine   | Owner:  nobody
Status:  new | Milestone:
 Component:  Forms   |   Version:  SVN   
Resolution:  |  Keywords:
 Stage:  Unreviewed  | Has_patch:  1 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Changes (by mrmachine):

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

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

--

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




[Django] #12398: Add `TypedMultipleChoiceField` to compliment `TypedChoiceField`.

2009-12-17 Thread Django
#12398: Add `TypedMultipleChoiceField` to compliment `TypedChoiceField`.
---+
 Reporter:  mrmachine  |   Owner:  nobody
   Status:  new|   Milestone:
Component:  Forms  | Version:  SVN   
 Keywords: |   Stage:  Unreviewed
Has_patch:  1  |  
---+
 Patch includes docs and tests. This could also fix #5481.

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

2009-12-17 Thread noreply
Author: russellm
Date: 2009-12-17 18:32:10 -0600 (Thu, 17 Dec 2009)
New Revision: 11907

Modified:
   django/trunk/docs/topics/serialization.txt
Log:
Corrected an example in the natural key serialization docs. Thanks to Alex 
Gaynor for the report.

Modified: django/trunk/docs/topics/serialization.txt
===
--- django/trunk/docs/topics/serialization.txt  2009-12-17 23:48:40 UTC (rev 
11906)
+++ django/trunk/docs/topics/serialization.txt  2009-12-18 00:32:10 UTC (rev 
11907)
@@ -264,7 +264,7 @@
 
 class PersonManager(models.Manager):
 def get_by_natural_key(self, first_name, last_name):
-return self.filter(first_name=first_name, last_name=last_name)
+return self.get(first_name=first_name, last_name=last_name)
 
 class Person(models.Model):
 objects = PersonManager()

--

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




[Django] #12397: FileSystemStorage(location='/') does not work: SuspiciousOperation

2009-12-17 Thread Django
#12397: FileSystemStorage(location='/') does not work: SuspiciousOperation
--+-
 Reporter:  b...@ben.com   |   Owner:  nobody
   Status:  new   |   Milestone:
Component:  File uploads/storage  | Version:  1.1   
 Keywords:|   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 {{{
 >>> from django.core.files.storage import FileSystemStorage
 >>>
 >>> LOCAL_FS = FileSystemStorage(location='/', base_url='invalid://')
 >>> LOCAL_FS.path('anything')
 Traceback (most recent call last):
   File "", line 1, in 
   File "/usr/local/lib/python2.5/site-
 packages/django/core/files/storage.py", line 214, in path
 raise SuspiciousOperation("Attempted access to '%s' denied." % name)
 SuspiciousOperation: Attempted access to 'anything' denied.
 }}}

 This is caused because safe_join expects the first character after the
 storage.location ('base' in safe_join) to be a separator.  When
 base='/foo' this is true because '/foo/anything' has a '/' after '/foo',
 but when path is '/' you don't get '//anything', you get '/anything', and
 the first character after '/' is 'a'.

 I don't see a way to hack around this because of all the path
 normalization that goes on.  You'd think '/.' might work, but it gets
 normalized and then 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-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] r11906 - django/branches/releases/1.1.X/tests/regressiontests/generic_inline_admin

2009-12-17 Thread noreply
Author: russellm
Date: 2009-12-17 17:48:40 -0600 (Thu, 17 Dec 2009)
New Revision: 11906

Modified:
   
django/branches/releases/1.1.X/tests/regressiontests/generic_inline_admin/tests.py
Log:
[1.1.X] Fixed #12393 -- Parameterized the form output in the 
testGenericInlineFormset test to avoid database PK problems. Thanks to Karen 
for the report.

Backport of r11905 from trunk.

Modified: 
django/branches/releases/1.1.X/tests/regressiontests/generic_inline_admin/tests.py
===
--- 
django/branches/releases/1.1.X/tests/regressiontests/generic_inline_admin/tests.py
  2009-12-17 23:47:45 UTC (rev 11905)
+++ 
django/branches/releases/1.1.X/tests/regressiontests/generic_inline_admin/tests.py
  2009-12-17 23:48:40 UTC (rev 11906)
@@ -89,22 +89,22 @@
 # Works with no queryset
 formset = EpisodeMediaFormSet(instance=e)
 self.assertEquals(len(formset.forms), 5)
-self.assertEquals(formset.forms[0].as_p(), 'Url: 
http://example.com/podcast.mp3"; maxlength="200" />')
-self.assertEquals(formset.forms[1].as_p(), 'Url: 
http://example.com/logo.png"; maxlength="200" />')
+self.assertEquals(formset.forms[0].as_p(), 'Url: 
http://example.com/podcast.mp3"; maxlength="200" />' % 
self.mp3_media_pk)
+self.assertEquals(formset.forms[1].as_p(), 'Url: 
http://example.com/logo.png"; maxlength="200" />' % 
self.png_media_pk)
 self.assertEquals(formset.forms[2].as_p(), 'Url: 
')
 
 # A queryset can be used to alter display ordering
 formset = EpisodeMediaFormSet(instance=e, 
queryset=Media.objects.order_by('url'))
 self.assertEquals(len(formset.forms), 5)
-self.assertEquals(formset.forms[0].as_p(), 'Url: 
http://example.com/logo.png"; maxlength="200" />')
-self.assertEquals(formset.forms[1].as_p(), 'Url: 
http://example.com/podcast.mp3"; maxlength="200" />')
+self.assertEquals(formset.forms[0].as_p(), 'Url: 
http://example.com/logo.png"; maxlength="200" />' % 
self.png_media_pk)
+self.assertEquals(formset.forms[1].as_p(), 'Url: 
http://example.com/podcast.mp3"; maxlength="200" />' % 
self.mp3_media_pk)
 self.assertEquals(formset.forms[2].as_p(), 'Url: 
')
 
 
 # Works with a queryset that omits items
 formset = EpisodeMediaFormSet(instance=e, 
queryset=Media.objects.filter(url__endswith=".png"))
 self.assertEquals(len(formset.forms), 4)
-self.assertEquals(formset.forms[0].as_p(), 'Url: 
http://example.com/logo.png"; maxlength="200" />')
+self.assertEquals(formset.forms[0].as_p(), 'Url: 
http://example.com/logo.png"; maxlength="200" />' % 
self.png_media_pk)
 self.assertEquals(formset.forms[1].as_p(), 'Url: 
')
 
 

--

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] r11905 - django/trunk/tests/regressiontests/generic_inline_admin

2009-12-17 Thread noreply
Author: russellm
Date: 2009-12-17 17:47:45 -0600 (Thu, 17 Dec 2009)
New Revision: 11905

Modified:
   django/trunk/tests/regressiontests/generic_inline_admin/tests.py
Log:
Fixed #12393 -- Parameterized the form output in the testGenericInlineFormset 
test to avoid database PK problems. Thanks to Karen for the report.

Modified: django/trunk/tests/regressiontests/generic_inline_admin/tests.py
===
--- django/trunk/tests/regressiontests/generic_inline_admin/tests.py
2009-12-17 22:18:23 UTC (rev 11904)
+++ django/trunk/tests/regressiontests/generic_inline_admin/tests.py
2009-12-17 23:47:45 UTC (rev 11905)
@@ -89,22 +89,22 @@
 # Works with no queryset
 formset = EpisodeMediaFormSet(instance=e)
 self.assertEquals(len(formset.forms), 5)
-self.assertEquals(formset.forms[0].as_p(), 'Url: 
http://example.com/podcast.mp3"; maxlength="200" />')
-self.assertEquals(formset.forms[1].as_p(), 'Url: 
http://example.com/logo.png"; maxlength="200" />')
+self.assertEquals(formset.forms[0].as_p(), 'Url: 
http://example.com/podcast.mp3"; maxlength="200" />' % 
self.mp3_media_pk)
+self.assertEquals(formset.forms[1].as_p(), 'Url: 
http://example.com/logo.png"; maxlength="200" />' % 
self.png_media_pk)
 self.assertEquals(formset.forms[2].as_p(), 'Url: 
')
 
 # A queryset can be used to alter display ordering
 formset = EpisodeMediaFormSet(instance=e, 
queryset=Media.objects.order_by('url'))
 self.assertEquals(len(formset.forms), 5)
-self.assertEquals(formset.forms[0].as_p(), 'Url: 
http://example.com/logo.png"; maxlength="200" />')
-self.assertEquals(formset.forms[1].as_p(), 'Url: 
http://example.com/podcast.mp3"; maxlength="200" />')
+self.assertEquals(formset.forms[0].as_p(), 'Url: 
http://example.com/logo.png"; maxlength="200" />' % 
self.png_media_pk)
+self.assertEquals(formset.forms[1].as_p(), 'Url: 
http://example.com/podcast.mp3"; maxlength="200" />' % 
self.mp3_media_pk)
 self.assertEquals(formset.forms[2].as_p(), 'Url: 
')
 
 
 # Works with a queryset that omits items
 formset = EpisodeMediaFormSet(instance=e, 
queryset=Media.objects.filter(url__endswith=".png"))
 self.assertEquals(len(formset.forms), 4)
-self.assertEquals(formset.forms[0].as_p(), 'Url: 
http://example.com/logo.png"; maxlength="200" />')
+self.assertEquals(formset.forms[0].as_p(), 'Url: 
http://example.com/logo.png"; maxlength="200" />' % 
self.png_media_pk)
 self.assertEquals(formset.forms[1].as_p(), 'Url: 
')
 
 

--

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] #9749: ModelAdmin should allow specifying Changelist class to further modify Changelist behavior

2009-12-17 Thread Django
#9749: ModelAdmin should allow specifying Changelist class to further modify
Changelist behavior
---+
  Reporter:  anonymous | Owner:  jezdez 
   
Status:  assigned  | Milestone:  1.2
   
 Component:  django.contrib.admin  |   Version:  SVN
   
Resolution:|  Keywords:  ModelAdmin 
Changelist subclass
 Stage:  Ready for checkin | Has_patch:  1  
   
Needs_docs:  0 |   Needs_tests:  0  
   
Needs_better_patch:  0 |  
---+
Changes (by jezdez):

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

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

--

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




Re: [Django] #9749: ModelAdmin should allow specifying Changelist class to further modify Changelist behavior

2009-12-17 Thread Django
#9749: ModelAdmin should allow specifying Changelist class to further modify
Changelist behavior
---+
  Reporter:  anonymous | Owner:  brosner
   
Status:  new   | Milestone:  1.2
   
 Component:  django.contrib.admin  |   Version:  1.0
   
Resolution:|  Keywords:  ModelAdmin 
Changelist subclass
 Stage:  Ready for checkin | Has_patch:  1  
   
Needs_docs:  0 |   Needs_tests:  0  
   
Needs_better_patch:  0 |  
---+
Changes (by floguy):

 * cc: flo...@gmail.com (added)

Comment:

 I've approached this in a slightly different way.  My way involves
 mimicking the way some of the other methods on the ModelAdmin class works
 (get_form, etc) by implementing a method to provide the class.  This way
 is slightly more flexible due to the availability of more information
 (like everything from the request).  I hope this patch makes it in,
 because right now trying to just slightly change behavior involves a whole
 lot of copy/paste.

 I understand one concern with this is that it could make ChangeList a more
 public API, but it's still really not.  For example, it's still not
 documented.  But it does give greater flexibility at a per-request level,
 and that's what I'm after.

-- 
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] r11904 - in django/branches/soc2009/multidb: django/contrib/admin django/contrib/gis/geos/tests django/contrib/gis/tests/layermap django/db/models django/db/models/fields django/db/models/

2009-12-17 Thread noreply
Author: Alex
Date: 2009-12-17 16:18:23 -0600 (Thu, 17 Dec 2009)
New Revision: 11904

Added:
   django/branches/soc2009/multidb/django/utils/copycompat.py
Modified:
   django/branches/soc2009/multidb/django/contrib/admin/widgets.py
   django/branches/soc2009/multidb/django/contrib/gis/geos/tests/test_geos.py
   
django/branches/soc2009/multidb/django/contrib/gis/geos/tests/test_geos_mutation.py
   django/branches/soc2009/multidb/django/contrib/gis/tests/layermap/tests.py
   django/branches/soc2009/multidb/django/db/models/base.py
   django/branches/soc2009/multidb/django/db/models/expressions.py
   django/branches/soc2009/multidb/django/db/models/fields/__init__.py
   django/branches/soc2009/multidb/django/db/models/fields/files.py
   django/branches/soc2009/multidb/django/db/models/manager.py
   django/branches/soc2009/multidb/django/db/models/query.py
   django/branches/soc2009/multidb/django/db/models/query_utils.py
   django/branches/soc2009/multidb/django/db/models/sql/query.py
   django/branches/soc2009/multidb/django/forms/fields.py
   django/branches/soc2009/multidb/django/forms/forms.py
   django/branches/soc2009/multidb/django/forms/widgets.py
   django/branches/soc2009/multidb/django/http/__init__.py
   django/branches/soc2009/multidb/django/utils/_decimal.py
   django/branches/soc2009/multidb/django/utils/datastructures.py
   django/branches/soc2009/multidb/django/utils/functional.py
   django/branches/soc2009/multidb/django/utils/tree.py
   
django/branches/soc2009/multidb/tests/regressiontests/dispatch/tests/test_dispatcher.py
   django/branches/soc2009/multidb/tests/regressiontests/extra_regress/models.py
   django/branches/soc2009/multidb/tests/regressiontests/utils/tests.py
Log:
[soc2009/multidb] Merged up to trunk r11901.

Modified: django/branches/soc2009/multidb/django/contrib/admin/widgets.py
===
--- django/branches/soc2009/multidb/django/contrib/admin/widgets.py 
2009-12-17 22:11:39 UTC (rev 11903)
+++ django/branches/soc2009/multidb/django/contrib/admin/widgets.py 
2009-12-17 22:18:23 UTC (rev 11904)
@@ -2,7 +2,7 @@
 Form Widget classes specific to the Django admin site.
 """
 
-import copy
+import django.utils.copycompat as copy
 
 from django import forms
 from django.forms.widgets import RadioFieldRenderer

Modified: 
django/branches/soc2009/multidb/django/contrib/gis/geos/tests/test_geos.py
===
--- django/branches/soc2009/multidb/django/contrib/gis/geos/tests/test_geos.py  
2009-12-17 22:11:39 UTC (rev 11903)
+++ django/branches/soc2009/multidb/django/contrib/gis/geos/tests/test_geos.py  
2009-12-17 22:18:23 UTC (rev 11904)
@@ -821,7 +821,7 @@
 
 def test22_copy(self):
 "Testing use with the Python `copy` module."
-import copy
+import django.utils.copycompat as copy
 poly = GEOSGeometry('POLYGON((0 0, 0 23, 23 23, 23 0, 0 0), (5 5, 5 
10, 10 10, 10 5, 5 5))')
 cpy1 = copy.copy(poly)
 cpy2 = copy.deepcopy(poly)

Modified: 
django/branches/soc2009/multidb/django/contrib/gis/geos/tests/test_geos_mutation.py
===
--- 
django/branches/soc2009/multidb/django/contrib/gis/geos/tests/test_geos_mutation.py
 2009-12-17 22:11:39 UTC (rev 11903)
+++ 
django/branches/soc2009/multidb/django/contrib/gis/geos/tests/test_geos_mutation.py
 2009-12-17 22:18:23 UTC (rev 11904)
@@ -2,9 +2,11 @@
 # Modified from original contribution by Aryeh Leib Taurog, which was
 # released under the New BSD license.
 import unittest
+
+import django.utils.copycompat as copy
+
 from django.contrib.gis.geos import *
 from django.contrib.gis.geos.error import GEOSIndexError
-import copy
 
 def getItem(o,i): return o[i]
 def delItem(o,i): del o[i]

Modified: 
django/branches/soc2009/multidb/django/contrib/gis/tests/layermap/tests.py
===
--- django/branches/soc2009/multidb/django/contrib/gis/tests/layermap/tests.py  
2009-12-17 22:11:39 UTC (rev 11903)
+++ django/branches/soc2009/multidb/django/contrib/gis/tests/layermap/tests.py  
2009-12-17 22:18:23 UTC (rev 11904)
@@ -1,11 +1,15 @@
-import os, unittest
-from copy import copy
+import os
+import unittest
 from decimal import Decimal
-from models import City, County, CountyFeat, Interstate, ICity1, ICity2, 
State, city_mapping, co_mapping, cofeat_mapping, inter_mapping
-from django.contrib.gis.utils.layermapping import LayerMapping, LayerMapError, 
InvalidDecimal, MissingForeignKey
+
+from django.utils.copycompat import copy
+
 from django.contrib.gis.gdal import DataSource
 from django.contrib.gis.tests.utils import mysql
+from django.contrib.gis.utils.layermapping import LayerMapping, LayerMapError, 
InvalidDecimal, MissingForeignKey
 
+from models import City, County, CountyFeat, Interstate, ICity1, ICity2, 
State, city_mapping, co_mapping, cofeat_mapping, in

[Changeset] r11903 - in django/branches/releases/1.1.X: django/contrib/admin django/contrib/gis/geos/tests django/contrib/gis/tests/layermap django/db/models django/db/models/fields django/db/models/s

2009-12-17 Thread noreply
Author: jacob
Date: 2009-12-17 16:11:39 -0600 (Thu, 17 Dec 2009)
New Revision: 11903

Added:
   django/branches/releases/1.1.X/django/utils/copycompat.py
Modified:
   django/branches/releases/1.1.X/django/contrib/admin/widgets.py
   django/branches/releases/1.1.X/django/contrib/gis/geos/tests/test_geos.py
   
django/branches/releases/1.1.X/django/contrib/gis/geos/tests/test_geos_mutation.py
   django/branches/releases/1.1.X/django/contrib/gis/tests/layermap/tests.py
   django/branches/releases/1.1.X/django/db/models/base.py
   django/branches/releases/1.1.X/django/db/models/expressions.py
   django/branches/releases/1.1.X/django/db/models/fields/__init__.py
   django/branches/releases/1.1.X/django/db/models/fields/files.py
   django/branches/releases/1.1.X/django/db/models/manager.py
   django/branches/releases/1.1.X/django/db/models/query.py
   django/branches/releases/1.1.X/django/db/models/query_utils.py
   django/branches/releases/1.1.X/django/db/models/sql/query.py
   django/branches/releases/1.1.X/django/forms/fields.py
   django/branches/releases/1.1.X/django/forms/forms.py
   django/branches/releases/1.1.X/django/forms/widgets.py
   django/branches/releases/1.1.X/django/http/__init__.py
   django/branches/releases/1.1.X/django/utils/_decimal.py
   django/branches/releases/1.1.X/django/utils/datastructures.py
   django/branches/releases/1.1.X/django/utils/functional.py
   django/branches/releases/1.1.X/django/utils/tree.py
   
django/branches/releases/1.1.X/tests/regressiontests/dispatch/tests/test_dispatcher.py
   django/branches/releases/1.1.X/tests/regressiontests/extra_regress/models.py
   django/branches/releases/1.1.X/tests/regressiontests/utils/tests.py
Log:
[1.1.X] Fixed #11753 - Q objects with callables no longer explode on Python 
2.4. Thanks, Jeremy Dunck.

Backport of [11901].

Modified: django/branches/releases/1.1.X/django/contrib/admin/widgets.py
===
--- django/branches/releases/1.1.X/django/contrib/admin/widgets.py  
2009-12-17 22:07:42 UTC (rev 11902)
+++ django/branches/releases/1.1.X/django/contrib/admin/widgets.py  
2009-12-17 22:11:39 UTC (rev 11903)
@@ -2,7 +2,7 @@
 Form Widget classes specific to the Django admin site.
 """
 
-import copy
+import django.utils.copycompat as copy
 
 from django import forms
 from django.forms.widgets import RadioFieldRenderer

Modified: 
django/branches/releases/1.1.X/django/contrib/gis/geos/tests/test_geos.py
===
--- django/branches/releases/1.1.X/django/contrib/gis/geos/tests/test_geos.py   
2009-12-17 22:07:42 UTC (rev 11902)
+++ django/branches/releases/1.1.X/django/contrib/gis/geos/tests/test_geos.py   
2009-12-17 22:11:39 UTC (rev 11903)
@@ -778,7 +778,7 @@
 
 def test22_copy(self):
 "Testing use with the Python `copy` module."
-import copy
+import django.utils.copycompat as copy
 poly = GEOSGeometry('POLYGON((0 0, 0 23, 23 23, 23 0, 0 0), (5 5, 5 
10, 10 10, 10 5, 5 5))')
 cpy1 = copy.copy(poly)
 cpy2 = copy.deepcopy(poly)

Modified: 
django/branches/releases/1.1.X/django/contrib/gis/geos/tests/test_geos_mutation.py
===
--- 
django/branches/releases/1.1.X/django/contrib/gis/geos/tests/test_geos_mutation.py
  2009-12-17 22:07:42 UTC (rev 11902)
+++ 
django/branches/releases/1.1.X/django/contrib/gis/geos/tests/test_geos_mutation.py
  2009-12-17 22:11:39 UTC (rev 11903)
@@ -2,9 +2,11 @@
 # Modified from original contribution by Aryeh Leib Taurog, which was
 # released under the New BSD license.
 import unittest
+
+import django.utils.copycompat as copy
+
 from django.contrib.gis.geos import *
 from django.contrib.gis.geos.error import GEOSIndexError
-import copy
 
 def getItem(o,i): return o[i]
 def delItem(o,i): del o[i]

Modified: 
django/branches/releases/1.1.X/django/contrib/gis/tests/layermap/tests.py
===
--- django/branches/releases/1.1.X/django/contrib/gis/tests/layermap/tests.py   
2009-12-17 22:07:42 UTC (rev 11902)
+++ django/branches/releases/1.1.X/django/contrib/gis/tests/layermap/tests.py   
2009-12-17 22:11:39 UTC (rev 11903)
@@ -1,10 +1,10 @@
 import os, unittest
-from copy import copy
 from decimal import Decimal
 from models import City, County, CountyFeat, Interstate, ICity1, ICity2, 
State, city_mapping, co_mapping, cofeat_mapping, inter_mapping
 from django.contrib.gis.db.backend import SpatialBackend
 from django.contrib.gis.utils.layermapping import LayerMapping, LayerMapError, 
InvalidDecimal, MissingForeignKey
 from django.contrib.gis.gdal import DataSource
+from django.utils.copycompat import copy
 
 shp_path = os.path.dirname(__file__)
 city_shp = os.path.join(shp_path, '../data/cities/cities.shp')

Modified: django/branches/releases/1.1.X/django/db/models/base.py
==

[Changeset] r11902 - in django/branches/soc2009/multidb: . django/contrib/admin django/contrib/gis django/contrib/gis/tests django/db/backends/mysql django/db/backends/oracle django/db/backends/postgr

2009-12-17 Thread noreply
Author: Alex
Date: 2009-12-17 16:07:42 -0600 (Thu, 17 Dec 2009)
New Revision: 11902

Modified:
   django/branches/soc2009/multidb/AUTHORS
   django/branches/soc2009/multidb/django/contrib/admin/options.py
   django/branches/soc2009/multidb/django/contrib/gis/measure.py
   django/branches/soc2009/multidb/django/contrib/gis/tests/test_measure.py
   django/branches/soc2009/multidb/django/db/backends/mysql/creation.py
   django/branches/soc2009/multidb/django/db/backends/mysql/introspection.py
   django/branches/soc2009/multidb/django/db/backends/oracle/creation.py
   django/branches/soc2009/multidb/django/db/backends/oracle/introspection.py
   django/branches/soc2009/multidb/django/db/backends/postgresql/creation.py
   
django/branches/soc2009/multidb/django/db/backends/postgresql/introspection.py
   django/branches/soc2009/multidb/django/db/backends/sqlite3/creation.py
   django/branches/soc2009/multidb/django/db/backends/sqlite3/introspection.py
   django/branches/soc2009/multidb/django/db/models/fields/__init__.py
   django/branches/soc2009/multidb/docs/ref/models/fields.txt
   django/branches/soc2009/multidb/docs/topics/forms/modelforms.txt
   django/branches/soc2009/multidb/tests/modeltests/model_forms/models.py
   
django/branches/soc2009/multidb/tests/regressiontests/fixtures_regress/models.py
   django/branches/soc2009/multidb/tests/regressiontests/introspection/models.py
   django/branches/soc2009/multidb/tests/regressiontests/introspection/tests.py
   django/branches/soc2009/multidb/tests/regressiontests/model_fields/models.py
   django/branches/soc2009/multidb/tests/regressiontests/model_fields/tests.py
   
django/branches/soc2009/multidb/tests/regressiontests/serializers_regress/models.py
   
django/branches/soc2009/multidb/tests/regressiontests/serializers_regress/tests.py
Log:
[soc2009/multidb] Merged up to trunk r11900.

Modified: django/branches/soc2009/multidb/AUTHORS
===
--- django/branches/soc2009/multidb/AUTHORS 2009-12-17 22:06:41 UTC (rev 
11901)
+++ django/branches/soc2009/multidb/AUTHORS 2009-12-17 22:07:42 UTC (rev 
11902)
@@ -246,6 +246,7 @@
 Cameron Knight (ckknight)
 Nena Kojadin 
 Igor Kolar 
+Tomáš Kopeček 
 Gasper Koren
 Martin Kosír 
 Arthur Koziel 

Modified: django/branches/soc2009/multidb/django/contrib/admin/options.py
===
--- django/branches/soc2009/multidb/django/contrib/admin/options.py 
2009-12-17 22:06:41 UTC (rev 11901)
+++ django/branches/soc2009/multidb/django/contrib/admin/options.py 
2009-12-17 22:07:42 UTC (rev 11902)
@@ -42,14 +42,15 @@
 'form_class': forms.SplitDateTimeField,
 'widget': widgets.AdminSplitDateTime
 },
-models.DateField:{'widget': widgets.AdminDateWidget},
-models.TimeField:{'widget': widgets.AdminTimeWidget},
-models.TextField:{'widget': widgets.AdminTextareaWidget},
-models.URLField: {'widget': widgets.AdminURLFieldWidget},
-models.IntegerField: {'widget': widgets.AdminIntegerFieldWidget},
-models.CharField:{'widget': widgets.AdminTextInputWidget},
-models.ImageField:   {'widget': widgets.AdminFileWidget},
-models.FileField:{'widget': widgets.AdminFileWidget},
+models.DateField:   {'widget': widgets.AdminDateWidget},
+models.TimeField:   {'widget': widgets.AdminTimeWidget},
+models.TextField:   {'widget': widgets.AdminTextareaWidget},
+models.URLField:{'widget': widgets.AdminURLFieldWidget},
+models.IntegerField:{'widget': widgets.AdminIntegerFieldWidget},
+models.BigIntegerField: {'widget': widgets.AdminIntegerFieldWidget},
+models.CharField:   {'widget': widgets.AdminTextInputWidget},
+models.ImageField:  {'widget': widgets.AdminFileWidget},
+models.FileField:   {'widget': widgets.AdminFileWidget},
 }
 
 

Modified: django/branches/soc2009/multidb/django/contrib/gis/measure.py
===
--- django/branches/soc2009/multidb/django/contrib/gis/measure.py   
2009-12-17 22:06:41 UTC (rev 11901)
+++ django/branches/soc2009/multidb/django/contrib/gis/measure.py   
2009-12-17 22:07:42 UTC (rev 11902)
@@ -27,7 +27,7 @@
 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 """
-Distance and Area objects to allow for sensible and convienient calculation 
+Distance and Area objects to allow for sensible and convienient calculation
 and conversions.
 
 Authors: Robert Coup, Justin Bronn
@@ -70,7 +70,7 @@
 @classmethod
 def unit_attname(cls, unit_str):
 """
-Retrieves the unit attribute name for the given unit string.  
+Retrieves the unit attribute name for the given unit string.
 For example, if the given unit string is 'metre', 'm' would be 
returned.
 An exception is raised if an attribut

[Changeset] r11901 - in django/trunk: django/contrib/admin django/contrib/gis/geos/tests django/contrib/gis/tests/layermap django/db/models django/db/models/fields django/db/models/sql django/forms dj

2009-12-17 Thread noreply
Author: jacob
Date: 2009-12-17 16:06:41 -0600 (Thu, 17 Dec 2009)
New Revision: 11901

Added:
   django/trunk/django/utils/copycompat.py
Modified:
   django/trunk/django/contrib/admin/widgets.py
   django/trunk/django/contrib/gis/geos/tests/test_geos.py
   django/trunk/django/contrib/gis/geos/tests/test_geos_mutation.py
   django/trunk/django/contrib/gis/tests/layermap/tests.py
   django/trunk/django/db/models/base.py
   django/trunk/django/db/models/expressions.py
   django/trunk/django/db/models/fields/__init__.py
   django/trunk/django/db/models/fields/files.py
   django/trunk/django/db/models/manager.py
   django/trunk/django/db/models/query.py
   django/trunk/django/db/models/query_utils.py
   django/trunk/django/db/models/sql/query.py
   django/trunk/django/forms/fields.py
   django/trunk/django/forms/forms.py
   django/trunk/django/forms/widgets.py
   django/trunk/django/http/__init__.py
   django/trunk/django/utils/_decimal.py
   django/trunk/django/utils/datastructures.py
   django/trunk/django/utils/functional.py
   django/trunk/django/utils/tree.py
   django/trunk/tests/regressiontests/dispatch/tests/test_dispatcher.py
   django/trunk/tests/regressiontests/extra_regress/models.py
   django/trunk/tests/regressiontests/utils/tests.py
Log:
Fixed #11753 - Q objects with callables no longer explode on Python 2.4. 
Thanks, Jeremy Dunck.

Modified: django/trunk/django/contrib/admin/widgets.py
===
--- django/trunk/django/contrib/admin/widgets.py2009-12-17 21:54:37 UTC 
(rev 11900)
+++ django/trunk/django/contrib/admin/widgets.py2009-12-17 22:06:41 UTC 
(rev 11901)
@@ -2,7 +2,7 @@
 Form Widget classes specific to the Django admin site.
 """
 
-import copy
+import django.utils.copycompat as copy
 
 from django import forms
 from django.forms.widgets import RadioFieldRenderer

Modified: django/trunk/django/contrib/gis/geos/tests/test_geos.py
===
--- django/trunk/django/contrib/gis/geos/tests/test_geos.py 2009-12-17 
21:54:37 UTC (rev 11900)
+++ django/trunk/django/contrib/gis/geos/tests/test_geos.py 2009-12-17 
22:06:41 UTC (rev 11901)
@@ -821,7 +821,7 @@
 
 def test22_copy(self):
 "Testing use with the Python `copy` module."
-import copy
+import django.utils.copycompat as copy
 poly = GEOSGeometry('POLYGON((0 0, 0 23, 23 23, 23 0, 0 0), (5 5, 5 
10, 10 10, 10 5, 5 5))')
 cpy1 = copy.copy(poly)
 cpy2 = copy.deepcopy(poly)

Modified: django/trunk/django/contrib/gis/geos/tests/test_geos_mutation.py
===
--- django/trunk/django/contrib/gis/geos/tests/test_geos_mutation.py
2009-12-17 21:54:37 UTC (rev 11900)
+++ django/trunk/django/contrib/gis/geos/tests/test_geos_mutation.py
2009-12-17 22:06:41 UTC (rev 11901)
@@ -2,9 +2,11 @@
 # Modified from original contribution by Aryeh Leib Taurog, which was
 # released under the New BSD license.
 import unittest
+
+import django.utils.copycompat as copy
+
 from django.contrib.gis.geos import *
 from django.contrib.gis.geos.error import GEOSIndexError
-import copy
 
 def getItem(o,i): return o[i]
 def delItem(o,i): del o[i]

Modified: django/trunk/django/contrib/gis/tests/layermap/tests.py
===
--- django/trunk/django/contrib/gis/tests/layermap/tests.py 2009-12-17 
21:54:37 UTC (rev 11900)
+++ django/trunk/django/contrib/gis/tests/layermap/tests.py 2009-12-17 
22:06:41 UTC (rev 11901)
@@ -1,10 +1,10 @@
 import os, unittest
-from copy import copy
 from decimal import Decimal
 from models import City, County, CountyFeat, Interstate, ICity1, ICity2, 
State, city_mapping, co_mapping, cofeat_mapping, inter_mapping
 from django.contrib.gis.db.backend import SpatialBackend
 from django.contrib.gis.utils.layermapping import LayerMapping, LayerMapError, 
InvalidDecimal, MissingForeignKey
 from django.contrib.gis.gdal import DataSource
+from django.utils.copycompat import copy
 
 shp_path = os.path.dirname(__file__)
 city_shp = os.path.join(shp_path, '../data/cities/cities.shp')

Modified: django/trunk/django/db/models/base.py
===
--- django/trunk/django/db/models/base.py   2009-12-17 21:54:37 UTC (rev 
11900)
+++ django/trunk/django/db/models/base.py   2009-12-17 22:06:41 UTC (rev 
11901)
@@ -1,4 +1,3 @@
-import copy
 import types
 import sys
 import os
@@ -13,6 +12,7 @@
 from django.db import connection, transaction, DatabaseError
 from django.db.models import signals
 from django.db.models.loading import register_models, get_model
+import django.utils.copycompat as copy
 from django.utils.functional import curry
 from django.utils.encoding import smart_str, force_unicode, smart_unicode
 from django.conf import settings

Modified: django/trunk/django/db/models/expressio

[Changeset] r11900 - django/trunk/tests/regressiontests/fixtures_regress

2009-12-17 Thread noreply
Author: jacob
Date: 2009-12-17 15:54:37 -0600 (Thu, 17 Dec 2009)
New Revision: 11900

Modified:
   django/trunk/tests/regressiontests/fixtures_regress/models.py
Log:
Fixed #12395 - fixed test suite flushing problems on Postgres, MySQL.

Modified: django/trunk/tests/regressiontests/fixtures_regress/models.py
===
--- django/trunk/tests/regressiontests/fixtures_regress/models.py   
2009-12-17 18:29:05 UTC (rev 11899)
+++ django/trunk/tests/regressiontests/fixtures_regress/models.py   
2009-12-17 21:54:37 UTC (rev 11900)
@@ -129,6 +129,49 @@
 ', '.join(s.name for s in self.stores.all())
 )
 
+# ome models with pathological circular dependencies
+class Circle1(models.Model):
+name = models.CharField(max_length=255)
+def natural_key(self):
+return self.name
+natural_key.dependencies = ['fixtures_regress.circle2']
+
+class Circle2(models.Model):
+name = models.CharField(max_length=255)
+def natural_key(self):
+return self.name
+natural_key.dependencies = ['fixtures_regress.circle1']
+
+class Circle3(models.Model):
+name = models.CharField(max_length=255)
+def natural_key(self):
+return self.name
+natural_key.dependencies = ['fixtures_regress.circle3']
+
+class Circle4(models.Model):
+name = models.CharField(max_length=255)
+def natural_key(self):
+return self.name
+natural_key.dependencies = ['fixtures_regress.circle5']
+
+class Circle5(models.Model):
+name = models.CharField(max_length=255)
+def natural_key(self):
+return self.name
+natural_key.dependencies = ['fixtures_regress.circle6']
+
+class Circle6(models.Model):
+name = models.CharField(max_length=255)
+def natural_key(self):
+return self.name
+natural_key.dependencies = ['fixtures_regress.circle4']
+
+class ExternalDependency(models.Model):
+name = models.CharField(max_length=255)
+def natural_key(self):
+return self.name
+natural_key.dependencies = ['fixtures_regress.book']
+
 __test__ = {'API_TESTS':"""
 >>> from django.core import management
 
@@ -235,8 +278,7 @@
 [{"pk": 1, "model": "fixtures_regress.animal", "fields": {"count": 3, 
"weight": 1.2, "name": "Lion", "latin_name": "Panthera leo"}}, {"pk": 2, 
"model": "fixtures_regress.animal", "fields": {"count": 2, "weight": 2.29..., 
"name": "Platypus", "latin_name": "Ornithorhynchus anatinus"}}, {"pk": 10, 
"model": "fixtures_regress.animal", "fields": {"count": 42, "weight": 1.2, 
"name": "Emu", "latin_name": "Dromaius novaehollandiae"}}]
 
 ###
-# Regression for #11428 - Proxy models aren't included
-# when you run dumpdata over an entire app
+# Regression for #11428 - Proxy models aren't included when you dumpdata 
 
 # Flush out the database first
 >>> management.call_command('reset', 'fixtures_regress', interactive=False, 
 >>> verbosity=0)
@@ -245,7 +287,7 @@
 >>> Widget(name='grommet').save()
 
 # Dump data for the entire app. The proxy class shouldn't be included
->>> management.call_command('dumpdata', 'fixtures_regress', format='json')
+>>> management.call_command('dumpdata', 'fixtures_regress.widget', 
'fixtures_regress.widgetproxy', format='json')
 [{"pk": 1, "model": "fixtures_regress.widget", "fields": {"name": "grommet"}}]
 
 ###
@@ -258,49 +300,6 @@
 
 # Now lets check the dependency sorting explicitly
 
-# First Some models with pathological circular dependencies
->>> class Circle1(models.Model):
-... name = models.CharField(max_length=255)
-... def natural_key(self):
-... return self.name
-... natural_key.dependencies = ['fixtures_regress.circle2']
-
->>> class Circle2(models.Model):
-... name = models.CharField(max_length=255)
-... def natural_key(self):
-... return self.name
-... natural_key.dependencies = ['fixtures_regress.circle1']
-
->>> class Circle3(models.Model):
-... name = models.CharField(max_length=255)
-... def natural_key(self):
-... return self.name
-... natural_key.dependencies = ['fixtures_regress.circle3']
-
->>> class Circle4(models.Model):
-... name = models.CharField(max_length=255)
-... def natural_key(self):
-... return self.name
-... natural_key.dependencies = ['fixtures_regress.circle5']
-
->>> class Circle5(models.Model):
-... name = models.CharField(max_length=255)
-... def natural_key(self):
-... return self.name
-... natural_key.dependencies = ['fixtures_regress.circle6']
-
->>> class Circle6(models.Model):
-... name = models.CharField(max_length=255)
-... def natural_key(self):
-... return self.name
-... natural_key.dependencies = ['fixtures_regress.circle4']
-
->>> class ExternalDependency(models.Model):
-... name = models.CharField(max_length=255)
-... def natural_key(self):
-... return self.name
-...  

Re: [Django] #12165: Ability to use SQL functions in queries

2009-12-17 Thread Django
#12165: Ability to use SQL functions in queries
---+
  Reporter:  premalshah| Owner:  nobody 

Status:  new   | Milestone:  1.2

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

Resolution:|  Keywords:  mysql 
functions
 Stage:  Design decision needed| Has_patch:  0  

Needs_docs:  0 |   Needs_tests:  0  

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

 We are using MySQL which does not support user defined data types unlike
 postgres. In postgres, you could define a user defined field and tell it
 to use postgress functions when data is saved/retrieved from the database.
 This is why the responsibility of compress/decompress falls on the query
 or the application. There are other applications too. The mysql datetime
 field uses 8 bytes while the timestamp field (which stored the time as a
 unix timestamp) uses 4 bytes. If you have a few million rows, there is
 definitely some savings. mysql has functions like FROM_TIMESTAMP and
 UNIX_TIMESTAMP which convert the timestamps back and forth. It would be
 powerful to use these functions in the queries while still  operating on
 datetime objects in the python application. Any thoughts?

-- 
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] #12396: Auth permission with translation names

2009-12-17 Thread Django
#12396: Auth permission with translation names
+---
  Reporter:  marcosmoyano   | Owner:  nobody
Status:  closed | Milestone:
 Component:  Uncategorized  |   Version:  SVN   
Resolution:  duplicate  |  Keywords:
 Stage:  Unreviewed | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by ramiro):

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

Comment:

 Duplicate of #1688.

-- 
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] #12386: Automatic ManyToMany Fields in models defined in packages use invalid column names

2009-12-17 Thread Django
#12386: Automatic ManyToMany Fields in models defined in packages use invalid
column names
---+
  Reporter:  ldevesine | Owner:  nobody
Status:  new   | Milestone:
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by ldevesine):

 On further review, the problem is that I still had the old column name of
 'subscriptiontype_id' in my database. Changing the column name to
 'member.subscriptiontype_id' does resolve the problem, and syncdb creates
 the column with the 'correct' name automatically. I am, however, not
 certain that django should be creating tables with columns with '.'
 characters in the name automatically...

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

--

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




[Django] #12396: Auth permission with translation names

2009-12-17 Thread Django
#12396: Auth permission with translation names
---+
 Reporter:  marcosmoyano   |   Owner:  nobody
   Status:  new|   Milestone:
Component:  Uncategorized  | Version:  SVN   
 Keywords: |   Stage:  Unreviewed
Has_patch:  1  |  
---+
 Use LANGUAGE_CODE in my settings file to translate permissions names (if
 available).

-- 
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] #56: MySQL id columns should be UNSIGNED

2009-12-17 Thread Django
#56: MySQL id columns should be UNSIGNED
---+
  Reporter:  Manuzhai| Owner:  adrian
Status:  reopened  | Milestone:
 Component:  Database layer (models, ORM)  |   Version:
Resolution:|  Keywords:
 Stage:  Ready for checkin | Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by Thomas Steinacher ):

 Any reason why Django still uses signed ints for auto-incremented primary
 keys?

 {{{
 CREATE TABLE `app_model` (
 `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
 }}}

 This seems silly to me.

-- 
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] r11899 - in django/branches/releases/1.1.X/django/contrib/gis: . tests

2009-12-17 Thread noreply
Author: jbronn
Date: 2009-12-17 12:29:05 -0600 (Thu, 17 Dec 2009)
New Revision: 11899

Modified:
   django/branches/releases/1.1.X/django/contrib/gis/measure.py
   django/branches/releases/1.1.X/django/contrib/gis/tests/test_measure.py
Log:
[1.1.X] Fixed #12390 -- `Distance` and `Area` objects now support 
multiplication when they are the right-hand side.

Backport of r11898 from trunk.


Modified: django/branches/releases/1.1.X/django/contrib/gis/measure.py
===
--- django/branches/releases/1.1.X/django/contrib/gis/measure.py
2009-12-17 18:21:30 UTC (rev 11898)
+++ django/branches/releases/1.1.X/django/contrib/gis/measure.py
2009-12-17 18:29:05 UTC (rev 11899)
@@ -27,7 +27,7 @@
 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 """
-Distance and Area objects to allow for sensible and convienient calculation 
+Distance and Area objects to allow for sensible and convienient calculation
 and conversions.
 
 Authors: Robert Coup, Justin Bronn
@@ -70,7 +70,7 @@
 @classmethod
 def unit_attname(cls, unit_str):
 """
-Retrieves the unit attribute name for the given unit string.  
+Retrieves the unit attribute name for the given unit string.
 For example, if the given unit string is 'metre', 'm' would be 
returned.
 An exception is raised if an attribute cannot be found.
 """
@@ -165,51 +165,51 @@
 self.m, self._default_unit = self.default_units(kwargs)
 if default_unit and isinstance(default_unit, str):
 self._default_unit = default_unit
-
+
 def __getattr__(self, name):
 if name in self.UNITS:
 return self.m / self.UNITS[name]
 else:
 raise AttributeError('Unknown unit type: %s' % name)
-
+
 def __repr__(self):
 return 'Distance(%s=%s)' % (self._default_unit, getattr(self, 
self._default_unit))
 
 def __str__(self):
 return '%s %s' % (getattr(self, self._default_unit), 
self._default_unit)
-
+
 def __cmp__(self, other):
 if isinstance(other, Distance):
 return cmp(self.m, other.m)
 else:
 return NotImplemented
-
+
 def __add__(self, other):
 if isinstance(other, Distance):
 return Distance(default_unit=self._default_unit, m=(self.m + 
other.m))
 else:
 raise TypeError('Distance must be added with Distance')
-
+
 def __iadd__(self, other):
 if isinstance(other, Distance):
 self.m += other.m
 return self
 else:
 raise TypeError('Distance must be added with Distance')
-
+
 def __sub__(self, other):
 if isinstance(other, Distance):
 return Distance(default_unit=self._default_unit, m=(self.m - 
other.m))
 else:
 raise TypeError('Distance must be subtracted from Distance')
-
+
 def __isub__(self, other):
 if isinstance(other, Distance):
 self.m -= other.m
 return self
 else:
 raise TypeError('Distance must be subtracted from Distance')
-
+
 def __mul__(self, other):
 if isinstance(other, (int, float, long, Decimal)):
 return Distance(default_unit=self._default_unit, m=(self.m * 
float(other)))
@@ -217,14 +217,17 @@
 return Area(default_unit='sq_' + self._default_unit, sq_m=(self.m 
* other.m))
 else:
 raise TypeError('Distance must be multiplied with number or 
Distance')
-
+
 def __imul__(self, other):
 if isinstance(other, (int, float, long, Decimal)):
 self.m *= float(other)
 return self
 else:
 raise TypeError('Distance must be multiplied with number')
-
+
+def __rmul__(self, other):
+return self * other
+
 def __div__(self, other):
 if isinstance(other, (int, float, long, Decimal)):
 return Distance(default_unit=self._default_unit, m=(self.m / 
float(other)))
@@ -251,13 +254,13 @@
 self.sq_m, self._default_unit = self.default_units(kwargs)
 if default_unit and isinstance(default_unit, str):
 self._default_unit = default_unit
-
+
 def __getattr__(self, name):
 if name in self.UNITS:
 return self.sq_m / self.UNITS[name]
 else:
 raise AttributeError('Unknown unit type: ' + name)
-
+
 def __repr__(self):
 return 'Area(%s=%s)' % (self._default_unit, getattr(self, 
self._default_unit))
 
@@ -269,46 +272,49 @@
 return cmp(self.sq_m, other.sq_m)
 else:
 return NotImplemented
-
+
 def __add__(self, other):
 if isinstance(other, Area):
 return Area(default_unit=self._default_unit, sq_m=(self.sq_m + 
other.sq_m))
 else:
 raise TypeError('Area must be added with Area')
-
+
 

Re: [Django] #7270: selected_related() can not follow reverse relations of OneToOne.

2009-12-17 Thread Django
#7270: selected_related() can not follow reverse relations of OneToOne.
---+
  Reporter:  towjz...@hotmail.com  | Owner:  
mtredinnick
Status:  new   | Milestone:  1.2

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

Resolution:|  Keywords:  
select_related onetoone reverse performance
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

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

  * keywords:  select_related onetoone reverse => select_related onetoone
   reverse performance

-- 
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] r11898 - in django/trunk/django/contrib/gis: . tests

2009-12-17 Thread noreply
Author: jbronn
Date: 2009-12-17 12:21:30 -0600 (Thu, 17 Dec 2009)
New Revision: 11898

Modified:
   django/trunk/django/contrib/gis/measure.py
   django/trunk/django/contrib/gis/tests/test_measure.py
Log:
Fixed #12390 -- `Distance` and `Area` objects now support multiplication when 
they are the right-hand side.


Modified: django/trunk/django/contrib/gis/measure.py
===
--- django/trunk/django/contrib/gis/measure.py  2009-12-17 16:13:42 UTC (rev 
11897)
+++ django/trunk/django/contrib/gis/measure.py  2009-12-17 18:21:30 UTC (rev 
11898)
@@ -27,7 +27,7 @@
 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 """
-Distance and Area objects to allow for sensible and convienient calculation 
+Distance and Area objects to allow for sensible and convienient calculation
 and conversions.
 
 Authors: Robert Coup, Justin Bronn
@@ -70,7 +70,7 @@
 @classmethod
 def unit_attname(cls, unit_str):
 """
-Retrieves the unit attribute name for the given unit string.  
+Retrieves the unit attribute name for the given unit string.
 For example, if the given unit string is 'metre', 'm' would be 
returned.
 An exception is raised if an attribute cannot be found.
 """
@@ -165,51 +165,51 @@
 self.m, self._default_unit = self.default_units(kwargs)
 if default_unit and isinstance(default_unit, str):
 self._default_unit = default_unit
-
+
 def __getattr__(self, name):
 if name in self.UNITS:
 return self.m / self.UNITS[name]
 else:
 raise AttributeError('Unknown unit type: %s' % name)
-
+
 def __repr__(self):
 return 'Distance(%s=%s)' % (self._default_unit, getattr(self, 
self._default_unit))
 
 def __str__(self):
 return '%s %s' % (getattr(self, self._default_unit), 
self._default_unit)
-
+
 def __cmp__(self, other):
 if isinstance(other, Distance):
 return cmp(self.m, other.m)
 else:
 return NotImplemented
-
+
 def __add__(self, other):
 if isinstance(other, Distance):
 return Distance(default_unit=self._default_unit, m=(self.m + 
other.m))
 else:
 raise TypeError('Distance must be added with Distance')
-
+
 def __iadd__(self, other):
 if isinstance(other, Distance):
 self.m += other.m
 return self
 else:
 raise TypeError('Distance must be added with Distance')
-
+
 def __sub__(self, other):
 if isinstance(other, Distance):
 return Distance(default_unit=self._default_unit, m=(self.m - 
other.m))
 else:
 raise TypeError('Distance must be subtracted from Distance')
-
+
 def __isub__(self, other):
 if isinstance(other, Distance):
 self.m -= other.m
 return self
 else:
 raise TypeError('Distance must be subtracted from Distance')
-
+
 def __mul__(self, other):
 if isinstance(other, (int, float, long, Decimal)):
 return Distance(default_unit=self._default_unit, m=(self.m * 
float(other)))
@@ -217,14 +217,17 @@
 return Area(default_unit='sq_' + self._default_unit, sq_m=(self.m 
* other.m))
 else:
 raise TypeError('Distance must be multiplied with number or 
Distance')
-
+
 def __imul__(self, other):
 if isinstance(other, (int, float, long, Decimal)):
 self.m *= float(other)
 return self
 else:
 raise TypeError('Distance must be multiplied with number')
-
+
+def __rmul__(self, other):
+return self * other
+
 def __div__(self, other):
 if isinstance(other, (int, float, long, Decimal)):
 return Distance(default_unit=self._default_unit, m=(self.m / 
float(other)))
@@ -251,13 +254,13 @@
 self.sq_m, self._default_unit = self.default_units(kwargs)
 if default_unit and isinstance(default_unit, str):
 self._default_unit = default_unit
-
+
 def __getattr__(self, name):
 if name in self.UNITS:
 return self.sq_m / self.UNITS[name]
 else:
 raise AttributeError('Unknown unit type: ' + name)
-
+
 def __repr__(self):
 return 'Area(%s=%s)' % (self._default_unit, getattr(self, 
self._default_unit))
 
@@ -269,46 +272,49 @@
 return cmp(self.sq_m, other.sq_m)
 else:
 return NotImplemented
-
+
 def __add__(self, other):
 if isinstance(other, Area):
 return Area(default_unit=self._default_unit, sq_m=(self.sq_m + 
other.sq_m))
 else:
 raise TypeError('Area must be added with Area')
-
+
 def __iadd__(self, other):
 if isinstance(other, Area):
 self.sq_m += other.sq_m
 return self
 els

Re: [Django] #7270: selected_related() can not follow reverse relations of OneToOne.

2009-12-17 Thread Django
#7270: selected_related() can not follow reverse relations of OneToOne.
---+
  Reporter:  towjz...@hotmail.com  | Owner:  
mtredinnick
Status:  new   | Milestone:  1.2

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

Resolution:|  Keywords:  
select_related onetoone reverse
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

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

 * cc: powderfl...@gmail.com (added)

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

--

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




Re: [Django] #3349: If an ImportError occurs within some loaders a rather confusing exception is raised.

2009-12-17 Thread Django
#3349: If an ImportError occurs within some loaders a rather confusing exception
is raised.
+---
  Reporter:  Chris Wagner   | Owner:  
andrewbadr
Status:  new| Milestone:  1.2   

 Component:  Template system|   Version:  SVN   

Resolution: |  Keywords:

 Stage:  Accepted   | Has_patch:  1 

Needs_docs:  0  |   Needs_tests:  1 

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

 Here's an updated version of the patch, which passes all the existing
 tests. Still not sure how to write a good test for this. Anyone?

-- 
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] #12386: Automatic ManyToMany Fields in models defined in packages use invalid column names

2009-12-17 Thread Django
#12386: Automatic ManyToMany Fields in models defined in packages use invalid
column names
---+
  Reporter:  ldevesine | Owner:  nobody
Status:  new   | Milestone:
 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 ldevesine):

  * component:  Uncategorized => Database layer (models, ORM)

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

--

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




[Django] #12395: Full suite test failures after r11863

2009-12-17 Thread Django
#12395: Full suite test failures after r11863
---+
 Reporter:  kmtracey   |   Owner:  nobody
   Status:  new|   Milestone:
Component:  Uncategorized  | Version:  SVN   
 Keywords: |   Stage:  Unreviewed
Has_patch:  0  |  
---+
 r11863 seems to have introduced something into the fixtures_regress test
 that makes the database unflushable on most backends, resulting in
 failures of subsequent tests that attempt to flush the database.  Example
 from MySQL/InnoDB (MyISAM also fails) when attempting to run the
 fixtures_regress and m2m_through_regress tests:

 {{{
 No fixtures found.
 Doctest: regressiontests.fixtures_regress.models.__test__.API_TESTS ... ok
 Doctest: regressiontests.m2m_through_regress.models.__test__.API_TESTS ...
 Error: Database test_Playground couldn't be flushed. Possible reasons:
   * The database isn't running or isn't configured correctly.
   * At least one of the expected database tables doesn't exist.
   * The SQL was invalid.
 Hint: Look at the output of 'django-admin.py sqlflush'. That's the SQL
 this command wasn't able to run.
 The full error: (1146, "Table
 'test_Playground.fixtures_regress_circle1' doesn't exist")
 FAIL

 ==
 FAIL: Doctest:
 regressiontests.m2m_through_regress.models.__test__.API_TESTS
 --
 Traceback (most recent call last):
   File "/home/kmt/django/trunk/django/test/_doctest.py", line 2180, in
 runTest
 raise self.failureException(self.format_failure(new.getvalue()))
 AssertionError: Failed doctest test for
 regressiontests.m2m_through_regress.models.__test__.API_TESTS
   File
 "/home/kmt/django/trunk/tests/regressiontests/m2m_through_regress/models.py",
 line unknown line number, in API_TESTS

 --
 File
 "/home/kmt/django/trunk/tests/regressiontests/m2m_through_regress/models.py",
 line ?, in regressiontests.m2m_through_regress.models.__test__.API_TESTS
 Failed example:
 management.call_command('flush', verbosity=0, interactive=False)
 Exception raised:
 Traceback (most recent call last):
   File "/home/kmt/django/trunk/django/test/_doctest.py", line 1267, in
 __run
 compileflags, 1) in test.globs
   File "", line
 1, in 
 management.call_command('flush', verbosity=0, interactive=False)
   File "/home/kmt/django/trunk/django/core/management/__init__.py",
 line 166, in call_command
 return klass.execute(*args, **defaults)
   File "/home/kmt/django/trunk/django/core/management/base.py", line
 234, in execute
 sys.exit(1)
 SystemExit: 1


 --
 Ran 2 tests in 2.325s

 FAILED (failures=1)
 Destroying test database...

 }}}

 Another subsequent tests that fails when running the full suite is
 serializers_regress.

 Postgres also fails with a similar message, plus another:

 {{{
 Doctest: regressiontests.fixtures_regress.models.__test__.API_TESTS ... ok
 Doctest: regressiontests.m2m_through_regress.models.__test__.API_TESTS ...
 Error: Database test_postgres couldn't be flushed. Possible reasons:
   * The database isn't running or isn't configured correctly.
   * At least one of the expected database tables doesn't exist.
   * The SQL was invalid.
 Hint: Look at the output of 'django-admin.py sqlflush'. That's the SQL
 this command wasn't able to run.
 The full error: relation "fixtures_regress_circle1_id_seq" does not
 exist

 FAIL

 ==
 FAIL: Doctest:
 regressiontests.m2m_through_regress.models.__test__.API_TESTS
 --
 Traceback (most recent call last):
   File "/home/kmt/django/trunk/django/test/_doctest.py", line 2180, in
 runTest
 raise self.failureException(self.format_failure(new.getvalue()))
 AssertionError: Failed doctest test for
 regressiontests.m2m_through_regress.models.__test__.API_TESTS
   File
 "/home/kmt/django/trunk/tests/regressiontests/m2m_through_regress/models.py",
 line unknown line number, in API_TESTS

 --
 File
 "/home/kmt/django/trunk/tests/regressiontests/m2m_through_regress/models.py",
 line ?, in regressiontests.m2m_through_regress.models.__test__.API_TESTS
 Failed example:
 management.call_command('flush', verbosity=0, interactive=False)
 Exception raised:
 Traceback (most recent call last):
   File "/home/kmt/django/trunk/django/test/_doctest.py", line 1267, in
 __run
 compileflags, 1) in test.globs
   File "", line
 1, in 

Re: [Django] #12391: Not used import in django.db

2009-12-17 Thread Django
#12391: Not used import in django.db
---+
  Reporter:  vorushin  | Owner:  nobody
Status:  closed| Milestone:
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:  wontfix   |  Keywords:
 Stage:  Unreviewed| Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by jacob):

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

Comment:

 Generally, cleanup patches like this aren't accepted because they just
 introduce code churn. We'll fix this the next time someone's in that file;
 it's not worth keeping a ticket around for.

-- 
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] #12394: PDF problems

2009-12-17 Thread Django
#12394: PDF problems
+---
  Reporter:  gspianos   | Owner:  nobody
Status:  closed | Milestone:
 Component:  Uncategorized  |   Version:  1.1   
Resolution:  invalid|  Keywords:
 Stage:  Unreviewed | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Comment (by kmtracey):

 It means Django's ticket system (Trac) is for logging bugs in (or feature
 requests for) Django itself, not for providing user support.

 If you don't know what IRC is then fine, don't use it for asking
 questions.  That isn't the only place Alex pointed you to for appropriate
 places to ask for user help.

 The 2nd item under "Read this first" on the page to create a new ticket
 states "Please don't use the ticket system to ask support questions" and
 gives a pointer to the django-users mailing list:

 http://groups.google.com/group/django-users

 That's likely your best bet for getting help.

-- 
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] #12394: PDF problems

2009-12-17 Thread Django
#12394: PDF problems
+---
  Reporter:  gspianos   | Owner:  nobody
Status:  closed | Milestone:
 Component:  Uncategorized  |   Version:  1.1   
Resolution:  invalid|  Keywords:
 Stage:  Unreviewed | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Comment (by gspianos):

 Replying to [comment:1 Alex]:
 > Trac is not for getting help with using django.  Please use either the
 django-users mailing list, or the #django channel on freenode IRC.

 What does that mean? I don't know what in the world freenode IRC
 is Like I said, I am NOT a programmer - I am just trying to do
 this. Can you please tell me where I can get assistance with this? I am
 TOTALLY frustrated with Django!

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

--

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




Re: [Django] #12392: Create_object generic view does not provide a way to pre-populate a form

2009-12-17 Thread Django
#12392: Create_object generic view does not provide a way to pre-populate a form
-+--
  Reporter:  stewart.mathe...@gmail.com  | Owner:  nobody   
  
Status:  closed  | Milestone:   
  
 Component:  Generic views   |   Version:  SVN  
  
Resolution:  wontfix |  Keywords:  
pre-populate, generic, view, dictionary
 Stage:  Unreviewed  | Has_patch:  0
  
Needs_docs:  0   |   Needs_tests:  0
  
Needs_better_patch:  0   |  
-+--
Changes (by lukeplant):

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

Comment:

 Pass in your own form class which implements `__init__` to provide the
 'initial' keyword argument:

 {{{
 #!python
 from django.forms import ModelForm
 from myapp.models import MyModel

 class MyModelForm(ModelForm):
 class Meta:
 model = MyModel

 def __init__(self, *args, **kwargs):
 kwargs['initial'] = {'field1':'val1'}
 return super(MyModelForm, self).__init__(*args, **kwargs)

 }}}

 Then pass `MyModelForm` as the `form_class` argument.

 I didn't try this, but I'm fairly sure the basic approach should work.
 Since it is fairly simple and avoids cluttering the generic view
 interface,  I'm closing WONTFIX.

-- 
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] #12394: PDF problems

2009-12-17 Thread Django
#12394: PDF problems
+---
  Reporter:  gspianos   | Owner:  nobody
Status:  closed | Milestone:
 Component:  Uncategorized  |   Version:  1.1   
Resolution:  invalid|  Keywords:
 Stage:  Unreviewed | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by Alex):

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

Comment:

 Trac is not for getting help with using django.  Please use either the
 django-users mailing list, or the #django channel on freenode IRC.

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

--

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




[Django] #12394: PDF problems

2009-12-17 Thread Django
#12394: PDF problems
---+
 Reporter:  gspianos   |   Owner:  nobody
   Status:  new|   Milestone:
Component:  Uncategorized  | Version:  1.1   
 Keywords: |   Stage:  Unreviewed
Has_patch:  0  |  
---+
 I am not a programmer and am trying to insert a pdf to our web page and I
 can't get the image to show. I've created a "pdf" folder in the "webapps"
 folder within our site, just as I did for "img". I haven't had any issues
 linking (or inserting) jpg files, but the pdf files aren't seeming to
 take. This is what I am trying to link:

 /appmedia/pdf/DallasYamahaSellOffEventLetter.pdf

 Is there an issue with the link?

 Any help would be greatly appreciated. I know this is very basic, but I
 can't seem to figure it out.

 Thank you.

 Megan

-- 
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] r11897 - django/branches/soc2009/multidb

2009-12-17 Thread noreply
Author: Alex
Date: 2009-12-17 10:13:42 -0600 (Thu, 17 Dec 2009)
New Revision: 11897

Modified:
   django/branches/soc2009/multidb/TODO
Log:
[soc2009/multidb] Updated TODO list.  Patch from Russell Keith-Magee.

Modified: django/branches/soc2009/multidb/TODO
===
--- django/branches/soc2009/multidb/TODO2009-12-17 16:13:36 UTC (rev 
11896)
+++ django/branches/soc2009/multidb/TODO2009-12-17 16:13:42 UTC (rev 
11897)
@@ -6,9 +6,17 @@
 
  * Modify the admin interface to support multiple databases (doh).
 - Document how it is done
-- Modify m2m widgets to stick to the same database as parent
-- Modify inlines to stick to same database as parent
 
+ * Make sure we can't get rid of using= arguments everywhere
+
+ * Resolve uses of _default_manager
+* django/contrib/databrowse/datastructures.py
+* django/contrib/databrowse/fieldchoices.py
+* django/db/models/fields/__init__.py
+- ManyToManyField.isValidIDList (deprecated method?)
+* django/db/models/fields/files.py
+- FileField.delete_file
+
 Optional for v1.2
 ~
 

--

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




[Changeset] r11896 - in django/branches/soc2009/multidb/django: contrib/admin db/models/fields

2009-12-17 Thread noreply
Author: Alex
Date: 2009-12-17 10:13:36 -0600 (Thu, 17 Dec 2009)
New Revision: 11896

Modified:
   django/branches/soc2009/multidb/django/contrib/admin/options.py
   django/branches/soc2009/multidb/django/contrib/admin/widgets.py
   django/branches/soc2009/multidb/django/db/models/fields/related.py
Log:
[soc2009/multidb] Modified admin to allow for multidb customization.  Patch 
from Russell Keith-Magee.

Modified: django/branches/soc2009/multidb/django/contrib/admin/options.py
===
--- django/branches/soc2009/multidb/django/contrib/admin/options.py 
2009-12-17 16:13:25 UTC (rev 11895)
+++ django/branches/soc2009/multidb/django/contrib/admin/options.py 
2009-12-17 16:13:36 UTC (rev 11896)
@@ -140,8 +140,9 @@
 """
 Get a form Field for a ForeignKey.
 """
+db = kwargs.get('using')
 if db_field.name in self.raw_id_fields:
-kwargs['widget'] = widgets.ForeignKeyRawIdWidget(db_field.rel)
+kwargs['widget'] = widgets.ForeignKeyRawIdWidget(db_field.rel, 
using=db)
 elif db_field.name in self.radio_fields:
 kwargs['widget'] = widgets.AdminRadioSelect(attrs={
 'class': get_ul_class(self.radio_fields[db_field.name]),
@@ -158,9 +159,10 @@
 # a field in admin.
 if not db_field.rel.through._meta.auto_created:
 return None
+db = kwargs.get('using')
 
 if db_field.name in self.raw_id_fields:
-kwargs['widget'] = widgets.ManyToManyRawIdWidget(db_field.rel)
+kwargs['widget'] = widgets.ManyToManyRawIdWidget(db_field.rel, 
using=db)
 kwargs['help_text'] = ''
 elif db_field.name in (list(self.filter_vertical) + 
list(self.filter_horizontal)):
 kwargs['widget'] = 
widgets.FilteredSelectMultiple(db_field.verbose_name, (db_field.name in 
self.filter_vertical))
@@ -731,7 +733,7 @@
 form_validated = False
 new_object = self.model()
 prefixes = {}
-for FormSet in self.get_formsets(request):
+for FormSet, inline in zip(self.get_formsets(request), 
self.inline_instances):
 prefix = FormSet.get_default_prefix()
 prefixes[prefix] = prefixes.get(prefix, 0) + 1
 if prefixes[prefix] != 1:
@@ -739,7 +741,7 @@
 formset = FormSet(data=request.POST, files=request.FILES,
   instance=new_object,
   
save_as_new=request.POST.has_key("_saveasnew"),
-  prefix=prefix)
+  prefix=prefix, 
queryset=inline.queryset(request))
 formsets.append(formset)
 if all_valid(formsets) and form_validated:
 self.save_model(request, new_object, form, change=False)
@@ -762,12 +764,14 @@
 initial[k] = initial[k].split(",")
 form = ModelForm(initial=initial)
 prefixes = {}
-for FormSet in self.get_formsets(request):
+for FormSet, inline in zip(self.get_formsets(request),
+   self.inline_instances):
 prefix = FormSet.get_default_prefix()
 prefixes[prefix] = prefixes.get(prefix, 0) + 1
 if prefixes[prefix] != 1:
 prefix = "%s-%s" % (prefix, prefixes[prefix])
-formset = FormSet(instance=self.model(), prefix=prefix)
+formset = FormSet(instance=self.model(), prefix=prefix,
+  queryset=inline.queryset(request))
 formsets.append(formset)
 
 adminForm = helpers.AdminForm(form, list(self.get_fieldsets(request)), 
self.prepopulated_fields)
@@ -829,13 +833,16 @@
 form_validated = False
 new_object = obj
 prefixes = {}
-for FormSet in self.get_formsets(request, new_object):
+for FormSet, inline in zip(self.get_formsets(request, new_object),
+   self.inline_instances):
 prefix = FormSet.get_default_prefix()
 prefixes[prefix] = prefixes.get(prefix, 0) + 1
 if prefixes[prefix] != 1:
 prefix = "%s-%s" % (prefix, prefixes[prefix])
 formset = FormSet(request.POST, request.FILES,
-  instance=new_object, prefix=prefix)
+  instance=new_object, prefix=prefix,
+  queryset=inline.queryset(request))
+
 formsets.append(formset)
 
 if all_valid(formsets) and form_validated:
@@ -851,12 +858,13 @@
 else:
 form = ModelForm(instance=obj)
 prefixes = {}
-for FormSet in self.get_formsets(request, obj):
+for FormSet, inline in

[Changeset] r11895 - django/branches/soc2009/multidb/django/contrib/contenttypes

2009-12-17 Thread noreply
Author: Alex
Date: 2009-12-17 10:13:25 -0600 (Thu, 17 Dec 2009)
New Revision: 11895

Modified:
   django/branches/soc2009/multidb/django/contrib/contenttypes/generic.py
   django/branches/soc2009/multidb/django/contrib/contenttypes/models.py
Log:
[soc2009/multidb] More cleanups of using= arguments.  Patch from Russell 
Keith-Magee.

Modified: django/branches/soc2009/multidb/django/contrib/contenttypes/generic.py
===
--- django/branches/soc2009/multidb/django/contrib/contenttypes/generic.py  
2009-12-17 16:13:17 UTC (rev 11894)
+++ django/branches/soc2009/multidb/django/contrib/contenttypes/generic.py  
2009-12-17 16:13:25 UTC (rev 11895)
@@ -45,7 +45,7 @@
 kwargs[self.ct_field] = self.get_content_type(obj=value)
 kwargs[self.fk_field] = value._get_pk_val()
 
-def get_content_type(self, obj=None, id=None, using=DEFAULT_DB_ALIAS):
+def get_content_type(self, obj=None, id=None, using=None):
 # Convenience function using get_model avoids a circular import when
 # using this model
 ContentType = get_model("contenttypes", "contenttype")

Modified: django/branches/soc2009/multidb/django/contrib/contenttypes/models.py
===
--- django/branches/soc2009/multidb/django/contrib/contenttypes/models.py   
2009-12-17 16:13:17 UTC (rev 11894)
+++ django/branches/soc2009/multidb/django/contrib/contenttypes/models.py   
2009-12-17 16:13:25 UTC (rev 11895)
@@ -8,52 +8,55 @@
 # This cache is shared by all the get_for_* methods.
 _cache = {}
 
-def get_by_natural_key(self, app_label, model, using=DEFAULT_DB_ALIAS):
+def get_by_natural_key(self, app_label, model, using=None):
+db = using or DEFAULT_DB_ALIAS
 try:
-ct = self.__class__._cache[using][(app_label, model)]
+ct = self.__class__._cache[db][(app_label, model)]
 except KeyError:
-ct = self.using(using).get(app_label=app_label, model=model)
+ct = self.using(db).get(app_label=app_label, model=model)
 return ct
 
-def get_for_model(self, model, using=DEFAULT_DB_ALIAS):
+def get_for_model(self, model, using=None):
 """
 Returns the ContentType object for a given model, creating the
 ContentType if necessary. Lookups are cached so that subsequent lookups
 for the same model don't hit the database.
 """
+db = using or DEFAULT_DB_ALIAS
 opts = model._meta
 while opts.proxy:
 model = opts.proxy_for_model
 opts = model._meta
 key = (opts.app_label, opts.object_name.lower())
 try:
-ct = self.__class__._cache[using][key]
+ct = self.__class__._cache[db][key]
 except KeyError:
 # Load or create the ContentType entry. The smart_unicode() is
 # needed around opts.verbose_name_raw because name_raw might be a
 # django.utils.functional.__proxy__ object.
-ct, created = self.using(using).get_or_create(
+ct, created = self.using(db).get_or_create(
 app_label = opts.app_label,
 model = opts.object_name.lower(),
 defaults = {'name': smart_unicode(opts.verbose_name_raw)},
 )
-self._add_to_cache(using, ct)
+self._add_to_cache(db, ct)
 
 return ct
 
-def get_for_id(self, id, using=DEFAULT_DB_ALIAS):
+def get_for_id(self, id, using=None):
 """
 Lookup a ContentType by ID. Uses the same shared cache as get_for_model
 (though ContentTypes are obviously not created on-the-fly by 
get_by_id).
 """
+db = using or DEFAULT_DB_ALIAS
 try:
-ct = self.__class__._cache[using][id]
+ct = self.__class__._cache[db][id]
 
 except KeyError:
 # This could raise a DoesNotExist; that's correct behavior and will
 # make sure that only correct ctypes get stored in the cache dict.
-ct = self.using(using).get(pk=id)
-self._add_to_cache(using, ct)
+ct = self.using(db).get(pk=id)
+self._add_to_cache(db, ct)
 return ct
 
 def clear_cache(self):

--

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] r11894 - django/branches/soc2009/multidb/django/contrib/comments/views

2009-12-17 Thread noreply
Author: Alex
Date: 2009-12-17 10:13:17 -0600 (Thu, 17 Dec 2009)
New Revision: 11894

Modified:
   django/branches/soc2009/multidb/django/contrib/comments/views/comments.py
Log:
[soc2009/multidb] Added using argument to comment view.  Patch from Russell 
Keith-Magee.

Modified: 
django/branches/soc2009/multidb/django/contrib/comments/views/comments.py
===
--- django/branches/soc2009/multidb/django/contrib/comments/views/comments.py   
2009-12-17 16:13:07 UTC (rev 11893)
+++ django/branches/soc2009/multidb/django/contrib/comments/views/comments.py   
2009-12-17 16:13:17 UTC (rev 11894)
@@ -25,7 +25,7 @@
 
 @csrf_protect
 @require_POST
-def post_comment(request, next=None):
+def post_comment(request, next=None, using=None):
 """
 Post a comment.
 
@@ -50,7 +50,7 @@
 return CommentPostBadRequest("Missing content_type or object_pk 
field.")
 try:
 model = models.get_model(*ctype.split(".", 1))
-target = model._default_manager.get(pk=object_pk)
+target = model._default_manager.using(using).get(pk=object_pk)
 except TypeError:
 return CommentPostBadRequest(
 "Invalid content_type value: %r" % escape(ctype))

--

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] r11893 - in django/branches/soc2009/multidb: django/contrib/auth django/contrib/gis/sitemaps django/contrib/gis/utils django/db/models tests/modeltests/fixtures tests/regressiontests/fixtu

2009-12-17 Thread noreply
Author: Alex
Date: 2009-12-17 10:13:07 -0600 (Thu, 17 Dec 2009)
New Revision: 11893

Modified:
   django/branches/soc2009/multidb/django/contrib/auth/models.py
   django/branches/soc2009/multidb/django/contrib/gis/sitemaps/views.py
   django/branches/soc2009/multidb/django/contrib/gis/utils/layermapping.py
   django/branches/soc2009/multidb/django/db/models/query.py
   django/branches/soc2009/multidb/tests/modeltests/fixtures/models.py
   
django/branches/soc2009/multidb/tests/regressiontests/fixtures_regress/models.py
   
django/branches/soc2009/multidb/tests/regressiontests/generic_inline_admin/tests.py
   
django/branches/soc2009/multidb/tests/regressiontests/multiple_database/models.py
Log:
[soc2009/multidb] Modified using= arguments to default to None; modified 
querysets so you can track explicit database assignments.  Patch from Russell 
Keith-Magee.

Modified: django/branches/soc2009/multidb/django/contrib/auth/models.py
===
--- django/branches/soc2009/multidb/django/contrib/auth/models.py   
2009-12-17 16:12:51 UTC (rev 11892)
+++ django/branches/soc2009/multidb/django/contrib/auth/models.py   
2009-12-17 16:13:07 UTC (rev 11893)
@@ -48,7 +48,7 @@
 pass
 
 class PermissionManager(models.Manager):
-def get_by_natural_key(self, codename, app_label, model, 
using=DEFAULT_DB_ALIAS):
+def get_by_natural_key(self, codename, app_label, model, using=None):
 return self.using(using).get(
 codename=codename,
 content_type=ContentType.objects.get_by_natural_key(app_label, 
model)
@@ -106,7 +106,7 @@
 return self.name
 
 class UserManager(models.Manager):
-def create_user(self, username, email, password=None, 
using=DEFAULT_DB_ALIAS):
+def create_user(self, username, email, password=None, using=None):
 "Creates and saves a User with the given username, e-mail and 
password."
 now = datetime.datetime.now()
 user = self.model(None, username, '', '', email.strip().lower(), 
'placeholder', False, True, False, now, now)
@@ -117,7 +117,7 @@
 user.save(using=using)
 return user
 
-def create_superuser(self, username, email, password, 
using=DEFAULT_DB_ALIAS):
+def create_superuser(self, username, email, password, using=None):
 u = self.create_user(username, email, password)
 u.is_staff = True
 u.is_active = True

Modified: django/branches/soc2009/multidb/django/contrib/gis/sitemaps/views.py
===
--- django/branches/soc2009/multidb/django/contrib/gis/sitemaps/views.py
2009-12-17 16:12:51 UTC (rev 11892)
+++ django/branches/soc2009/multidb/django/contrib/gis/sitemaps/views.py
2009-12-17 16:13:07 UTC (rev 11893)
@@ -59,7 +59,7 @@
 xml = smart_str(loader.render_to_string('gis/sitemaps/geo_sitemap.xml', 
{'urlset': urls}))
 return HttpResponse(xml, mimetype='application/xml')
 
-def kml(request, label, model, field_name=None, compress=False, 
using=DEFAULT_DB_ALIAS):
+def kml(request, label, model, field_name=None, compress=False, using=None):
 """
 This view generates KML for the given app label, model, and field name.
 
@@ -83,15 +83,15 @@
 
 if connection.ops.postgis:
 # PostGIS will take care of transformation.
-placemarks = klass._default_manager.kml(field_name=field_name)
+placemarks = 
klass._default_manager.using(using).kml(field_name=field_name)
 else:
 # There's no KML method on Oracle or MySQL, so we use the `kml`
 # attribute of the lazy geometry instead.
 placemarks = []
 if connection.ops.oracle:
-qs = klass._default_manager.transform(4326, field_name=field_name)
+qs = klass._default_manager.using(using).transform(4326, 
field_name=field_name)
 else:
-qs = klass._default_manager.all()
+qs = klass._default_manager.using(using).all()
 for mod in qs:
 setattr(mod, 'kml', getattr(mod, field_name).kml)
 placemarks.append(mod)
@@ -103,7 +103,7 @@
 render = render_to_kml
 return render('gis/kml/placemarks.kml', {'places' : placemarks})
 
-def kmz(request, label, model, field_name=None, using=DEFAULT_DB_ALIAS):
+def kmz(request, label, model, field_name=None, using=None):
 """
 This view returns KMZ for the given app label, model, and field name.
 """

Modified: 
django/branches/soc2009/multidb/django/contrib/gis/utils/layermapping.py
===
--- django/branches/soc2009/multidb/django/contrib/gis/utils/layermapping.py
2009-12-17 16:12:51 UTC (rev 11892)
+++ django/branches/soc2009/multidb/django/contrib/gis/utils/layermapping.py
2009-12-17 16:13:07 UTC (rev 11893)
@@ -67,7 +67,7 @@
 def __init__(self, model, data, mapping, layer=0,
  source_srs=None, encoding=Non

[Changeset] r11892 - django/branches/soc2009/multidb/django/contrib/comments

2009-12-17 Thread noreply
Author: Alex
Date: 2009-12-17 10:12:51 -0600 (Thu, 17 Dec 2009)
New Revision: 11892

Modified:
   django/branches/soc2009/multidb/django/contrib/comments/forms.py
Log:
[soc2009/multidb] Added partial handling for comments to be multi-db compliant. 
 Patch from Russell Keith-Magee.

Modified: django/branches/soc2009/multidb/django/contrib/comments/forms.py
===
--- django/branches/soc2009/multidb/django/contrib/comments/forms.py
2009-12-17 16:12:43 UTC (rev 11891)
+++ django/branches/soc2009/multidb/django/contrib/comments/forms.py
2009-12-17 16:12:51 UTC (rev 11892)
@@ -28,7 +28,7 @@
 initial = {}
 initial.update(self.generate_security_data())
 super(CommentSecurityForm, self).__init__(data=data, initial=initial)
-
+
 def security_errors(self):
 """Return just those errors associated with security"""
 errors = ErrorDict()
@@ -107,13 +107,13 @@
 """
 if not self.is_valid():
 raise ValueError("get_comment_object may only be called on valid 
forms")
-
+
 CommentModel = self.get_comment_model()
 new = CommentModel(**self.get_comment_create_data())
 new = self.check_for_duplicate_comment(new)
-
+
 return new
-
+
 def get_comment_model(self):
 """
 Get the comment model to create with this form. Subclasses in custom
@@ -121,7 +121,7 @@
 check_for_duplicate_comment to provide custom comment models.
 """
 return Comment
-
+
 def get_comment_create_data(self):
 """
 Returns the dict of data to be used to create a comment. Subclasses in
@@ -140,13 +140,15 @@
 is_public= True,
 is_removed   = False,
 )
-
+
 def check_for_duplicate_comment(self, new):
 """
 Check that a submitted comment isn't a duplicate. This might be caused
 by someone posting a comment twice. If it is a dup, silently return 
the *previous* comment.
 """
-possible_duplicates = self.get_comment_model()._default_manager.filter(
+possible_duplicates = self.get_comment_model()._default_manager.using(
+self.target_object._state.db
+).filter(
 content_type = new.content_type,
 object_pk = new.object_pk,
 user_name = new.user_name,
@@ -156,7 +158,7 @@
 for old in possible_duplicates:
 if old.submit_date.date() == new.submit_date.date() and 
old.comment == new.comment:
 return old
-
+
 return new
 
 def clean_comment(self):

--

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] r11891 - in django/branches/soc2009/multidb: django/contrib/auth django/core/management/commands django/core/serializers django/db/models tests/modeltests/fixtures tests/regressiontests/fi

2009-12-17 Thread noreply
Author: Alex
Date: 2009-12-17 10:12:43 -0600 (Thu, 17 Dec 2009)
New Revision: 11891

Modified:
   django/branches/soc2009/multidb/django/contrib/auth/models.py
   django/branches/soc2009/multidb/django/core/management/commands/loaddata.py
   django/branches/soc2009/multidb/django/core/serializers/__init__.py
   django/branches/soc2009/multidb/django/core/serializers/json.py
   django/branches/soc2009/multidb/django/core/serializers/python.py
   django/branches/soc2009/multidb/django/core/serializers/pyyaml.py
   django/branches/soc2009/multidb/django/core/serializers/xml_serializer.py
   django/branches/soc2009/multidb/django/db/models/base.py
   django/branches/soc2009/multidb/tests/modeltests/fixtures/models.py
   
django/branches/soc2009/multidb/tests/regressiontests/fixtures_regress/models.py
   
django/branches/soc2009/multidb/tests/regressiontests/multiple_database/fixtures/multidb.default.json
   
django/branches/soc2009/multidb/tests/regressiontests/multiple_database/fixtures/multidb.other.json
   
django/branches/soc2009/multidb/tests/regressiontests/multiple_database/models.py
   
django/branches/soc2009/multidb/tests/regressiontests/multiple_database/tests.py
Log:
[soc2009/multidb] Add multi-db support to fixture loading. Involves a rework of 
models in the multi-db test cases to make the fixture a complete test case.  
Patch from Russell Keith-Magee.

Modified: django/branches/soc2009/multidb/django/contrib/auth/models.py
===
--- django/branches/soc2009/multidb/django/contrib/auth/models.py   
2009-12-17 16:12:23 UTC (rev 11890)
+++ django/branches/soc2009/multidb/django/contrib/auth/models.py   
2009-12-17 16:12:43 UTC (rev 11891)
@@ -48,8 +48,8 @@
 pass
 
 class PermissionManager(models.Manager):
-def get_by_natural_key(self, codename, app_label, model):
-return self.get(
+def get_by_natural_key(self, codename, app_label, model, 
using=DEFAULT_DB_ALIAS):
+return self.using(using).get(
 codename=codename,
 content_type=ContentType.objects.get_by_natural_key(app_label, 
model)
 )

Modified: 
django/branches/soc2009/multidb/django/core/management/commands/loaddata.py
===
--- django/branches/soc2009/multidb/django/core/management/commands/loaddata.py 
2009-12-17 16:12:23 UTC (rev 11890)
+++ django/branches/soc2009/multidb/django/core/management/commands/loaddata.py 
2009-12-17 16:12:43 UTC (rev 11891)
@@ -159,7 +159,7 @@
 print "Installing %s fixture '%s' from %s." % \
 (format, fixture_name, 
humanize(fixture_dir))
 try:
-objects = serializers.deserialize(format, 
fixture)
+objects = serializers.deserialize(format, 
fixture, using=using)
 for obj in objects:
 if obj.object._meta.app_label not in 
excluded_apps:
 objects_in_fixture += 1

Modified: django/branches/soc2009/multidb/django/core/serializers/__init__.py
===
--- django/branches/soc2009/multidb/django/core/serializers/__init__.py 
2009-12-17 16:12:23 UTC (rev 11890)
+++ django/branches/soc2009/multidb/django/core/serializers/__init__.py 
2009-12-17 16:12:43 UTC (rev 11891)
@@ -36,14 +36,14 @@
 _serializers = {}
 
 def register_serializer(format, serializer_module, serializers=None):
-Register a new serializer. 
-
+Register a new serializer.
+
 ``serializer_module`` should be the fully qualified module name
 for the serializer.
-
+
 If ``serializers`` is provided, the registration will be added
 to the provided dictionary.
-
+
 If ``serializers`` is not provided, the registration will be made
 directly into the global register of serializers. Adding serializers
 directly is not a thread-safe operation.
@@ -53,7 +53,7 @@
 _serializers[format] = module
 else:
 serializers[format] = module
-
+
 def unregister_serializer(format):
 "Unregister a given serializer. This is not a thread-safe operation."
 del _serializers[format]
@@ -87,7 +87,7 @@
 s.serialize(queryset, **options)
 return s.getvalue()
 
-def deserialize(format, stream_or_string):
+def deserialize(format, stream_or_string, **options):
 """
 Deserialize a stream or a string. Returns an iterator that yields ``(obj,
 m2m_relation_dict)``, where ``obj`` is a instantiated -- but *unsaved* --
@@ -95,7 +95,7 @@
 list_of_related_objects}``.
 """
 d = get_deserializer(format)
-return d(stream_or_string)
+return d(stream_or_string, **options)
 
 def _load_serializers():
 """

Modified: django/branches/soc2009/multidb/django/core/serializers

[Changeset] r11890 - in django/branches/soc2009/multidb: django/contrib/auth tests/regressiontests/multiple_database

2009-12-17 Thread noreply
Author: Alex
Date: 2009-12-17 10:12:23 -0600 (Thu, 17 Dec 2009)
New Revision: 11890

Modified:
   django/branches/soc2009/multidb/django/contrib/auth/models.py
   
django/branches/soc2009/multidb/tests/regressiontests/multiple_database/models.py
   
django/branches/soc2009/multidb/tests/regressiontests/multiple_database/tests.py
Log:
[soc2009/multidb] Updated contrib.auth User model for multi-db support.  Patch 
from Russell Keith-Magee.

Modified: django/branches/soc2009/multidb/django/contrib/auth/models.py
===
--- django/branches/soc2009/multidb/django/contrib/auth/models.py   
2009-12-17 16:12:06 UTC (rev 11889)
+++ django/branches/soc2009/multidb/django/contrib/auth/models.py   
2009-12-17 16:12:23 UTC (rev 11890)
@@ -3,7 +3,7 @@
 
 from django.contrib import auth
 from django.core.exceptions import ImproperlyConfigured
-from django.db import models
+from django.db import models, DEFAULT_DB_ALIAS
 from django.db.models.manager import EmptyManager
 from django.contrib.contenttypes.models import ContentType
 from django.utils.encoding import smart_str
@@ -106,7 +106,7 @@
 return self.name
 
 class UserManager(models.Manager):
-def create_user(self, username, email, password=None):
+def create_user(self, username, email, password=None, 
using=DEFAULT_DB_ALIAS):
 "Creates and saves a User with the given username, e-mail and 
password."
 now = datetime.datetime.now()
 user = self.model(None, username, '', '', email.strip().lower(), 
'placeholder', False, True, False, now, now)
@@ -114,15 +114,15 @@
 user.set_password(password)
 else:
 user.set_unusable_password()
-user.save()
+user.save(using=using)
 return user
 
-def create_superuser(self, username, email, password):
+def create_superuser(self, username, email, password, 
using=DEFAULT_DB_ALIAS):
 u = self.create_user(username, email, password)
 u.is_staff = True
 u.is_active = True
 u.is_superuser = True
-u.save()
+u.save(using=using)
 return u
 
 def make_random_password(self, length=10, 
allowed_chars='abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'):
@@ -319,7 +319,7 @@
 try:
 app_label, model_name = settings.AUTH_PROFILE_MODULE.split('.')
 model = models.get_model(app_label, model_name)
-self._profile_cache = 
model._default_manager.get(user__id__exact=self.id)
+self._profile_cache = 
model._default_manager.using(self._state.db).get(user__id__exact=self.id)
 self._profile_cache.user = self
 except (ImportError, ImproperlyConfigured):
 raise SiteProfileNotAvailable

Modified: 
django/branches/soc2009/multidb/tests/regressiontests/multiple_database/models.py
===
--- 
django/branches/soc2009/multidb/tests/regressiontests/multiple_database/models.py
   2009-12-17 16:12:06 UTC (rev 11889)
+++ 
django/branches/soc2009/multidb/tests/regressiontests/multiple_database/models.py
   2009-12-17 16:12:23 UTC (rev 11890)
@@ -1,4 +1,5 @@
 from django.conf import settings
+from django.contrib.auth.models import User
 from django.contrib.contenttypes.models import ContentType
 from django.contrib.contenttypes import generic
 from django.db import models, DEFAULT_DB_ALIAS
@@ -36,3 +37,8 @@
 
 class Meta:
 ordering = ('name',)
+
+class UserProfile(models.Model):
+user = models.OneToOneField(User)
+flavor = models.CharField(max_length=100)
+

Modified: 
django/branches/soc2009/multidb/tests/regressiontests/multiple_database/tests.py
===
--- 
django/branches/soc2009/multidb/tests/regressiontests/multiple_database/tests.py
2009-12-17 16:12:06 UTC (rev 11889)
+++ 
django/branches/soc2009/multidb/tests/regressiontests/multiple_database/tests.py
2009-12-17 16:12:23 UTC (rev 11890)
@@ -2,10 +2,11 @@
 import pickle
 
 from django.conf import settings
+from django.contrib.auth.models import User
 from django.db import connections
 from django.test import TestCase
 
-from models import Book, Author, Review
+from models import Book, Author, Review, UserProfile
 
 try:
 # we only have these models if the user is using multi-db, it's safe the
@@ -590,7 +591,28 @@
 
self.assertEquals(list(Review.objects.using('other').filter(object_id=dive.pk).values_list('source',flat=True)),
   [u'Python Daily', u'Python Weekly'])
 
+class UserProfileTestCase(TestCase):
+def setUp(self):
+self.old_auth_profile_module = getattr(settings, 
'AUTH_PROFILE_MODULE', None)
+settings.AUTH_PROFILE_MODULE = 'multiple_database.UserProfile'
 
+def tearDown(self):
+settings.AUTH_PROFILE_MODULE = self.old_auth_profile_module
+
+

[Changeset] r11889 - in django/branches/soc2009/multidb: django/contrib/contenttypes docs/ref/contrib tests/regressiontests/multiple_database

2009-12-17 Thread noreply
Author: Alex
Date: 2009-12-17 10:12:06 -0600 (Thu, 17 Dec 2009)
New Revision: 11889

Modified:
   django/branches/soc2009/multidb/django/contrib/contenttypes/generic.py
   django/branches/soc2009/multidb/django/contrib/contenttypes/management.py
   django/branches/soc2009/multidb/django/contrib/contenttypes/models.py
   django/branches/soc2009/multidb/docs/ref/contrib/contenttypes.txt
   
django/branches/soc2009/multidb/tests/regressiontests/multiple_database/models.py
   
django/branches/soc2009/multidb/tests/regressiontests/multiple_database/tests.py
Log:
[soc2009/multidb] Updated content types to be multidb aware.  Patch from 
Russell Keith-Magee.

Modified: django/branches/soc2009/multidb/django/contrib/contenttypes/generic.py
===
--- django/branches/soc2009/multidb/django/contrib/contenttypes/generic.py  
2009-12-17 15:15:26 UTC (rev 11888)
+++ django/branches/soc2009/multidb/django/contrib/contenttypes/generic.py  
2009-12-17 16:12:06 UTC (rev 11889)
@@ -5,7 +5,7 @@
 from django.core.exceptions import ObjectDoesNotExist
 from django.db import connection
 from django.db.models import signals
-from django.db import models
+from django.db import models, DEFAULT_DB_ALIAS
 from django.db.models.fields.related import RelatedField, Field, ManyToManyRel
 from django.db.models.loading import get_model
 from django.forms import ModelForm
@@ -45,14 +45,14 @@
 kwargs[self.ct_field] = self.get_content_type(obj=value)
 kwargs[self.fk_field] = value._get_pk_val()
 
-def get_content_type(self, obj=None, id=None):
+def get_content_type(self, obj=None, id=None, using=DEFAULT_DB_ALIAS):
 # Convenience function using get_model avoids a circular import when
 # using this model
 ContentType = get_model("contenttypes", "contenttype")
 if obj:
-return ContentType.objects.get_for_model(obj)
+ return ContentType.objects.get_for_model(obj, using=obj._state.db)
 elif id:
-return ContentType.objects.get_for_id(id)
+ return ContentType.objects.get_for_id(id, using=using)
 else:
 # This should never happen. I love comments like this, don't you?
 raise Exception("Impossible arguments to GFK.get_content_type!")
@@ -73,7 +73,7 @@
 f = self.model._meta.get_field(self.ct_field)
 ct_id = getattr(instance, f.get_attname(), None)
 if ct_id:
-ct = self.get_content_type(id=ct_id)
+ct = self.get_content_type(id=ct_id, using=instance._state.db)
 try:
 rel_obj = ct.get_object_for_this_type(pk=getattr(instance, 
self.fk_field))
 except ObjectDoesNotExist:
@@ -201,11 +201,10 @@
 join_table = qn(self.field.m2m_db_table()),
 source_col_name = qn(self.field.m2m_column_name()),
 target_col_name = qn(self.field.m2m_reverse_name()),
-content_type = ContentType.objects.get_for_model(instance),
+content_type = ContentType.objects.get_for_model(instance, 
using=instance._state.db),
 content_type_field_name = self.field.content_type_field_name,
 object_id_field_name = self.field.object_id_field_name
 )
-
 return manager
 
 def __set__(self, instance, value):
@@ -247,7 +246,7 @@
 '%s__pk' % self.content_type_field_name : self.content_type.id,
 '%s__exact' % self.object_id_field_name : self.pk_val,
 }
-return superclass.get_query_set(self).filter(**query)
+return 
superclass.get_query_set(self).using(self.instance._state.db).filter(**query)
 
 def add(self, *objs):
 for obj in objs:
@@ -255,17 +254,17 @@
 raise TypeError, "'%s' instance expected" % 
self.model._meta.object_name
 setattr(obj, self.content_type_field_name, self.content_type)
 setattr(obj, self.object_id_field_name, self.pk_val)
-obj.save()
+obj.save(using=self.instance._state.db)
 add.alters_data = True
 
 def remove(self, *objs):
 for obj in objs:
-obj.delete()
+obj.delete(using=self.instance._state.db)
 remove.alters_data = True
 
 def clear(self):
 for obj in self.all():
-obj.delete()
+obj.delete(using=self.instance._state.db)
 clear.alters_data = True
 
 def create(self, **kwargs):

Modified: 
django/branches/soc2009/multidb/django/contrib/contenttypes/management.py
===
--- django/branches/soc2009/multidb/django/contrib/contenttypes/management.py   
2009-12-17 15:15:26 UTC (rev 11888)
+++ django/branches/soc2009/multidb/django/contrib/contenttypes/management.py   
2009-12-17 16:12:06 

Re: [Django] #12393: testGenericInlineFormset fails on Postgres

2009-12-17 Thread Django
#12393: testGenericInlineFormset fails on Postgres
+---
  Reporter:  kmtracey   | Owner:  nobody
Status:  new| Milestone:
 Component:  Uncategorized  |   Version:  SVN   
Resolution: |  Keywords:
 Stage:  Unreviewed | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by kmtracey):

  * needs_better_patch:  => 0
  * version:  1.1 => SVN
  * needs_tests:  => 0
  * needs_docs:  => 0

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

--

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




[Django] #12393: testGenericInlineFormset fails on Postgres

2009-12-17 Thread Django
#12393: testGenericInlineFormset fails on Postgres
---+
 Reporter:  kmtracey   |   Owner:  nobody
   Status:  new|   Milestone:
Component:  Uncategorized  | Version:  1.1   
 Keywords: |   Stage:  Unreviewed
Has_patch:  0  |  
---+
 The testGenericInlineFormset test added in r11885 is failing for me on
 PosgreSQL:

 {{{
 ==
 FAIL: testGenericInlineFormset
 (regressiontests.generic_inline_admin.tests.GenericAdminViewTest)
 --
 Traceback (most recent call last):
   File
 "C:\u\kmt\django\trunk\tests\regressiontests\generic_inline_admin\tests.py",
 line 92, in testGenericInlineFormset
 self.assertEquals(formset.forms[0].as_p(), 'Url:
 http://example.com/podcast.mp3"; maxlength="200" />')
 AssertionError: u'Url: http://example.com/podcast.mp3"; maxlength="200" />'
 !=   'Url: http://example.com/podcast.mp3"; maxlength="200" />'

 --
 Ran 10 tests in 4.828s

 FAILED (failures=1)
 Destroying test database...
 }}}

 (Slightly reformatted to line up the mismatch.)  Test is expecting
 `value="9"` but getting `value="1"`.

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

--

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




Re: [Django] #12392: Create_object generic view does not provide a way to pre-populate a form

2009-12-17 Thread Django
#12392: Create_object generic view does not provide a way to pre-populate a form
-+--
  Reporter:  stewart.mathe...@gmail.com  | Owner:  nobody   
  
Status:  new | Milestone:   
  
 Component:  Generic views   |   Version:  SVN  
  
Resolution:  |  Keywords:  
pre-populate, generic, view, dictionary
 Stage:  Unreviewed  | Has_patch:  0
  
Needs_docs:  0   |   Needs_tests:  0
  
Needs_better_patch:  0   |  
-+--
Comment (by Stewart ):

 A class-based approach would definitely work. To me it seems like a more
 sensible way of tackling generic views. However #6735 seems to
 specifically relate to list views where is this issue focuses around the
 create and update generic views. In a class-based approach ideally this
 could take an instance of the ModelForm. That way you could perform any
 operations on the instance that are needed such as binding data. That
 would definitely solve the issue and make generic views much simpler for
 displaying forms with pre-populated data.

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

--

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




[Changeset] r11887 - in django/trunk: . django/contrib/admin django/db/backends/mysql django/db/backends/oracle django/db/backends/postgresql django/db/backends/sqlite3 django/db/models/fields docs/re

2009-12-17 Thread noreply
Author: kmtracey
Date: 2009-12-17 09:10:38 -0600 (Thu, 17 Dec 2009)
New Revision: 11887

Modified:
   django/trunk/AUTHORS
   django/trunk/django/contrib/admin/options.py
   django/trunk/django/db/backends/mysql/creation.py
   django/trunk/django/db/backends/mysql/introspection.py
   django/trunk/django/db/backends/oracle/creation.py
   django/trunk/django/db/backends/oracle/introspection.py
   django/trunk/django/db/backends/postgresql/creation.py
   django/trunk/django/db/backends/postgresql/introspection.py
   django/trunk/django/db/backends/sqlite3/creation.py
   django/trunk/django/db/backends/sqlite3/introspection.py
   django/trunk/django/db/models/fields/__init__.py
   django/trunk/docs/ref/models/fields.txt
   django/trunk/docs/topics/forms/modelforms.txt
   django/trunk/tests/modeltests/model_forms/models.py
   django/trunk/tests/regressiontests/introspection/models.py
   django/trunk/tests/regressiontests/introspection/tests.py
   django/trunk/tests/regressiontests/model_fields/models.py
   django/trunk/tests/regressiontests/model_fields/tests.py
   django/trunk/tests/regressiontests/serializers_regress/models.py
   django/trunk/tests/regressiontests/serializers_regress/tests.py
Log:
Fixed #399: Added big integer field. Thanks to Tom?\195?\161?\197?\161 
Kope?\196?\141ek for persistently maintaining a patch for this.


Modified: django/trunk/AUTHORS
===
--- django/trunk/AUTHORS2009-12-17 07:28:26 UTC (rev 11886)
+++ django/trunk/AUTHORS2009-12-17 15:10:38 UTC (rev 11887)
@@ -246,6 +246,7 @@
 Cameron Knight (ckknight)
 Nena Kojadin 
 Igor Kolar 
+Tomáš Kopeček 
 Gasper Koren
 Martin Kosír 
 Arthur Koziel 

Modified: django/trunk/django/contrib/admin/options.py
===
--- django/trunk/django/contrib/admin/options.py2009-12-17 07:28:26 UTC 
(rev 11886)
+++ django/trunk/django/contrib/admin/options.py2009-12-17 15:10:38 UTC 
(rev 11887)
@@ -42,14 +42,15 @@
 'form_class': forms.SplitDateTimeField,
 'widget': widgets.AdminSplitDateTime
 },
-models.DateField:{'widget': widgets.AdminDateWidget},
-models.TimeField:{'widget': widgets.AdminTimeWidget},
-models.TextField:{'widget': widgets.AdminTextareaWidget},
-models.URLField: {'widget': widgets.AdminURLFieldWidget},
-models.IntegerField: {'widget': widgets.AdminIntegerFieldWidget},
-models.CharField:{'widget': widgets.AdminTextInputWidget},
-models.ImageField:   {'widget': widgets.AdminFileWidget},
-models.FileField:{'widget': widgets.AdminFileWidget},
+models.DateField:   {'widget': widgets.AdminDateWidget},
+models.TimeField:   {'widget': widgets.AdminTimeWidget},
+models.TextField:   {'widget': widgets.AdminTextareaWidget},
+models.URLField:{'widget': widgets.AdminURLFieldWidget},
+models.IntegerField:{'widget': widgets.AdminIntegerFieldWidget},
+models.BigIntegerField: {'widget': widgets.AdminIntegerFieldWidget},
+models.CharField:   {'widget': widgets.AdminTextInputWidget},
+models.ImageField:  {'widget': widgets.AdminFileWidget},
+models.FileField:   {'widget': widgets.AdminFileWidget},
 }
 
 

Modified: django/trunk/django/db/backends/mysql/creation.py
===
--- django/trunk/django/db/backends/mysql/creation.py   2009-12-17 07:28:26 UTC 
(rev 11886)
+++ django/trunk/django/db/backends/mysql/creation.py   2009-12-17 15:10:38 UTC 
(rev 11887)
@@ -18,6 +18,7 @@
 'FilePathField': 'varchar(%(max_length)s)',
 'FloatField':'double precision',
 'IntegerField':  'integer',
+'BigIntegerField':   'bigint',
 'IPAddressField':'char(15)',
 'NullBooleanField':  'bool',
 'OneToOneField': 'integer',

Modified: django/trunk/django/db/backends/mysql/introspection.py
===
--- django/trunk/django/db/backends/mysql/introspection.py  2009-12-17 
07:28:26 UTC (rev 11886)
+++ django/trunk/django/db/backends/mysql/introspection.py  2009-12-17 
15:10:38 UTC (rev 11887)
@@ -17,7 +17,7 @@
 FIELD_TYPE.FLOAT: 'FloatField',
 FIELD_TYPE.INT24: 'IntegerField',
 FIELD_TYPE.LONG: 'IntegerField',
-FIELD_TYPE.LONGLONG: 'IntegerField',
+FIELD_TYPE.LONGLONG: 'BigIntegerField',
 FIELD_TYPE.SHORT: 'IntegerField',
 FIELD_TYPE.STRING: 'CharField',
 FIELD_TYPE.TIMESTAMP: 'DateTimeField',

Modified: django/trunk/django/db/backends/oracle/creation.py
===
--- django/trunk/django/db/backends/oracle/creation.py  2009-12-17 07:28:26 UTC 
(rev 11886)
+++ django/trunk/django/db/backends/oracle/creation.py  2009-12

Re: [Django] #6527: A bug in HttpResponse with iterators

2009-12-17 Thread Django
#6527: A bug in HttpResponse  with iterators
--+-
  Reporter:  daonb   | Owner:  ccahoon 
  
Status:  new  | Milestone:  
  
 Component:  HTTP handling|   Version:  SVN 
  
Resolution:   |  Keywords:  http 
iterators
 Stage:  Design decision needed   | Has_patch:  1   
  
Needs_docs:  0|   Needs_tests:  0   
  
Needs_better_patch:  0|  
--+-
Changes (by tomevans222):

  * stage:  Fixed on a branch => Design decision needed

Comment:

 The suggested fix, and the changes committed to soc2009/http-wsgi-
 improvements cannot possibly be committed to trunk. This severely breaks
 previously documented behaviour because, as mrmachine points out, you will
 no longer be able to iteratively generate large responses, and in
 particular, will not be able to iteratively deliver chunks of content to
 the client.

 This will break any page that takes a long time to fully generate, or
 about 10% of one of my sites.

 I think that any change will need to consider the different types of
 middleware that operate on a response's contents.
 Some types of middleware will only examine the generated response, eg
 CacheMiddleware will not modify the response, only store a version in the
 cache when complete.
 Others will want to replace the content and modify headers, eg
 GzipMiddleware.

 The current 'fix' only satisfies the requirements of the modifying
 middleware.

 I fixed the limitation of the cache middleware to cope with iterator based
 responses with code like so:

 {{{
 def buffer_and_cache_response(response, cache_key, timeout):
   from copy import copy
   def worker(rsp):
 from cStringIO import StringIO
 buf = StringIO()
 # we need to copy the response before we iterate through it
 # if we copy it after, then the response will have a generator object
 # on self._iterator that will not be picklable
 buffered_response = copy(rsp)
 for chunk in rsp:
   buf.write(chunk)
   yield chunk
 buffered_response.content = buf.getvalue()
 buf.close()
 rsp.close()
 cache.set(cache_key, buffered_response, timeout)
   new_resp = copy(response)
   new_resp._container = worker(response)
   new_resp._is_string = False
   return new_resp

 }}}

 Our cache middleware (virtually copy/paste of UpdateCacheMiddleware)
 determines if this is an iterator derived response by checking
 response._is_string (hacky, I know), and returns the rv of this function.
 This is just an example of a more intelligent, correct way to fix this
 issue.

-- 
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] #12392: Create_object generic view does not provide a way to pre-populate a form

2009-12-17 Thread Django
#12392: Create_object generic view does not provide a way to pre-populate a form
-+--
  Reporter:  stewart.mathe...@gmail.com  | Owner:  nobody   
  
Status:  new | Milestone:   
  
 Component:  Generic views   |   Version:  SVN  
  
Resolution:  |  Keywords:  
pre-populate, generic, view, dictionary
 Stage:  Unreviewed  | Has_patch:  0
  
Needs_docs:  0   |   Needs_tests:  0
  
Needs_better_patch:  0   |  
-+--
Comment (by oyvind):

 May be related to #6735

-- 
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] #12392: Create_object generic view does not provide a way to pre-populate a form

2009-12-17 Thread Django
#12392: Create_object generic view does not provide a way to pre-populate a form
-+--
  Reporter:  stewart.mathe...@gmail.com  | Owner:  nobody   
  
Status:  new | Milestone:   
  
 Component:  Generic views   |   Version:  SVN  
  
Resolution:  |  Keywords:  
pre-populate, generic, view, dictionary
 Stage:  Unreviewed  | Has_patch:  0
  
Needs_docs:  0   |   Needs_tests:  0
  
Needs_better_patch:  0   |  
-+--
Changes (by Stewart ):

  * needs_better_patch:  => 0
  * version:  1.1 => SVN
  * needs_tests:  => 0
  * needs_docs:  => 0

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

--

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




[Django] #12392: Create_object generic view does not provide a way to pre-populate a form

2009-12-17 Thread Django
#12392: Create_object generic view does not provide a way to pre-populate a form
-+--
 Reporter:  stewart.mathe...@gmail.com   |   Owner:  nobody
   Status:  new  |   Milestone:
Component:  Generic views| Version:  1.1   
 Keywords:  pre-populate, generic, view, dictionary  |   Stage:  Unreviewed
Has_patch:  0|  
-+--
 To my knowledge which may be limited there is no simple way to pre-
 populate a form that is being used in a generic view for creating an
 object. It would be fantastic to be able to pass a dictionary of values to
 to create object method so that when the form is rendered this dictionary
 of values gets pre-populated in the form.

 I apologise if this is an erroneous ticket. My experience with Django is
 limited however I have spent a lot of time reading the documentation and
 reading through the Django source code without having found any simple way
 of doing this.

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

--

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




[Django] #12391: Not used import in django.db

2009-12-17 Thread Django
#12391: Not used import in django.db
--+-
 Reporter:  vorushin  |   Owner:  nobody
   Status:  new   |   Milestone:
Component:  Database layer (models, ORM)  | Version:  SVN   
 Keywords:|   Stage:  Unreviewed
Has_patch:  1 |  
--+-
 I found in django/db/__init__.py import that is not used there at the
 moment:

 from django.utils.functional import curry

 I applied removed this sting and ran django tests - everything worked
 without errors. Patch, removing this unused import, is attached to this
 ticket.

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

--

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




Re: [Django] #11863: Add a method to the orm to create Model instances from raw sql queries

2009-12-17 Thread Django
#11863: Add a method to the orm to create Model instances from raw sql queries
---+
  Reporter:  seanoc| Owner:  seanoc
Status:  assigned  | Milestone:  1.2   
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  1 
Needs_docs:  1 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by bjunix):

 There is a minor typo at line 188 of the rc3 patch. I guess it should say:

 'connection.cursor directly for **other** types of queries.')

-- 
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] #4030: internationalization - auto translation of LANGUAGES

2009-12-17 Thread Django
#4030: internationalization - auto translation of LANGUAGES
---+
  Reporter:  t...@barnettweb.net   | Owner:  nobody 
  
Status:  new   | Milestone: 
  
 Component:  Internationalization  |   Version:  SVN
  
Resolution:|  Keywords:  LANGUAGES 
settings.py
 Stage:  Accepted  | Has_patch:  1  
  
Needs_docs:  1 |   Needs_tests:  0  
  
Needs_better_patch:  1 |  
---+
Changes (by anonymous):

 * cc: h...@atizo.com (added)

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

--

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




Re: [Django] #3400: [patch] Support for lookup separator with list_filter admin option

2009-12-17 Thread Django
#3400: [patch] Support for lookup separator with list_filter admin option
---+
  Reporter:  n...@intv.com.au  | Owner:  jakub_vysoky   
 
Status:  new   | Milestone:  1.2
 
 Component:  django.contrib.admin  |   Version:  newforms-admin 
 
Resolution:|  Keywords:  edc nfa-someday 
list_filter FilterSpec nfa-changelist ep2008
 Stage:  Accepted  | Has_patch:  1  
 
Needs_docs:  0 |   Needs_tests:  1  
 
Needs_better_patch:  1 |  
---+
Changes (by danfairs):

 * cc: dan.fa...@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.