[Django] #14598: Use example.com for example domains.

2010-11-01 Thread Django
#14598: Use example.com for example domains.
-+--
 Reporter:  alex.brinsm...@dataloft.com  |   Owner:  nobody
   Status:  new  |   Milestone:
Component:  Core framework   | Version:  1.2   
 Keywords:  nitpicking easy-pickings |   Stage:  Unreviewed
Has_patch:  1|  
-+--
 The comment for the ADMINS setting in settings.py and the sample value in
 global_settings.py use "u...@domain.com" as an example.  Per RFC 2606,
 "u...@example.com" should be used.

 [http://www.rfc-editor.org/rfc/rfc2606.txt].

 Also, domain.com is a real company with an active site.

-- 
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] #14597: request.is_secure() should support headers like: X-Forwarded-Protocol and X-Forwarded-Ssl

2010-11-01 Thread Django
#14597: request.is_secure() should support headers like: X-Forwarded-Protocol 
and X
-Forwarded-Ssl
---+
 Reporter:  gnotaras   |   Owner:  nobody
   Status:  new|   Milestone:
Component:  HTTP handling  | Version:  1.2   
 Keywords: |   Stage:  Unreviewed
Has_patch:  0  |  
---+
 {{{request.is_secure()}}} should support checking the existence of an HTTP
 header like '''X-Forwarded-Protocol''' and/or '''X-Forwarded-Ssl'''.
 Currently, request.is_secure() relies only upon the existence of the
 environment variable '''HTTPS''', which causes problems in cases that a
 request is proxied to Django from another web server, eg nginx.

 Related tickets in other projects:

  * http://www.cherrypy.org/changeset/1980
  * http://github.com/benoitc/gunicorn/issues/issue/51

 Of course, it is always possible to export the {{{HTTPS=on}}} environment
 variable to the shell that invokes the django server process, but
 supporting any of the aforementioned or other relevant http headers would
 make things easier and more straight-forward when setting up secure
 websites.

-- 
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] r14434 - in django/trunk: django/core/cache/backends tests/regressiontests/cache

2010-11-01 Thread noreply
Author: russellm
Date: 2010-11-02 00:55:08 -0500 (Tue, 02 Nov 2010)
New Revision: 14434

Modified:
   django/trunk/django/core/cache/backends/base.py
   django/trunk/django/core/cache/backends/db.py
   django/trunk/django/core/cache/backends/filebased.py
   django/trunk/django/core/cache/backends/locmem.py
   django/trunk/tests/regressiontests/cache/tests.py
Log:
Fixed #14596 -- Light refactoring of the cache backends.

 * Removes some code duplication,
 * Provides a convenient base class for db-like cache backends
 * Adds tests for an edge case of culling,
 * Marks the memcached tests as "skipped", rather than omitting them.

Thanks to Jonas H for the patch.

Modified: django/trunk/django/core/cache/backends/base.py
===
--- django/trunk/django/core/cache/backends/base.py 2010-11-02 05:41:46 UTC 
(rev 14433)
+++ django/trunk/django/core/cache/backends/base.py 2010-11-02 05:55:08 UTC 
(rev 14434)
@@ -22,6 +22,18 @@
 timeout = 300
 self.default_timeout = timeout
 
+max_entries = params.get('max_entries', 300)
+try:
+self._max_entries = int(max_entries)
+except (ValueError, TypeError):
+self._max_entries = 300
+
+cull_frequency = params.get('cull_frequency', 3)
+try:
+self._cull_frequency = int(cull_frequency)
+except (ValueError, TypeError):
+self._cull_frequency = 3
+
 def add(self, key, value, timeout=None):
 """
 Set a value in the cache if the key does not already exist. If

Modified: django/trunk/django/core/cache/backends/db.py
===
--- django/trunk/django/core/cache/backends/db.py   2010-11-02 05:41:46 UTC 
(rev 14433)
+++ django/trunk/django/core/cache/backends/db.py   2010-11-02 05:55:08 UTC 
(rev 14434)
@@ -25,7 +25,7 @@
 self.managed = True
 self.proxy = False
 
-class CacheClass(BaseCache):
+class BaseDatabaseCacheClass(BaseCache):
 def __init__(self, table, params):
 BaseCache.__init__(self, params)
 self._table = table
@@ -34,17 +34,7 @@
 _meta = Options(table)
 self.cache_model_class = CacheEntry
 
-max_entries = params.get('max_entries', 300)
-try:
-self._max_entries = int(max_entries)
-except (ValueError, TypeError):
-self._max_entries = 300
-cull_frequency = params.get('cull_frequency', 3)
-try:
-self._cull_frequency = int(cull_frequency)
-except (ValueError, TypeError):
-self._cull_frequency = 3
-
+class CacheClass(BaseDatabaseCacheClass):
 def get(self, key, default=None):
 self.validate_key(key)
 db = router.db_for_read(self.cache_model_class)

Modified: django/trunk/django/core/cache/backends/filebased.py
===
--- django/trunk/django/core/cache/backends/filebased.py2010-11-02 
05:41:46 UTC (rev 14433)
+++ django/trunk/django/core/cache/backends/filebased.py2010-11-02 
05:55:08 UTC (rev 14434)
@@ -14,19 +14,6 @@
 class CacheClass(BaseCache):
 def __init__(self, dir, params):
 BaseCache.__init__(self, params)
-
-max_entries = params.get('max_entries', 300)
-try:
-self._max_entries = int(max_entries)
-except (ValueError, TypeError):
-self._max_entries = 300
-
-cull_frequency = params.get('cull_frequency', 3)
-try:
-self._cull_frequency = int(cull_frequency)
-except (ValueError, TypeError):
-self._cull_frequency = 3
-
 self._dir = dir
 if not os.path.exists(self._dir):
 self._createdir()

Modified: django/trunk/django/core/cache/backends/locmem.py
===
--- django/trunk/django/core/cache/backends/locmem.py   2010-11-02 05:41:46 UTC 
(rev 14433)
+++ django/trunk/django/core/cache/backends/locmem.py   2010-11-02 05:55:08 UTC 
(rev 14434)
@@ -14,19 +14,6 @@
 BaseCache.__init__(self, params)
 self._cache = {}
 self._expire_info = {}
-
-max_entries = params.get('max_entries', 300)
-try:
-self._max_entries = int(max_entries)
-except (ValueError, TypeError):
-self._max_entries = 300
-
-cull_frequency = params.get('cull_frequency', 3)
-try:
-self._cull_frequency = int(cull_frequency)
-except (ValueError, TypeError):
-self._cull_frequency = 3
-
 self._lock = RWLock()
 
 def add(self, key, value, timeout=None):

Modified: django/trunk/tests/regressiontests/cache/tests.py
===
--- django/trunk/tests/regressiontests/cache/tests.py   2010-11-02 05:41:46 UTC 
(rev 14433)
+++ django/trunk/tests/regre

[Changeset] r14433 - django/trunk/django/db/backends

2010-11-01 Thread noreply
Author: Alex
Date: 2010-11-02 00:41:46 -0500 (Tue, 02 Nov 2010)
New Revision: 14433

Modified:
   django/trunk/django/db/backends/__init__.py
Log:
Avoid an O(n**2) operation where O(n) will suffice.  Possibly worth a second or 
two when running the test suite.

Modified: django/trunk/django/db/backends/__init__.py
===
--- django/trunk/django/db/backends/__init__.py 2010-11-02 05:31:53 UTC (rev 
14432)
+++ django/trunk/django/db/backends/__init__.py 2010-11-02 05:41:46 UTC (rev 
14433)
@@ -631,8 +631,10 @@
 for model in models.get_models(app):
 if router.allow_syncdb(self.connection.alias, model):
 all_models.append(model)
-return set([m for m in all_models
-if self.table_name_converter(m._meta.db_table) in 
map(self.table_name_converter, tables)
+tables = map(self.table_name_converter, tables)
+return set([
+m for m in all_models
+if self.table_name_converter(m._meta.db_table) in tables
 ])
 
 def sequence_list(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] r14432 - in django/branches/releases/1.2.X/tests: modeltests/proxy_model_inheritance regressiontests/templates regressiontests/utils

2010-11-01 Thread noreply
Author: Alex
Date: 2010-11-02 00:31:53 -0500 (Tue, 02 Nov 2010)
New Revision: 14432

Modified:
   
django/branches/releases/1.2.X/tests/modeltests/proxy_model_inheritance/tests.py
   django/branches/releases/1.2.X/tests/regressiontests/templates/tests.py
   django/branches/releases/1.2.X/tests/regressiontests/utils/module_loading.py
Log:
[1.2.X] Fixed a few more cases of the tests not properly restoring sys.path 
(follow up on [14430]).  Backport of [14431].

Modified: 
django/branches/releases/1.2.X/tests/modeltests/proxy_model_inheritance/tests.py
===
--- 
django/branches/releases/1.2.X/tests/modeltests/proxy_model_inheritance/tests.py
2010-11-02 05:31:19 UTC (rev 14431)
+++ 
django/branches/releases/1.2.X/tests/modeltests/proxy_model_inheritance/tests.py
2010-11-02 05:31:53 UTC (rev 14432)
@@ -17,7 +17,7 @@
 class ProxyModelInheritanceTests(TransactionTestCase):
 
 def setUp(self):
-self.old_sys_path = sys.path
+self.old_sys_path = sys.path[:]
 sys.path.append(os.path.dirname(os.path.abspath(__file__)))
 self.old_installed_apps = settings.INSTALLED_APPS
 settings.INSTALLED_APPS = ('app1', 'app2')

Modified: 
django/branches/releases/1.2.X/tests/regressiontests/templates/tests.py
===
--- django/branches/releases/1.2.X/tests/regressiontests/templates/tests.py 
2010-11-02 05:31:19 UTC (rev 14431)
+++ django/branches/releases/1.2.X/tests/regressiontests/templates/tests.py 
2010-11-02 05:31:53 UTC (rev 14432)
@@ -1356,7 +1356,7 @@
 class TemplateTagLoading(unittest.TestCase):
 
 def setUp(self):
-self.old_path = sys.path
+self.old_path = sys.path[:]
 self.old_apps = settings.INSTALLED_APPS
 self.egg_dir = '%s/eggs' % os.path.dirname(__file__)
 self.old_tag_modules = template.templatetags_modules

Modified: 
django/branches/releases/1.2.X/tests/regressiontests/utils/module_loading.py
===
--- 
django/branches/releases/1.2.X/tests/regressiontests/utils/module_loading.py
2010-11-02 05:31:19 UTC (rev 14431)
+++ 
django/branches/releases/1.2.X/tests/regressiontests/utils/module_loading.py
2010-11-02 05:31:53 UTC (rev 14432)
@@ -26,7 +26,7 @@
 
 class EggLoader(unittest.TestCase):
 def setUp(self):
-self.old_path = sys.path
+self.old_path = sys.path[:]
 self.egg_dir = '%s/eggs' % os.path.dirname(__file__)
 
 def tearDown(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] r14431 - in django/trunk/tests: modeltests/proxy_model_inheritance regressiontests/templates regressiontests/utils

2010-11-01 Thread noreply
Author: Alex
Date: 2010-11-02 00:31:19 -0500 (Tue, 02 Nov 2010)
New Revision: 14431

Modified:
   django/trunk/tests/modeltests/proxy_model_inheritance/tests.py
   django/trunk/tests/regressiontests/templates/tests.py
   django/trunk/tests/regressiontests/utils/module_loading.py
Log:
Fixed a few more cases of the tests not properly restoring sys.path (follow up 
on [14429]).

Modified: django/trunk/tests/modeltests/proxy_model_inheritance/tests.py
===
--- django/trunk/tests/modeltests/proxy_model_inheritance/tests.py  
2010-11-02 05:28:12 UTC (rev 14430)
+++ django/trunk/tests/modeltests/proxy_model_inheritance/tests.py  
2010-11-02 05:31:19 UTC (rev 14431)
@@ -17,7 +17,7 @@
 class ProxyModelInheritanceTests(TransactionTestCase):
 
 def setUp(self):
-self.old_sys_path = sys.path
+self.old_sys_path = sys.path[:]
 sys.path.append(os.path.dirname(os.path.abspath(__file__)))
 self.old_installed_apps = settings.INSTALLED_APPS
 settings.INSTALLED_APPS = ('app1', 'app2')

Modified: django/trunk/tests/regressiontests/templates/tests.py
===
--- django/trunk/tests/regressiontests/templates/tests.py   2010-11-02 
05:28:12 UTC (rev 14430)
+++ django/trunk/tests/regressiontests/templates/tests.py   2010-11-02 
05:31:19 UTC (rev 14431)
@@ -1356,7 +1356,7 @@
 class TemplateTagLoading(unittest.TestCase):
 
 def setUp(self):
-self.old_path = sys.path
+self.old_path = sys.path[:]
 self.old_apps = settings.INSTALLED_APPS
 self.egg_dir = '%s/eggs' % os.path.dirname(__file__)
 self.old_tag_modules = template.templatetags_modules

Modified: django/trunk/tests/regressiontests/utils/module_loading.py
===
--- django/trunk/tests/regressiontests/utils/module_loading.py  2010-11-02 
05:28:12 UTC (rev 14430)
+++ django/trunk/tests/regressiontests/utils/module_loading.py  2010-11-02 
05:31:19 UTC (rev 14431)
@@ -27,7 +27,7 @@
 
 class EggLoader(unittest.TestCase):
 def setUp(self):
-self.old_path = sys.path
+self.old_path = sys.path[:]
 self.egg_dir = '%s/eggs' % os.path.dirname(__file__)
 
 def tearDown(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] r14430 - django/branches/releases/1.2.X/tests/regressiontests/app_loading

2010-11-01 Thread noreply
Author: Alex
Date: 2010-11-02 00:28:12 -0500 (Tue, 02 Nov 2010)
New Revision: 14430

Modified:
   django/branches/releases/1.2.X/tests/regressiontests/app_loading/tests.py
Log:
[1.2.X] Properly handle the fact that lists are mutable when trying to maintain 
state in a test.  Backport of [14429].

Modified: 
django/branches/releases/1.2.X/tests/regressiontests/app_loading/tests.py
===
--- django/branches/releases/1.2.X/tests/regressiontests/app_loading/tests.py   
2010-11-02 05:27:24 UTC (rev 14429)
+++ django/branches/releases/1.2.X/tests/regressiontests/app_loading/tests.py   
2010-11-02 05:28:12 UTC (rev 14430)
@@ -10,7 +10,7 @@
 
 class InstalledAppsGlobbingTest(TestCase):
 def setUp(self):
-self.OLD_SYS_PATH = sys.path
+self.OLD_SYS_PATH = sys.path[:]
 sys.path.append(os.path.dirname(os.path.abspath(__file__)))
 self.OLD_TZ = os.environ.get("TZ")
 
@@ -28,7 +28,7 @@
 class EggLoadingTest(TestCase):
 
 def setUp(self):
-self.old_path = sys.path
+self.old_path = sys.path[:]
 self.egg_dir = '%s/eggs' % os.path.dirname(__file__)
 
 # This test adds dummy applications to the app cache. These

-- 
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] r14429 - django/trunk/tests/regressiontests/app_loading

2010-11-01 Thread noreply
Author: Alex
Date: 2010-11-02 00:27:24 -0500 (Tue, 02 Nov 2010)
New Revision: 14429

Modified:
   django/trunk/tests/regressiontests/app_loading/tests.py
Log:
Properly handle the fact that lists are mutable when trying to maintain state 
in a test.

Modified: django/trunk/tests/regressiontests/app_loading/tests.py
===
--- django/trunk/tests/regressiontests/app_loading/tests.py 2010-11-02 
05:23:44 UTC (rev 14428)
+++ django/trunk/tests/regressiontests/app_loading/tests.py 2010-11-02 
05:27:24 UTC (rev 14429)
@@ -10,7 +10,7 @@
 
 class InstalledAppsGlobbingTest(TestCase):
 def setUp(self):
-self.OLD_SYS_PATH = sys.path
+self.OLD_SYS_PATH = sys.path[:]
 sys.path.append(os.path.dirname(os.path.abspath(__file__)))
 self.OLD_TZ = os.environ.get("TZ")
 
@@ -28,7 +28,7 @@
 class EggLoadingTest(TestCase):
 
 def setUp(self):
-self.old_path = sys.path
+self.old_path = sys.path[:]
 self.egg_dir = '%s/eggs' % os.path.dirname(__file__)
 
 # This test adds dummy applications to the app cache. These

-- 
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] r14428 - django/branches/releases/1.2.X/tests/regressiontests/app_loading

2010-11-01 Thread noreply
Author: russellm
Date: 2010-11-02 00:23:44 -0500 (Tue, 02 Nov 2010)
New Revision: 14428

Modified:
   django/branches/releases/1.2.X/tests/regressiontests/app_loading/tests.py
Log:
[1.2.X] Migrated app_loading doctests.

Backport of r14427 from trunk.

Modified: 
django/branches/releases/1.2.X/tests/regressiontests/app_loading/tests.py
===
--- django/branches/releases/1.2.X/tests/regressiontests/app_loading/tests.py   
2010-11-02 05:21:48 UTC (rev 14427)
+++ django/branches/releases/1.2.X/tests/regressiontests/app_loading/tests.py   
2010-11-02 05:23:44 UTC (rev 14428)
@@ -7,27 +7,24 @@
 from django.conf import Settings
 from django.db.models.loading import cache, load_app
 
-__test__ = {"API_TESTS": """
-Test the globbing of INSTALLED_APPS.
 
->>> old_sys_path = sys.path
->>> sys.path.append(os.path.dirname(os.path.abspath(__file__)))
+class InstalledAppsGlobbingTest(TestCase):
+def setUp(self):
+self.OLD_SYS_PATH = sys.path
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
+self.OLD_TZ = os.environ.get("TZ")
 
->>> old_tz = os.environ.get("TZ")
->>> settings = Settings('test_settings')
+def test_globbing(self):
+settings = Settings('test_settings')
+self.assertEquals(settings.INSTALLED_APPS, ['parent.app', 
'parent.app1', 'parent.app_2'])
 
->>> settings.INSTALLED_APPS
-['parent.app', 'parent.app1', 'parent.app_2']
+def tearDown(self):
+sys.path = self.OLD_SYS_PATH
+if hasattr(time, "tzset") and self.OLD_TZ:
+os.environ["TZ"] = self.OLD_TZ
+time.tzset()
 
->>> sys.path = old_sys_path
 
-# Undo a side-effect of installing a new settings object.
->>> if hasattr(time, "tzset") and old_tz:
-... os.environ["TZ"] = old_tz
-... time.tzset()
-
-"""}
-
 class EggLoadingTest(TestCase):
 
 def setUp(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] r14427 - django/trunk/tests/regressiontests/app_loading

2010-11-01 Thread noreply
Author: russellm
Date: 2010-11-02 00:21:48 -0500 (Tue, 02 Nov 2010)
New Revision: 14427

Modified:
   django/trunk/tests/regressiontests/app_loading/tests.py
Log:
Migrated app_loading doctests.

Modified: django/trunk/tests/regressiontests/app_loading/tests.py
===
--- django/trunk/tests/regressiontests/app_loading/tests.py 2010-11-02 
05:15:19 UTC (rev 14426)
+++ django/trunk/tests/regressiontests/app_loading/tests.py 2010-11-02 
05:21:48 UTC (rev 14427)
@@ -7,27 +7,24 @@
 from django.db.models.loading import cache, load_app
 from django.utils.unittest import TestCase
 
-__test__ = {"API_TESTS": """
-Test the globbing of INSTALLED_APPS.
 
->>> old_sys_path = sys.path
->>> sys.path.append(os.path.dirname(os.path.abspath(__file__)))
+class InstalledAppsGlobbingTest(TestCase):
+def setUp(self):
+self.OLD_SYS_PATH = sys.path
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
+self.OLD_TZ = os.environ.get("TZ")
 
->>> old_tz = os.environ.get("TZ")
->>> settings = Settings('test_settings')
+def test_globbing(self):
+settings = Settings('test_settings')
+self.assertEquals(settings.INSTALLED_APPS, ['parent.app', 
'parent.app1', 'parent.app_2'])
 
->>> settings.INSTALLED_APPS
-['parent.app', 'parent.app1', 'parent.app_2']
+def tearDown(self):
+sys.path = self.OLD_SYS_PATH
+if hasattr(time, "tzset") and self.OLD_TZ:
+os.environ["TZ"] = self.OLD_TZ
+time.tzset()
 
->>> sys.path = old_sys_path
 
-# Undo a side-effect of installing a new settings object.
->>> if hasattr(time, "tzset") and old_tz:
-... os.environ["TZ"] = old_tz
-... time.tzset()
-
-"""}
-
 class EggLoadingTest(TestCase):
 
 def setUp(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.



Re: [Django] #11694: lighttpd fastcgi documentation not working

2010-11-01 Thread Django
#11694: lighttpd fastcgi documentation not working
--+-
  Reporter:  bugger...@gmail.com  | Owner:  gabrielhurley
Status:  assigned | Milestone:   
 Component:  Documentation|   Version:  1.1  
Resolution:   |  Keywords:  deployment   
 Stage:  Accepted | Has_patch:  0
Needs_docs:  0|   Needs_tests:  0
Needs_better_patch:  0|  
--+-
Changes (by onel...@gmail.com):

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

Comment:

 CC'ing myself so I remember to add something regarding init.d scripts for
 site daemons.  Had issues with permissions using unix sockets (unless
 managed via services).  I'm imagining socket is preferred for those
 running the fcgi process on the same host as the web server.

-- 
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] r14424 - django/branches/releases/1.2.X/tests/modeltests/lookup

2010-11-01 Thread noreply
Author: russellm
Date: 2010-11-01 23:38:29 -0500 (Mon, 01 Nov 2010)
New Revision: 14424

Added:
   django/branches/releases/1.2.X/tests/modeltests/lookup/tests.py
Modified:
   django/branches/releases/1.2.X/tests/modeltests/lookup/models.py
Log:
[1.2.X] Migrated lookup doctests. Thanks to George Sakkis for the patch.

Backport of r14423 from trunk.

Modified: django/branches/releases/1.2.X/tests/modeltests/lookup/models.py
===
--- django/branches/releases/1.2.X/tests/modeltests/lookup/models.py
2010-11-02 04:01:36 UTC (rev 14423)
+++ django/branches/releases/1.2.X/tests/modeltests/lookup/models.py
2010-11-02 04:38:29 UTC (rev 14424)
@@ -4,8 +4,7 @@
 This demonstrates features of the database API.
 """
 
-from django.db import models, DEFAULT_DB_ALIAS
-from django.conf import settings
+from django.db import models
 
 class Article(models.Model):
 headline = models.CharField(max_length=100)
@@ -15,403 +14,3 @@
 
 def __unicode__(self):
 return self.headline
-
-__test__ = {'API_TESTS': r"""
-# We can use .exists() to check that there are none yet
->>> Article.objects.exists()
-False
-
-# Create a couple of Articles.
->>> from datetime import datetime
->>> a1 = Article(headline='Article 1', pub_date=datetime(2005, 7, 26))
->>> a1.save()
->>> a2 = Article(headline='Article 2', pub_date=datetime(2005, 7, 27))
->>> a2.save()
->>> a3 = Article(headline='Article 3', pub_date=datetime(2005, 7, 27))
->>> a3.save()
->>> a4 = Article(headline='Article 4', pub_date=datetime(2005, 7, 28))
->>> a4.save()
->>> a5 = Article(headline='Article 5', pub_date=datetime(2005, 8, 1, 9, 0))
->>> a5.save()
->>> a6 = Article(headline='Article 6', pub_date=datetime(2005, 8, 1, 8, 0))
->>> a6.save()
->>> a7 = Article(headline='Article 7', pub_date=datetime(2005, 7, 27))
->>> a7.save()
-
-# There should be some now!
->>> Article.objects.exists()
-True
-"""}
-
-if settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'] in (
-'django.db.backends.postgresql',
-'django.db.backends.postgresql_pysycopg2'):
-__test__['API_TESTS'] += r"""
-# text matching tests for PostgreSQL 8.3
->>> Article.objects.filter(id__iexact='1')
-[]
->>> Article.objects.filter(pub_date__startswith='2005')
-[, , , , , , ]
-"""
-
-__test__['API_TESTS'] += r"""
-# Each QuerySet gets iterator(), which is a generator that "lazily" returns
-# results using database-level iteration.
->>> for a in Article.objects.iterator():
-... print a.headline
-Article 5
-Article 6
-Article 4
-Article 2
-Article 3
-Article 7
-Article 1
-
-# iterator() can be used on any QuerySet.
->>> for a in Article.objects.filter(headline__endswith='4').iterator():
-... print a.headline
-Article 4
-
-# count() returns the number of objects matching search criteria.
->>> Article.objects.count()
-7L
->>> Article.objects.filter(pub_date__exact=datetime(2005, 7, 27)).count()
-3L
->>> Article.objects.filter(headline__startswith='Blah blah').count()
-0L
-
-# count() should respect sliced query sets.
->>> articles = Article.objects.all()
->>> articles.count()
-7L
->>> articles[:4].count()
-4
->>> articles[1:100].count()
-6L
->>> articles[10:100].count()
-0
-
-# Date and date/time lookups can also be done with strings.
->>> Article.objects.filter(pub_date__exact='2005-07-27 00:00:00').count()
-3L
-
-# in_bulk() takes a list of IDs and returns a dictionary mapping IDs
-# to objects.
->>> arts = Article.objects.in_bulk([1, 2])
->>> arts[1]
-
->>> arts[2]
-
->>> Article.objects.in_bulk([3])
-{3: }
->>> Article.objects.in_bulk(set([3]))
-{3: }
->>> Article.objects.in_bulk(frozenset([3]))
-{3: }
->>> Article.objects.in_bulk((3,))
-{3: }
->>> Article.objects.in_bulk([1000])
-{}
->>> Article.objects.in_bulk([])
-{}
->>> Article.objects.in_bulk('foo')
-Traceback (most recent call last):
-...
-AssertionError: in_bulk() must be provided with a list of IDs.
->>> Article.objects.in_bulk()
-Traceback (most recent call last):
-...
-TypeError: in_bulk() takes exactly 2 arguments (1 given)
->>> Article.objects.in_bulk(headline__startswith='Blah')
-Traceback (most recent call last):
-...
-TypeError: in_bulk() got an unexpected keyword argument 'headline__startswith'
-
-# values() returns a list of dictionaries instead of object instances -- and
-# you can specify which fields you want to retrieve.
->>> Article.objects.values('headline')
-[{'headline': u'Article 5'}, {'headline': u'Article 6'}, {'headline': 
u'Article 4'}, {'headline': u'Article 2'}, {'headline': u'Article 3'}, 
{'headline': u'Article 7'}, {'headline': u'Article 1'}]
->>> Article.objects.filter(pub_date__exact=datetime(2005, 7, 27)).values('id')
-[{'id': 2}, {'id': 3}, {'id': 7}]
->>> list(Article.objects.values('id', 'headline')) == [{'id': 5, 'headline': 
'Article 5'}, {'id': 6, 'headline': 'Article 6'}, {'id': 4, 'headline': 
'Article 4'}, {'id': 2, 'headline': 'Article 2'}, {'id': 3, 'headline': 
'Article 3'}, {'id': 7, 'headline': 'Article 

[Changeset] r14423 - django/trunk/tests/modeltests/lookup

2010-11-01 Thread noreply
Author: russellm
Date: 2010-11-01 23:01:36 -0500 (Mon, 01 Nov 2010)
New Revision: 14423

Added:
   django/trunk/tests/modeltests/lookup/tests.py
Modified:
   django/trunk/tests/modeltests/lookup/models.py
Log:
Migrated lookup doctests. Thanks to George Sakkis for the patch.

Modified: django/trunk/tests/modeltests/lookup/models.py
===
--- django/trunk/tests/modeltests/lookup/models.py  2010-11-02 02:48:43 UTC 
(rev 14422)
+++ django/trunk/tests/modeltests/lookup/models.py  2010-11-02 04:01:36 UTC 
(rev 14423)
@@ -15,404 +15,3 @@
 
 def __unicode__(self):
 return self.headline
-
-__test__ = {'API_TESTS': r"""
-# We can use .exists() to check that there are none yet
->>> Article.objects.exists()
-False
-
-# Create a couple of Articles.
->>> from datetime import datetime
->>> a1 = Article(headline='Article 1', pub_date=datetime(2005, 7, 26))
->>> a1.save()
->>> a2 = Article(headline='Article 2', pub_date=datetime(2005, 7, 27))
->>> a2.save()
->>> a3 = Article(headline='Article 3', pub_date=datetime(2005, 7, 27))
->>> a3.save()
->>> a4 = Article(headline='Article 4', pub_date=datetime(2005, 7, 28))
->>> a4.save()
->>> a5 = Article(headline='Article 5', pub_date=datetime(2005, 8, 1, 9, 0))
->>> a5.save()
->>> a6 = Article(headline='Article 6', pub_date=datetime(2005, 8, 1, 8, 0))
->>> a6.save()
->>> a7 = Article(headline='Article 7', pub_date=datetime(2005, 7, 27))
->>> a7.save()
-
-# There should be some now!
->>> Article.objects.exists()
-True
-
-# Integer value can be queried using string
->>> Article.objects.filter(id__iexact='1')
-[]
-
-"""}
-
-if connection.features.supports_date_lookup_using_string:
-__test__['API_TESTS'] += r"""
-# A date lookup can be performed using a string search
->>> Article.objects.filter(pub_date__startswith='2005')
-[, , , , , , ]
-"""
-
-__test__['API_TESTS'] += r"""
-# Each QuerySet gets iterator(), which is a generator that "lazily" returns
-# results using database-level iteration.
->>> for a in Article.objects.iterator():
-... print a.headline
-Article 5
-Article 6
-Article 4
-Article 2
-Article 3
-Article 7
-Article 1
-
-# iterator() can be used on any QuerySet.
->>> for a in Article.objects.filter(headline__endswith='4').iterator():
-... print a.headline
-Article 4
-
-# count() returns the number of objects matching search criteria.
->>> Article.objects.count()
-7L
->>> Article.objects.filter(pub_date__exact=datetime(2005, 7, 27)).count()
-3L
->>> Article.objects.filter(headline__startswith='Blah blah').count()
-0L
-
-# count() should respect sliced query sets.
->>> articles = Article.objects.all()
->>> articles.count()
-7L
->>> articles[:4].count()
-4
->>> articles[1:100].count()
-6L
->>> articles[10:100].count()
-0
-
-# Date and date/time lookups can also be done with strings.
->>> Article.objects.filter(pub_date__exact='2005-07-27 00:00:00').count()
-3L
-
-# in_bulk() takes a list of IDs and returns a dictionary mapping IDs
-# to objects.
->>> arts = Article.objects.in_bulk([1, 2])
->>> arts[1]
-
->>> arts[2]
-
->>> Article.objects.in_bulk([3])
-{3: }
->>> Article.objects.in_bulk(set([3]))
-{3: }
->>> Article.objects.in_bulk(frozenset([3]))
-{3: }
->>> Article.objects.in_bulk((3,))
-{3: }
->>> Article.objects.in_bulk([1000])
-{}
->>> Article.objects.in_bulk([])
-{}
->>> Article.objects.in_bulk('foo')
-Traceback (most recent call last):
-...
-AssertionError: in_bulk() must be provided with a list of IDs.
->>> Article.objects.in_bulk()
-Traceback (most recent call last):
-...
-TypeError: in_bulk() takes exactly 2 arguments (1 given)
->>> Article.objects.in_bulk(headline__startswith='Blah')
-Traceback (most recent call last):
-...
-TypeError: in_bulk() got an unexpected keyword argument 'headline__startswith'
-
-# values() returns a list of dictionaries instead of object instances -- and
-# you can specify which fields you want to retrieve.
->>> Article.objects.values('headline')
-[{'headline': u'Article 5'}, {'headline': u'Article 6'}, {'headline': 
u'Article 4'}, {'headline': u'Article 2'}, {'headline': u'Article 3'}, 
{'headline': u'Article 7'}, {'headline': u'Article 1'}]
->>> Article.objects.filter(pub_date__exact=datetime(2005, 7, 27)).values('id')
-[{'id': 2}, {'id': 3}, {'id': 7}]
->>> list(Article.objects.values('id', 'headline')) == [{'id': 5, 'headline': 
'Article 5'}, {'id': 6, 'headline': 'Article 6'}, {'id': 4, 'headline': 
'Article 4'}, {'id': 2, 'headline': 'Article 2'}, {'id': 3, 'headline': 
'Article 3'}, {'id': 7, 'headline': 'Article 7'}, {'id': 1, 'headline': 
'Article 1'}]
-True
-
->>> for d in Article.objects.values('id', 'headline'):
-... i = d.items()
-... i.sort()
-... i
-[('headline', u'Article 5'), ('id', 5)]
-[('headline', u'Article 6'), ('id', 6)]
-[('headline', u'Article 4'), ('id', 4)]
-[('headline', u'Article 2'), ('id', 2)]
-[('headline', u'Article 3'), ('id', 3)]
-[('headline', u'Article 7'), ('id', 7)]
-[('headline', u

Re: [Django] #10092: Reference documentation lowest-level headings too small and lack indents

2010-11-01 Thread Django
#10092: Reference documentation lowest-level headings too small and lack indents
+---
  Reporter:  adrian_nye | Owner:  jacob
Status:  assigned   | Milestone:  1.3  
 Component:  Documentation  |   Version:  SVN  
Resolution: |  Keywords:  reference
 Stage:  Accepted   | Has_patch:  1
Needs_docs:  0  |   Needs_tests:  0
Needs_better_patch:  0  |  
+---
Changes (by poswald):

  * milestone:  => 1.3

Comment:

 Somewhat related to #11930

-- 
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] r14422 - django/branches/releases/1.2.X/tests/modeltests/basic

2010-11-01 Thread noreply
Author: russellm
Date: 2010-11-01 21:48:43 -0500 (Mon, 01 Nov 2010)
New Revision: 14422

Added:
   django/branches/releases/1.2.X/tests/modeltests/basic/tests.py
Modified:
   django/branches/releases/1.2.X/tests/modeltests/basic/models.py
Log:
[1.2.X] Migrated basic doctests. Thanks to Preston Timmons for the patch.

Backport of r14421 from trunk.

Modified: django/branches/releases/1.2.X/tests/modeltests/basic/models.py
===
--- django/branches/releases/1.2.X/tests/modeltests/basic/models.py 
2010-11-02 02:32:23 UTC (rev 14421)
+++ django/branches/releases/1.2.X/tests/modeltests/basic/models.py 
2010-11-02 02:48:43 UTC (rev 14422)
@@ -15,414 +15,3 @@
 
 def __unicode__(self):
 return self.headline
-
-__test__ = {'API_TESTS': """
-# No articles are in the system yet.
->>> Article.objects.all()
-[]
-
-# Create an Article.
->>> from datetime import datetime
->>> a = Article(id=None, headline='Area man programs in Python', 
pub_date=datetime(2005, 7, 28))
-
-# Save it into the database. You have to call save() explicitly.
->>> a.save()
-
-# Now it has an ID. Note it's a long integer, as designated by the trailing 
"L".
->>> a.id
-1L
-
-# Models have a pk property that is an alias for the primary key attribute (by
-# default, the 'id' attribute).
->>> a.pk
-1L
-
-# Access database columns via Python attributes.
->>> a.headline
-'Area man programs in Python'
->>> a.pub_date
-datetime.datetime(2005, 7, 28, 0, 0)
-
-# Change values by changing the attributes, then calling save().
->>> a.headline = 'Area woman programs in Python'
->>> a.save()
-
-# Article.objects.all() returns all the articles in the database.
->>> Article.objects.all()
-[]
-
-# Django provides a rich database lookup API.
->>> Article.objects.get(id__exact=1)
-
->>> Article.objects.get(headline__startswith='Area woman')
-
->>> Article.objects.get(pub_date__year=2005)
-
->>> Article.objects.get(pub_date__year=2005, pub_date__month=7)
-
->>> Article.objects.get(pub_date__year=2005, pub_date__month=7, 
pub_date__day=28)
-
->>> Article.objects.get(pub_date__week_day=5)
-
-
-# The "__exact" lookup type can be omitted, as a shortcut.
->>> Article.objects.get(id=1)
-
->>> Article.objects.get(headline='Area woman programs in Python')
-
-
->>> Article.objects.filter(pub_date__year=2005)
-[]
->>> Article.objects.filter(pub_date__year=2004)
-[]
->>> Article.objects.filter(pub_date__year=2005, pub_date__month=7)
-[]
-
->>> Article.objects.filter(pub_date__week_day=5)
-[]
->>> Article.objects.filter(pub_date__week_day=6)
-[]
-
-# Django raises an Article.DoesNotExist exception for get() if the parameters
-# don't match any object.
->>> Article.objects.get(id__exact=2)
-Traceback (most recent call last):
-...
-DoesNotExist: Article matching query does not exist.
-
->>> Article.objects.get(pub_date__year=2005, pub_date__month=8)
-Traceback (most recent call last):
-...
-DoesNotExist: Article matching query does not exist.
-
->>> Article.objects.get(pub_date__week_day=6)
-Traceback (most recent call last):
-...
-DoesNotExist: Article matching query does not exist.
-
-# Lookup by a primary key is the most common case, so Django provides a
-# shortcut for primary-key exact lookups.
-# The following is identical to articles.get(id=1).
->>> Article.objects.get(pk=1)
-
-
-# pk can be used as a shortcut for the primary key name in any query
->>> Article.objects.filter(pk__in=[1])
-[]
-
-# Model instances of the same type and same ID are considered equal.
->>> a = Article.objects.get(pk=1)
->>> b = Article.objects.get(pk=1)
->>> a == b
-True
-
-# You can initialize a model instance using positional arguments, which should
-# match the field order as defined in the model.
->>> a2 = Article(None, 'Second article', datetime(2005, 7, 29))
->>> a2.save()
->>> a2.id
-2L
->>> a2.headline
-'Second article'
->>> a2.pub_date
-datetime.datetime(2005, 7, 29, 0, 0)
-
-# ...or, you can use keyword arguments.
->>> a3 = Article(id=None, headline='Third article', pub_date=datetime(2005, 7, 
30))
->>> a3.save()
->>> a3.id
-3L
->>> a3.headline
-'Third article'
->>> a3.pub_date
-datetime.datetime(2005, 7, 30, 0, 0)
-
-# You can also mix and match position and keyword arguments, but be sure not to
-# duplicate field information.
->>> a4 = Article(None, 'Fourth article', pub_date=datetime(2005, 7, 31))
->>> a4.save()
->>> a4.headline
-'Fourth article'
-
-# Don't use invalid keyword arguments.
->>> a5 = Article(id=None, headline='Invalid', pub_date=datetime(2005, 7, 31), 
foo='bar')
-Traceback (most recent call last):
-...
-TypeError: 'foo' is an invalid keyword argument for this function
-
-# You can leave off the value for an AutoField when creating an object, because
-# it'll get filled in automatically when you save().
->>> a5 = Article(headline='Article 6', pub_date=datetime(2005, 7, 31))
->>> a5.save()
->>> a5.id
-5L
->>> a5.headline
-'Article 6'
-
-# If you leave off a field with "defaul

Re: [Django] #11864: Relationship backreference documentation is hard to find

2010-11-01 Thread Django
#11864: Relationship backreference documentation is hard to find
+---
  Reporter:  anonymous  | Owner:  dwillis
Status:  assigned   | Milestone:  1.3
 Component:  Documentation  |   Version:  1.1
Resolution: |  Keywords:  relationships foreigkey
 Stage:  Accepted   | Has_patch:  1  
Needs_docs:  0  |   Needs_tests:  0  
Needs_better_patch:  1  |  
+---
Changes (by poswald):

  * milestone:  => 1.3

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

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



Re: [Django] #11930: Django docs styles confuse H3 & H4

2010-11-01 Thread Django
#11930: Django docs styles confuse H3 & H4
--+-
  Reporter:  da...@whatcould.com  | Owner:  nobody
Status:  new  | Milestone:  1.3   
 Component:  Documentation|   Version:  1.1   
Resolution:   |  Keywords:
 Stage:  Accepted | Has_patch:  0 
Needs_docs:  0|   Needs_tests:  0 
Needs_better_patch:  0|  
--+-
Changes (by poswald):

  * milestone:  => 1.3

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

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



Re: [Django] #13397: Include third level headings in the document TOC

2010-11-01 Thread Django
#13397: Include third level headings in the document TOC
+---
  Reporter:  cyang  | Owner:  nobody
Status:  new| Milestone:  1.3   
 Component:  Documentation  |   Version:  1.1   
Resolution: |  Keywords:
 Stage:  Accepted   | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by poswald):

  * milestone:  => 1.3

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

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



[Changeset] r14421 - django/trunk/tests/modeltests/basic

2010-11-01 Thread noreply
Author: russellm
Date: 2010-11-01 21:32:23 -0500 (Mon, 01 Nov 2010)
New Revision: 14421

Added:
   django/trunk/tests/modeltests/basic/tests.py
Modified:
   django/trunk/tests/modeltests/basic/models.py
Log:
Migrated basic doctests. Thanks to Preston Timmons for the patch.

Modified: django/trunk/tests/modeltests/basic/models.py
===
--- django/trunk/tests/modeltests/basic/models.py   2010-11-02 02:01:18 UTC 
(rev 14420)
+++ django/trunk/tests/modeltests/basic/models.py   2010-11-02 02:32:23 UTC 
(rev 14421)
@@ -15,411 +15,3 @@
 
 def __unicode__(self):
 return self.headline
-
-__test__ = {'API_TESTS': """
-# No articles are in the system yet.
->>> Article.objects.all()
-[]
-
-# Create an Article.
->>> from datetime import datetime
->>> a = Article(id=None, headline='Area man programs in Python', 
pub_date=datetime(2005, 7, 28))
-
-# Save it into the database. You have to call save() explicitly.
->>> a.save()
-
-# Now it has an ID. Note it's a long integer, as designated by the trailing 
"L".
->>> a.id
-1L
-
-# Models have a pk property that is an alias for the primary key attribute (by
-# default, the 'id' attribute).
->>> a.pk
-1L
-
-# Access database columns via Python attributes.
->>> a.headline
-'Area man programs in Python'
->>> a.pub_date
-datetime.datetime(2005, 7, 28, 0, 0)
-
-# Change values by changing the attributes, then calling save().
->>> a.headline = 'Area woman programs in Python'
->>> a.save()
-
-# Article.objects.all() returns all the articles in the database.
->>> Article.objects.all()
-[]
-
-# Django provides a rich database lookup API.
->>> Article.objects.get(id__exact=1)
-
->>> Article.objects.get(headline__startswith='Area woman')
-
->>> Article.objects.get(pub_date__year=2005)
-
->>> Article.objects.get(pub_date__year=2005, pub_date__month=7)
-
->>> Article.objects.get(pub_date__year=2005, pub_date__month=7, 
pub_date__day=28)
-
->>> Article.objects.get(pub_date__week_day=5)
-
-
-# The "__exact" lookup type can be omitted, as a shortcut.
->>> Article.objects.get(id=1)
-
->>> Article.objects.get(headline='Area woman programs in Python')
-
-
->>> Article.objects.filter(pub_date__year=2005)
-[]
->>> Article.objects.filter(pub_date__year=2004)
-[]
->>> Article.objects.filter(pub_date__year=2005, pub_date__month=7)
-[]
-
->>> Article.objects.filter(pub_date__week_day=5)
-[]
->>> Article.objects.filter(pub_date__week_day=6)
-[]
-
-# Django raises an Article.DoesNotExist exception for get() if the parameters
-# don't match any object.
->>> Article.objects.get(id__exact=2)
-Traceback (most recent call last):
-...
-DoesNotExist: Article matching query does not exist.
-
->>> Article.objects.get(pub_date__year=2005, pub_date__month=8)
-Traceback (most recent call last):
-...
-DoesNotExist: Article matching query does not exist.
-
->>> Article.objects.get(pub_date__week_day=6)
-Traceback (most recent call last):
-...
-DoesNotExist: Article matching query does not exist.
-
-# Lookup by a primary key is the most common case, so Django provides a
-# shortcut for primary-key exact lookups.
-# The following is identical to articles.get(id=1).
->>> Article.objects.get(pk=1)
-
-
-# pk can be used as a shortcut for the primary key name in any query
->>> Article.objects.filter(pk__in=[1])
-[]
-
-# Model instances of the same type and same ID are considered equal.
->>> a = Article.objects.get(pk=1)
->>> b = Article.objects.get(pk=1)
->>> a == b
-True
-
-# You can initialize a model instance using positional arguments, which should
-# match the field order as defined in the model.
->>> a2 = Article(None, 'Second article', datetime(2005, 7, 29))
->>> a2.save()
->>> a2.id
-2L
->>> a2.headline
-'Second article'
->>> a2.pub_date
-datetime.datetime(2005, 7, 29, 0, 0)
-
-# ...or, you can use keyword arguments.
->>> a3 = Article(id=None, headline='Third article', pub_date=datetime(2005, 7, 
30))
->>> a3.save()
->>> a3.id
-3L
->>> a3.headline
-'Third article'
->>> a3.pub_date
-datetime.datetime(2005, 7, 30, 0, 0)
-
-# You can also mix and match position and keyword arguments, but be sure not to
-# duplicate field information.
->>> a4 = Article(None, 'Fourth article', pub_date=datetime(2005, 7, 31))
->>> a4.save()
->>> a4.headline
-'Fourth article'
-
-# Don't use invalid keyword arguments.
->>> a5 = Article(id=None, headline='Invalid', pub_date=datetime(2005, 7, 31), 
foo='bar')
-Traceback (most recent call last):
-...
-TypeError: 'foo' is an invalid keyword argument for this function
-
-# You can leave off the value for an AutoField when creating an object, because
-# it'll get filled in automatically when you save().
->>> a5 = Article(headline='Article 6', pub_date=datetime(2005, 7, 31))
->>> a5.save()
->>> a5.id
-5L
->>> a5.headline
-'Article 6'
-
-# If you leave off a field with "default" set, Django will use the default.
->>> a6 = Article(pub_date=datetime(2005, 7, 31))
->>> a6.save()
->>> a6.headline
-u'Defa

[Changeset] r14420 - django/branches/releases/1.2.X/tests/modeltests/m2m_through

2010-11-01 Thread noreply
Author: russellm
Date: 2010-11-01 21:01:18 -0500 (Mon, 01 Nov 2010)
New Revision: 14420

Added:
   django/branches/releases/1.2.X/tests/modeltests/m2m_through/tests.py
Modified:
   django/branches/releases/1.2.X/tests/modeltests/m2m_through/models.py
Log:
[1.2.X] Migrated m2m_through doctests. Thanks to the anonymous contributor.

Backport of r14419 from trunk.

Modified: django/branches/releases/1.2.X/tests/modeltests/m2m_through/models.py
===
--- django/branches/releases/1.2.X/tests/modeltests/m2m_through/models.py   
2010-11-02 02:00:16 UTC (rev 14419)
+++ django/branches/releases/1.2.X/tests/modeltests/m2m_through/models.py   
2010-11-02 02:01:18 UTC (rev 14420)
@@ -63,275 +63,3 @@
 first = models.ForeignKey(PersonSelfRefM2M, related_name="rel_from_set")
 second = models.ForeignKey(PersonSelfRefM2M, related_name="rel_to_set")
 date_friended = models.DateTimeField()
-
-__test__ = {'API_TESTS':"""
->>> from datetime import datetime
-
-### Creation and Saving Tests ###
-
->>> bob = Person.objects.create(name='Bob')
->>> jim = Person.objects.create(name='Jim')
->>> jane = Person.objects.create(name='Jane')
->>> rock = Group.objects.create(name='Rock')
->>> roll = Group.objects.create(name='Roll')
-
-# We start out by making sure that the Group 'rock' has no members.
->>> rock.members.all()
-[]
-
-# To make Jim a member of Group Rock, simply create a Membership object.
->>> m1 = Membership.objects.create(person=jim, group=rock)
-
-# We can do the same for Jane and Rock.
->>> m2 = Membership.objects.create(person=jane, group=rock)
-
-# Let's check to make sure that it worked.  Jane and Jim should be members of 
Rock.
->>> rock.members.all()
-[, ]
-
-# Now we can add a bunch more Membership objects to test with.
->>> m3 = Membership.objects.create(person=bob, group=roll)
->>> m4 = Membership.objects.create(person=jim, group=roll)
->>> m5 = Membership.objects.create(person=jane, group=roll)
-
-# We can get Jim's Group membership as with any ForeignKey.
->>> jim.group_set.all()
-[, ]
-
-# Querying the intermediary model works like normal.
-# In this case we get Jane's membership to Rock.
->>> m = Membership.objects.get(person=jane, group=rock)
->>> m
-
-
-# Now we set some date_joined dates for further testing.
->>> m2.invite_reason = "She was just awesome."
->>> m2.date_joined = datetime(2006, 1, 1)
->>> m2.save()
-
->>> m5.date_joined = datetime(2004, 1, 1)
->>> m5.save()
-
->>> m3.date_joined = datetime(2004, 1, 1)
->>> m3.save()
-
-# It's not only get that works. Filter works like normal as well.
->>> Membership.objects.filter(person=jim)
-[, ]
-
-
-### Forward Descriptors Tests ###
-
-# Due to complications with adding via an intermediary model,
-# the add method is not provided.
->>> rock.members.add(bob)
-Traceback (most recent call last):
-...
-AttributeError: 'ManyRelatedManager' object has no attribute 'add'
-
-# Create is also disabled as it suffers from the same problems as add.
->>> rock.members.create(name='Anne')
-Traceback (most recent call last):
-...
-AttributeError: Cannot use create() on a ManyToManyField which specifies an 
intermediary model. Use m2m_through.Membership's Manager instead.
-
-# Remove has similar complications, and is not provided either.
->>> rock.members.remove(jim)
-Traceback (most recent call last):
-...
-AttributeError: 'ManyRelatedManager' object has no attribute 'remove'
-
-# Here we back up the list of all members of Rock.
->>> backup = list(rock.members.all())
-
-# ...and we verify that it has worked.
->>> backup
-[, ]
-
-# The clear function should still work.
->>> rock.members.clear()
-
-# Now there will be no members of Rock.
->>> rock.members.all()
-[]
-
-# Assignment should not work with models specifying a through model for many of
-# the same reasons as adding.
->>> rock.members = backup
-Traceback (most recent call last):
-...
-AttributeError: Cannot set values on a ManyToManyField which specifies an 
intermediary model.  Use m2m_through.Membership's Manager instead.
-
-# Let's re-save those instances that we've cleared.
->>> m1.save()
->>> m2.save()
-
-# Verifying that those instances were re-saved successfully.
->>> rock.members.all()
-[, ]
-
-
-### Reverse Descriptors Tests ###
-
-# Due to complications with adding via an intermediary model,
-# the add method is not provided.
->>> bob.group_set.add(rock)
-Traceback (most recent call last):
-...
-AttributeError: 'ManyRelatedManager' object has no attribute 'add'
-
-# Create is also disabled as it suffers from the same problems as add.
->>> bob.group_set.create(name='Funk')
-Traceback (most recent call last):
-...
-AttributeError: Cannot use create() on a ManyToManyField which specifies an 
intermediary model. Use m2m_through.Membership's Manager instead.
-
-# Remove has similar complications, and is not provided either.
->>> jim.group_set.remove(rock)
-Traceback (most recent call last):
-...
-AttributeError: 'ManyRelatedMan

[Changeset] r14419 - django/trunk/tests/modeltests/m2m_through

2010-11-01 Thread noreply
Author: russellm
Date: 2010-11-01 21:00:16 -0500 (Mon, 01 Nov 2010)
New Revision: 14419

Added:
   django/trunk/tests/modeltests/m2m_through/tests.py
Modified:
   django/trunk/tests/modeltests/m2m_through/models.py
Log:
Migrated m2m_through doctests. Thanks to the anonymous contributor.

Modified: django/trunk/tests/modeltests/m2m_through/models.py
===
--- django/trunk/tests/modeltests/m2m_through/models.py 2010-11-01 23:46:37 UTC 
(rev 14418)
+++ django/trunk/tests/modeltests/m2m_through/models.py 2010-11-02 02:00:16 UTC 
(rev 14419)
@@ -63,275 +63,3 @@
 first = models.ForeignKey(PersonSelfRefM2M, related_name="rel_from_set")
 second = models.ForeignKey(PersonSelfRefM2M, related_name="rel_to_set")
 date_friended = models.DateTimeField()
-
-__test__ = {'API_TESTS':"""
->>> from datetime import datetime
-
-### Creation and Saving Tests ###
-
->>> bob = Person.objects.create(name='Bob')
->>> jim = Person.objects.create(name='Jim')
->>> jane = Person.objects.create(name='Jane')
->>> rock = Group.objects.create(name='Rock')
->>> roll = Group.objects.create(name='Roll')
-
-# We start out by making sure that the Group 'rock' has no members.
->>> rock.members.all()
-[]
-
-# To make Jim a member of Group Rock, simply create a Membership object.
->>> m1 = Membership.objects.create(person=jim, group=rock)
-
-# We can do the same for Jane and Rock.
->>> m2 = Membership.objects.create(person=jane, group=rock)
-
-# Let's check to make sure that it worked.  Jane and Jim should be members of 
Rock.
->>> rock.members.all()
-[, ]
-
-# Now we can add a bunch more Membership objects to test with.
->>> m3 = Membership.objects.create(person=bob, group=roll)
->>> m4 = Membership.objects.create(person=jim, group=roll)
->>> m5 = Membership.objects.create(person=jane, group=roll)
-
-# We can get Jim's Group membership as with any ForeignKey.
->>> jim.group_set.all()
-[, ]
-
-# Querying the intermediary model works like normal.
-# In this case we get Jane's membership to Rock.
->>> m = Membership.objects.get(person=jane, group=rock)
->>> m
-
-
-# Now we set some date_joined dates for further testing.
->>> m2.invite_reason = "She was just awesome."
->>> m2.date_joined = datetime(2006, 1, 1)
->>> m2.save()
-
->>> m5.date_joined = datetime(2004, 1, 1)
->>> m5.save()
-
->>> m3.date_joined = datetime(2004, 1, 1)
->>> m3.save()
-
-# It's not only get that works. Filter works like normal as well.
->>> Membership.objects.filter(person=jim)
-[, ]
-
-
-### Forward Descriptors Tests ###
-
-# Due to complications with adding via an intermediary model,
-# the add method is not provided.
->>> rock.members.add(bob)
-Traceback (most recent call last):
-...
-AttributeError: 'ManyRelatedManager' object has no attribute 'add'
-
-# Create is also disabled as it suffers from the same problems as add.
->>> rock.members.create(name='Anne')
-Traceback (most recent call last):
-...
-AttributeError: Cannot use create() on a ManyToManyField which specifies an 
intermediary model. Use m2m_through.Membership's Manager instead.
-
-# Remove has similar complications, and is not provided either.
->>> rock.members.remove(jim)
-Traceback (most recent call last):
-...
-AttributeError: 'ManyRelatedManager' object has no attribute 'remove'
-
-# Here we back up the list of all members of Rock.
->>> backup = list(rock.members.all())
-
-# ...and we verify that it has worked.
->>> backup
-[, ]
-
-# The clear function should still work.
->>> rock.members.clear()
-
-# Now there will be no members of Rock.
->>> rock.members.all()
-[]
-
-# Assignment should not work with models specifying a through model for many of
-# the same reasons as adding.
->>> rock.members = backup
-Traceback (most recent call last):
-...
-AttributeError: Cannot set values on a ManyToManyField which specifies an 
intermediary model.  Use m2m_through.Membership's Manager instead.
-
-# Let's re-save those instances that we've cleared.
->>> m1.save()
->>> m2.save()
-
-# Verifying that those instances were re-saved successfully.
->>> rock.members.all()
-[, ]
-
-
-### Reverse Descriptors Tests ###
-
-# Due to complications with adding via an intermediary model,
-# the add method is not provided.
->>> bob.group_set.add(rock)
-Traceback (most recent call last):
-...
-AttributeError: 'ManyRelatedManager' object has no attribute 'add'
-
-# Create is also disabled as it suffers from the same problems as add.
->>> bob.group_set.create(name='Funk')
-Traceback (most recent call last):
-...
-AttributeError: Cannot use create() on a ManyToManyField which specifies an 
intermediary model. Use m2m_through.Membership's Manager instead.
-
-# Remove has similar complications, and is not provided either.
->>> jim.group_set.remove(rock)
-Traceback (most recent call last):
-...
-AttributeError: 'ManyRelatedManager' object has no attribute 'remove'
-
-# Here we back up the list of all of Jim's groups.
->>> backup = list(jim.group_set.all())
->>> back

Re: [Django] #14596: Cache backend initialization refactoring

2010-11-01 Thread Django
#14596: Cache backend initialization refactoring
+---
  Reporter:  dauerbaustelle | Owner:  nobody
Status:  new| Milestone:  1.3   
 Component:  Cache system   |   Version:  SVN   
Resolution: |  Keywords:
 Stage:  Ready for checkin  | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by russellm):

  * needs_better_patch:  => 0
  * stage:  Unreviewed => Ready for checkin
  * 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] #14596: Cache backend initialization refactoring

2010-11-01 Thread Django
#14596: Cache backend initialization refactoring
+---
 Reporter:  dauerbaustelle  |   Owner:  nobody
   Status:  new |   Milestone:  1.3   
Component:  Cache system| Version:  SVN   
 Keywords:  |   Stage:  Unreviewed
Has_patch:  1   |  
+---
 The attached patch refactors the initialization code shared between the
 locmem, filesystem and database cache backends into the `BaseCache` class'
 `__init__` method.

 Furthermore, it extends the tests so that the backends' code is tested
 with `cull_frequency=0`. (Filebased cache excluded, because it seems like
 its culling behaviour is somewhat unpredictable.)

 Plus it puts the hairy pseudo-model stuff in the database cache backend
 into a superclass to make inheritance more obvious for 3rd-party database
 backends.

-- 
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] r14418 - django/trunk/tests/regressiontests/forms/localflavor

2010-11-01 Thread noreply
Author: russellm
Date: 2010-11-01 18:46:37 -0500 (Mon, 01 Nov 2010)
New Revision: 14418

Modified:
   django/trunk/tests/regressiontests/forms/localflavor/id.py
Log:
Added a filter to silence the RuntimeWarning in the Indonesian localflavor 
tests. Thanks to Alex for the report.

Modified: django/trunk/tests/regressiontests/forms/localflavor/id.py
===
--- django/trunk/tests/regressiontests/forms/localflavor/id.py  2010-11-01 
22:18:50 UTC (rev 14417)
+++ django/trunk/tests/regressiontests/forms/localflavor/id.py  2010-11-01 
23:46:37 UTC (rev 14418)
@@ -4,6 +4,8 @@
 tests = r"""
 
 # IDPhoneNumberField 
+>>> import warnings
+>>> warnings.filterwarnings("ignore", category=RuntimeWarning, 
module='django.contrib.localflavor.id.id_choices')
 
 >>> from django.contrib.localflavor.id.forms import IDPhoneNumberField
 >>> f = IDPhoneNumberField(required=False)

-- 
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] #14595: DATABASE DeprecationWarning includes new syntax.

2010-11-01 Thread Django
#14595: DATABASE DeprecationWarning includes new syntax.
--+-
 Reporter:  CarlFK|   Owner:  nobody
   Status:  new   |   Milestone:
Component:  Database layer (models, ORM)  | Version:  1.2   
 Keywords:|   Stage:  Unreviewed
Has_patch:  1 |  
--+-
 There are 2 Deprecation Warnings that can display code ready to cut/paste
 into settings.py:

 Old:
 {{{
 /home/carl/src/veyepar/lib/python2.6/site-
 packages/django/db/__init__.py:60:
 DeprecationWarning: Short names for ENGINE in database configurations are
 deprecated. Prepend default.ENGINE with 'django.db.backends.'
 }}}

 New:
 {{{
 /home/carl/src/veyepar/lib/python2.6/site-
 packages/django/db/__init__.py:62:
 DeprecationWarning: Short names for ENGINE in database configurations are
 deprecated. Prepend default.ENGINE with 'django.db.backends.'
  django.db.backends.sqlite3
 }}}


 New:
 {{{
 /home/carl/src/veyepar/lib/python2.6/site-
 packages/django/db/__init__.py:31:
 DeprecationWarning: settings.DATABASE_* is deprecated; instead use
 DATABASES =  {'default': {'ENGINE': 'sqlite3',
  'HOST': '',
  'NAME': '/home/carl/src/veyepar/dj/veyepar.db',
  'OPTIONS': {},
  'PASSWORD': '',
  'PORT': '',
  'TEST_CHARSET': None,
  'TEST_COLLATION': None,
  'TEST_NAME': None,
  'USER': ''} }
   DeprecationWarning
 }}}

 It would be nice to roll the 2 together, but that would make the code way
 more messy, which isn't worth it.

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

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



Re: [Django] #11185: Document how to customize widgets

2010-11-01 Thread Django
#11185: Document how to customize widgets
+---
  Reporter:  bensmith   | Owner:  nobody
Status:  new| Milestone:  1.3   
 Component:  Documentation  |   Version:  1.0   
Resolution: |  Keywords:  widget
 Stage:  Accepted   | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by poswald):

  * milestone:  => 1.3

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

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



Re: [Django] #13997: multiwidget needs better docs

2010-11-01 Thread Django
#13997: multiwidget needs better docs
+---
  Reporter:  cuci   | Owner:  nobody
Status:  new| Milestone:  1.3   
 Component:  Documentation  |   Version:  1.2   
Resolution: |  Keywords:
 Stage:  Accepted   | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by poswald):

  * milestone:  => 1.3

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

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



[Changeset] r14417 - django/branches/releases/1.2.X/django/contrib/gis/tests

2010-11-01 Thread noreply
Author: jbronn
Date: 2010-11-01 17:18:50 -0500 (Mon, 01 Nov 2010)
New Revision: 14417

Modified:
   django/branches/releases/1.2.X/django/contrib/gis/tests/test_geoip.py
Log:
[1.2.X] Fixed some a stale location and whitespace in GeoIP tests.

Backport of r14416 from trunk.

Modified: django/branches/releases/1.2.X/django/contrib/gis/tests/test_geoip.py
===
--- django/branches/releases/1.2.X/django/contrib/gis/tests/test_geoip.py   
2010-11-01 22:18:22 UTC (rev 14416)
+++ django/branches/releases/1.2.X/django/contrib/gis/tests/test_geoip.py   
2010-11-01 22:18:50 UTC (rev 14417)
@@ -5,10 +5,10 @@
 
 # Note: Requires use of both the GeoIP country and city datasets.
 # The GEOIP_DATA path should be the only setting set (the directory
-# should contain links or the actual database files 'GeoIP.dat' and 
+# should contain links or the actual database files 'GeoIP.dat' and
 # 'GeoLiteCity.dat'.
 class GeoIPTest(unittest.TestCase):
-
+
 def test01_init(self):
 "Testing GeoIP initialization."
 g1 = GeoIP() # Everything inferred from GeoIP path
@@ -19,7 +19,7 @@
 for g in (g1, g2, g3):
 self.assertEqual(True, bool(g._country))
 self.assertEqual(True, bool(g._city))
-
+
 # Only passing in the location of one database.
 city = os.path.join(path, 'GeoLiteCity.dat')
 cntry = os.path.join(path, 'GeoIP.dat')
@@ -52,10 +52,10 @@
 def test03_country(self):
 "Testing GeoIP country querying methods."
 g = GeoIP(city='')
-
+
 fqdn = 'www.google.com'
 addr = '12.215.42.19'
-
+
 for query in (fqdn, addr):
 for func in (g.country_code, g.country_code_by_addr, 
g.country_code_by_name):
 self.assertEqual('US', func(query))
@@ -67,7 +67,7 @@
 def test04_city(self):
 "Testing GeoIP city querying methods."
 g = GeoIP(country='')
-
+
 addr = '130.80.29.3'
 fqdn = 'chron.com'
 for query in (fqdn, addr):
@@ -78,7 +78,7 @@
 self.assertEqual('United States', func(query))
 self.assertEqual({'country_code' : 'US', 'country_name' : 'United 
States'},
  g.country(query))
-
+
 # City information dictionary.
 d = g.city(query)
 self.assertEqual('USA', d['country_code3'])
@@ -87,7 +87,7 @@
 self.assertEqual(713, d['area_code'])
 geom = g.geos(query)
 self.failIf(not isinstance(geom, GEOSGeometry))
-lon, lat = (-95.4152, 29.7755)
+lon, lat = (-95.3670, 29.7523)
 lat_lon = g.lat_lon(query)
 lat_lon = (lat_lon[1], lat_lon[0])
 for tup in (geom.tuple, g.coords(query), g.lon_lat(query), 
lat_lon):

-- 
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] r14416 - django/trunk/django/contrib/gis/tests

2010-11-01 Thread noreply
Author: jbronn
Date: 2010-11-01 17:18:22 -0500 (Mon, 01 Nov 2010)
New Revision: 14416

Modified:
   django/trunk/django/contrib/gis/tests/test_geoip.py
Log:
Fixed some a stale location and whitespace in GeoIP tests.

Modified: django/trunk/django/contrib/gis/tests/test_geoip.py
===
--- django/trunk/django/contrib/gis/tests/test_geoip.py 2010-11-01 22:12:31 UTC 
(rev 14415)
+++ django/trunk/django/contrib/gis/tests/test_geoip.py 2010-11-01 22:18:22 UTC 
(rev 14416)
@@ -5,10 +5,10 @@
 
 # Note: Requires use of both the GeoIP country and city datasets.
 # The GEOIP_DATA path should be the only setting set (the directory
-# should contain links or the actual database files 'GeoIP.dat' and 
+# should contain links or the actual database files 'GeoIP.dat' and
 # 'GeoLiteCity.dat'.
 class GeoIPTest(unittest.TestCase):
-
+
 def test01_init(self):
 "Testing GeoIP initialization."
 g1 = GeoIP() # Everything inferred from GeoIP path
@@ -19,7 +19,7 @@
 for g in (g1, g2, g3):
 self.assertEqual(True, bool(g._country))
 self.assertEqual(True, bool(g._city))
-
+
 # Only passing in the location of one database.
 city = os.path.join(path, 'GeoLiteCity.dat')
 cntry = os.path.join(path, 'GeoIP.dat')
@@ -52,10 +52,10 @@
 def test03_country(self):
 "Testing GeoIP country querying methods."
 g = GeoIP(city='')
-
+
 fqdn = 'www.google.com'
 addr = '12.215.42.19'
-
+
 for query in (fqdn, addr):
 for func in (g.country_code, g.country_code_by_addr, 
g.country_code_by_name):
 self.assertEqual('US', func(query))
@@ -67,7 +67,7 @@
 def test04_city(self):
 "Testing GeoIP city querying methods."
 g = GeoIP(country='')
-
+
 addr = '130.80.29.3'
 fqdn = 'chron.com'
 for query in (fqdn, addr):
@@ -78,7 +78,7 @@
 self.assertEqual('United States', func(query))
 self.assertEqual({'country_code' : 'US', 'country_name' : 'United 
States'},
  g.country(query))
-
+
 # City information dictionary.
 d = g.city(query)
 self.assertEqual('USA', d['country_code3'])
@@ -87,7 +87,7 @@
 self.assertEqual(713, d['area_code'])
 geom = g.geos(query)
 self.failIf(not isinstance(geom, GEOSGeometry))
-lon, lat = (-95.4152, 29.7755)
+lon, lat = (-95.3670, 29.7523)
 lat_lon = g.lat_lon(query)
 lat_lon = (lat_lon[1], lat_lon[0])
 for tup in (geom.tuple, g.coords(query), g.lon_lat(query), 
lat_lon):

-- 
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] #13914: Add natural keys to contrib.auth.User and Group models

2010-11-01 Thread Django
#13914: Add natural keys to contrib.auth.User and Group models
-+--
  Reporter:  jbochi  | Owner:  nobody   
   
Status:  new | Milestone:  1.3  
   
 Component:  Authentication  |   Version:  SVN  
   
Resolution:  |  Keywords:  Contrib, Auth, User, 
Group, natural keys
 Stage:  Accepted| Has_patch:  1
   
Needs_docs:  0   |   Needs_tests:  0
   
Needs_better_patch:  0   |  
-+--
Changes (by jbochi):

  * needs_better_patch:  1 => 0

Comment:

 As per lrekucki suggestion, I have combined the three files into
 139414.diff

-- 
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] #12248: django.template.__init__ code should move to avoid circular imports

2010-11-01 Thread Django
#12248: django.template.__init__ code should move to avoid circular imports
--+-
  Reporter:  tomxtobin| Owner:  nobody
Status:  new  | Milestone:
 Component:  Template system  |   Version:  SVN   
Resolution:   |  Keywords:
 Stage:  Accepted | Has_patch:  1 
Needs_docs:  0|   Needs_tests:  0 
Needs_better_patch:  1|  
--+-
Comment (by tomxtobin):

 I've brought these changes up to date and placed them on !GitHub:

 http://github.com/tomxtobin/django/tree/template-import-refactor-t12248

 I've additionally sent a pull request to !GitHub's django/django:

 http://github.com/django/django/pull/3

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

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



[Changeset] r14413 - django/trunk/django/contrib/auth/management

2010-11-01 Thread noreply
Author: Alex
Date: 2010-11-01 15:54:39 -0500 (Mon, 01 Nov 2010)
New Revision: 14413

Modified:
   django/trunk/django/contrib/auth/management/__init__.py
Log:
Restructure the create_permission signal handler to perform fewer SQL queries, 
this speeds up the test suite dramatically.

Modified: django/trunk/django/contrib/auth/management/__init__.py
===
--- django/trunk/django/contrib/auth/management/__init__.py 2010-11-01 
17:22:13 UTC (rev 14412)
+++ django/trunk/django/contrib/auth/management/__init__.py 2010-11-01 
20:54:39 UTC (rev 14413)
@@ -2,9 +2,10 @@
 Creates permissions for all installed apps that need permissions.
 """
 
+from django.contrib.auth import models as auth_app
 from django.db.models import get_models, signals
-from django.contrib.auth import models as auth_app
 
+
 def _get_permission_codename(action, opts):
 return u'%s_%s' % (action, opts.object_name.lower())
 
@@ -19,20 +20,44 @@
 from django.contrib.contenttypes.models import ContentType
 
 app_models = get_models(app)
+
+# This will hold the permissions we're looking for as
+# (content_type, (codename, name))
+searched_perms = set()
+# The codenames and ctypes that should exist.
+ctypes = set()
+codenames = set()
 for klass in app_models:
 ctype = ContentType.objects.get_for_model(klass)
-for codename, name in _get_all_permissions(klass._meta):
-p, created = auth_app.Permission.objects.get_or_create(
-codename=codename,
-content_type__pk=ctype.id,
-defaults={
-'name': name,
-'content_type': ctype
-}
-)
-if created and verbosity >= 2:
-print "Adding permission '%s'" % p
+ctypes.add(ctype)
+for perm in _get_all_permissions(klass._meta):
+codenames.add(perm[0])
+searched_perms.add((ctype, perm))
 
+# Find all the Permissions that a) have a content_type for a model we're
+# looking for, and b) have a codename we're looking for. It doesn't need to
+# have both, we have a list of exactly what we want, and it's faster to
+# write the query with fewer conditions.
+all_perms = set(auth_app.Permission.objects.filter(
+content_type__in=ctypes,
+codename__in=codenames
+).values_list(
+"content_type", "codename"
+))
+
+for ctype, (codename, name) in searched_perms:
+# If the permissions exists, move on.
+if (ctype.pk, codename) in all_perms:
+continue
+p = auth_app.Permission.objects.create(
+codename=codename,
+name=name,
+content_type=ctype
+)
+if verbosity >= 2:
+print "Adding permission '%s'" % p
+
+
 def create_superuser(app, created_models, verbosity, **kwargs):
 from django.core.management import call_command
 

-- 
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] #13696: Admin Edit Inline templates only output hidden field for PK when inline_admin_form.has_auto_field

2010-11-01 Thread Django
#13696: Admin Edit Inline templates only output hidden field for PK when
inline_admin_form.has_auto_field
+---
  Reporter:  evan.rei...@gmail.com  | Owner:  nobody  
Status:  reopened   | Milestone:  
 Component:  django.contrib.admin   |   Version:  1.2 
Resolution: |  Keywords:  inline templates
 Stage:  Unreviewed | Has_patch:  0   
Needs_docs:  0  |   Needs_tests:  0   
Needs_better_patch:  0  |  
+---
Comment (by wolever):

 As a warning: the “obvious” work around for this is to have custom ID
 fields “pretend” to be auto fields by doing something like this:

 {{{
 def contribute_to_class(...): # XXX BAD XXX
 cls._meta.has_auto_field = True
 ls._meta.auto_field = self
 }}}

 However, this doesn't quite work either, because line 525 of
 `/Users/wolever/Verso/Repos/web/env/massuni-web/lib/python2.6/site-
 packages/django/db/models/base.py` in `save_base`(`update_pk =
 bool(meta.has_auto_field and not pk_set)`), sets the `update_pk` flag,
 which essentially causes:

 {{{
 if update_pk:
 instance.id = get_last_inserted_id()
 }}}

 And, at least with the SQLite backend, the result of
 `get_last_inserted_id` is the row number (or similar), *not* the value of
 the `id` field.

 So, in short, this issue can't be hacked around by setting
 `has_auto_field`.

-- 
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] #14140: There is no way to override admin templates to the project level

2010-11-01 Thread Django
#14140: There is no way to override admin templates to the project level
--+-
  Reporter:  jacmkno  | Owner:  nobody 
Status:  new  | Milestone:  1.3
 Component:  Template system  |   Version:  SVN
Resolution:   |  Keywords:  extends admin templates
 Stage:  Unreviewed   | Has_patch:  0  
Needs_docs:  0|   Needs_tests:  0  
Needs_better_patch:  0|  
--+-
Changes (by rico):

 * cc: rico...@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] #14140: There is no way to override admin templates to the project level

2010-11-01 Thread Django
#14140: There is no way to override admin templates to the project level
--+-
  Reporter:  jacmkno  | Owner:  nobody 
Status:  new  | Milestone:  1.3
 Component:  Template system  |   Version:  SVN
Resolution:   |  Keywords:  extends admin templates
 Stage:  Unreviewed   | Has_patch:  0  
Needs_docs:  0|   Needs_tests:  0  
Needs_better_patch:  0|  
--+-
Comment (by rico):

 I think every admin template should extend a "base" template.
 This way it would be possible to override templates on the project level
 (and maybe through external apps also).

 As an example, my solution for customizing the admin index:

   * Move the original '''admin/index.html''' template to
 '''django/contrib/admin/templates/admin/base'''
   * Create the '''admin/index.html''' template that extends
 '''admin/base/index.html'''
 {{{
 {# admin/index.html #}
 {% extends "admin/base/index.html" %}

 {# ... customizations here ... #}
 }}}

   * On the project level, '''admin/index.html''' would extend
 '''admin/base/index.html''' and override the one bundled with the admin
 app

 I can take this ticket if this solution is reasonable.

-- 
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] #13914: Add natural keys to contrib.auth.User and Group models

2010-11-01 Thread Django
#13914: Add natural keys to contrib.auth.User and Group models
-+--
  Reporter:  jbochi  | Owner:  nobody   
   
Status:  new | Milestone:  1.3  
   
 Component:  Authentication  |   Version:  SVN  
   
Resolution:  |  Keywords:  Contrib, Auth, User, 
Group, natural keys
 Stage:  Accepted| Has_patch:  1
   
Needs_docs:  0   |   Needs_tests:  0
   
Needs_better_patch:  1   |  
-+--
Changes (by lrekucki):

  * needs_better_patch:  0 => 1

Comment:

 Would be good, if you can join all three patches into one. It's easier to
 review that way.

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-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] #13914: Add natural keys to contrib.auth.User and Group models

2010-11-01 Thread Django
#13914: Add natural keys to contrib.auth.User and Group models
-+--
  Reporter:  jbochi  | Owner:  nobody   
   
Status:  new | Milestone:  1.3  
   
 Component:  Authentication  |   Version:  SVN  
   
Resolution:  |  Keywords:  Contrib, Auth, User, 
Group, natural keys
 Stage:  Accepted| Has_patch:  1
   
Needs_docs:  0   |   Needs_tests:  0
   
Needs_better_patch:  0   |  
-+--
Changes (by jbochi):

 * cc: jbo...@gmail.com (added)
  * needs_docs:  1 => 0
  * needs_tests:  1 => 0

Comment:

 I have added two small patches for tests and documentation. I am willing
 to improve/modify them if needed.

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-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] #14587: Model description on administrative interface

2010-11-01 Thread Django
#14587: Model description on administrative interface
-+--
  Reporter:  RuslanPopov | Owner:  nobody   
 
Status:  new | Milestone:   
 
 Component:  django.contrib.admin|   Version:  1.2  
 
Resolution:  |  Keywords:  admin.py 
models.py
 Stage:  Design decision needed  | Has_patch:  0
 
Needs_docs:  0   |   Needs_tests:  0
 
Needs_better_patch:  0   |  
-+--
Changes (by Adam Mckerlie ):

  * needs_better_patch:  => 0
  * stage:  Unreviewed => Design decision needed
  * 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.



Re: [Django] #14584: PASSWORD_RESET_TIMEOUT_DAYS is not documented

2010-11-01 Thread Django
#14584: PASSWORD_RESET_TIMEOUT_DAYS is not documented
+---
  Reporter:  hop| Owner:  anonymous
Status:  assigned   | Milestone:   
 Component:  Documentation  |   Version:  SVN  
Resolution: |  Keywords:   
 Stage:  Accepted   | Has_patch:  1
Needs_docs:  0  |   Needs_tests:  0
Needs_better_patch:  0  |  
+---
Changes (by Adam Mckerlie ):

  * owner:  nobody => anonymous
  * status:  new => assigned
  * has_patch:  0 => 1

Comment:

 Just attached a diff of the settings...

-- 
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] #13588: removing admin.root as per deprecation policy

2010-11-01 Thread Django
#13588: removing admin.root as per deprecation policy
---+
  Reporter:  apollo13  | Owner:  nobody
Status:  new   | Milestone:  1.3   
 Component:  django.contrib.admin  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by ramiro):

 Removal of Python code was done in r14138 and 14412.

-- 
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] r14412 - django/trunk/django/contrib/admin

2010-11-01 Thread noreply
Author: carljm
Date: 2010-11-01 12:22:13 -0500 (Mon, 01 Nov 2010)
New Revision: 14412

Modified:
   django/trunk/django/contrib/admin/actions.py
   django/trunk/django/contrib/admin/util.py
Log:
Removed dead compatibility code for removed AdminSite.root() method for 
mounting admin urls.

Modified: django/trunk/django/contrib/admin/actions.py
===
--- django/trunk/django/contrib/admin/actions.py2010-11-01 00:52:58 UTC 
(rev 14411)
+++ django/trunk/django/contrib/admin/actions.py2010-11-01 17:22:13 UTC 
(rev 14412)
@@ -29,7 +29,7 @@
 
 # Populate deletable_objects, a data structure of all related objects that
 # will also be deleted.
-deletable_objects, perms_needed = get_deleted_objects(queryset, opts, 
request.user, modeladmin.admin_site, levels_to_root=2)
+deletable_objects, perms_needed = get_deleted_objects(queryset, opts, 
request.user, modeladmin.admin_site)
 
 # The user has already confirmed the deletion.
 # Do the deletion and return a None to display the change list view again.

Modified: django/trunk/django/contrib/admin/util.py
===
--- django/trunk/django/contrib/admin/util.py   2010-11-01 00:52:58 UTC (rev 
14411)
+++ django/trunk/django/contrib/admin/util.py   2010-11-01 17:22:13 UTC (rev 
14412)
@@ -58,21 +58,15 @@
 field_names.append(field)
 return field_names
 
-def _format_callback(obj, user, admin_site, levels_to_root, perms_needed):
+def _format_callback(obj, user, admin_site, perms_needed):
 has_admin = obj.__class__ in admin_site._registry
 opts = obj._meta
-try:
+if has_admin:
 admin_url = reverse('%s:%s_%s_change'
 % (admin_site.name,
opts.app_label,
opts.object_name.lower()),
 None, (quote(obj._get_pk_val()),))
-except NoReverseMatch:
-admin_url = '%s%s/%s/%s/' % ('../'*levels_to_root,
- opts.app_label,
- opts.object_name.lower(),
- quote(obj._get_pk_val()))
-if has_admin:
 p = '%s.%s' % (opts.app_label,
opts.get_delete_permission())
 if not user.has_perm(p):
@@ -88,7 +82,7 @@
 return u'%s: %s' % (capfirst(opts.verbose_name),
 force_unicode(obj))
 
-def get_deleted_objects(objs, opts, user, admin_site, levels_to_root=4):
+def get_deleted_objects(objs, opts, user, admin_site):
 """
 Find all objects related to ``objs`` that should also be
 deleted. ``objs`` should be an iterable of objects.
@@ -96,13 +90,6 @@
 Returns a nested list of strings suitable for display in the
 template with the ``unordered_list`` filter.
 
-`levels_to_root` defines the number of directories (../) to reach
-the admin root path. In a change_view this is 4, in a change_list
-view 2.
-
-This is for backwards compatibility since the options.delete_selected
-method uses this function also from a change_list view.
-This will not be used if we can reverse the URL.
 """
 collector = NestedObjects()
 for obj in objs:
@@ -114,7 +101,6 @@
 to_delete = collector.nested(_format_callback,
  user=user,
  admin_site=admin_site,
- levels_to_root=levels_to_root,
  perms_needed=perms_needed)
 
 return to_delete, perms_needed

-- 
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] #3148: Add getters and setters to model fields

2010-11-01 Thread Django
#3148: Add getters and setters to model fields
---+
  Reporter:  j...@jerf.org | Owner:  Alex
Status:  assigned  | Milestone:  
 Component:  Database layer (models, ORM)  |   Version:  SVN 
Resolution:|  Keywords:  
 Stage:  Accepted  | Has_patch:  1   
Needs_docs:  1 |   Needs_tests:  0   
Needs_better_patch:  1 |  
---+
Changes (by chrischambers):

 * cc: chrischambers (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] #3055: GenericRelation should squawk if pointed to a model that doesn't have a GenericForeignKey on it

2010-11-01 Thread Django
#3055: GenericRelation should squawk if pointed to a model that doesn't have a
GenericForeignKey on it
---+
  Reporter:  pa...@elasticworld.org| Owner:  nobody
Status:  new   | Milestone:
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by carljm):

  * summary:  Deleting an object with two generic relations to different
  but related models (via a ForeignKey)
  apparently generates incorrect SQL =>
  GenericRelation should squawk if pointed to a
  model that doesn't have a GenericForeignKey on
  it

Comment:

 Jason's comment is correct. The SQL is wrong because the models are wrong.
 It's not legit to point a GenericRelation at a model which doesn't have a
 GenericForeignKey.

 However, the result should not be bad SQL when you try to delete;
 GenericRelations should fail fast if they are invalid. Updating the
 summary accordingly.

-- 
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] #14370: Adding support for Autocomplete in contrib.admin

2010-11-01 Thread Django
#14370: Adding support for Autocomplete in contrib.admin
---+
  Reporter:  tyrion| Owner:  nobody  
Status:  new   | Milestone:  
 Component:  django.contrib.admin  |   Version:  1.2 
Resolution:|  Keywords:  autocomplete
 Stage:  Unreviewed| Has_patch:  1   
Needs_docs:  0 |   Needs_tests:  0   
Needs_better_patch:  0 |  
---+
Changes (by anonymous):

 * cc: tyrion (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] #10728: [PATCH] SubfieldBase classes can't be subclassed.

2010-11-01 Thread Django
#10728: [PATCH] SubfieldBase classes can't be subclassed.
---+
  Reporter:  G2P   | Owner:  nobody
Status:  new   | Milestone:  1.3   
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Ready for checkin | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by gsakkis):

 * cc: george.sak...@gmail.com (removed)
 * cc: gsakkis (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] #14581: __isnull=False not working for one to one relationships

2010-11-01 Thread Django
#14581: __isnull=False not working for one to one relationships
---+
  Reporter:  sircco| Owner:  nobody  
Status:  new   | Milestone:  
 Component:  Database layer (models, ORM)  |   Version:  SVN 
Resolution:|  Keywords:  pscyopg2
 Stage:  Unreviewed| Has_patch:  0   
Needs_docs:  0 |   Needs_tests:  0   
Needs_better_patch:  0 |  
---+
Comment (by gsakkis):

 Please post a fully reproducible example. If you can't spend a few minutes
 to do it right and instead post a one liner with a typo in it (fillter
 instead of filter) and undefined "A" and "B", why would anyone spend much
 more time to reproduce it and come up with a fix for it ?

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

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



Re: [Django] #13772: 'exists' parameter for pre_save signal

2010-11-01 Thread Django
#13772: 'exists' parameter for pre_save signal
---+
  Reporter:  gsakkis   | Owner:  nobody
Status:  closed| Milestone:
 Component:  Database layer (models, ORM)  |   Version:  1.2   
Resolution:  wontfix   |  Keywords:
 Stage:  Design decision needed| Has_patch:  1 
Needs_docs:  1 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by gsakkis):

  * status:  reopened => closed
  * resolution:  => wontfix
  * milestone:  1.3 =>

Comment:

 Withdrawn after two negative and zero positive votes at
 http://groups.google.com/group/django-
 developers/browse_frm/thread/0c0dec77aea5d83a.

-- 
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] #14533: django signals not thread-safe

2010-11-01 Thread Django
#14533: django signals not thread-safe
-+--
  Reporter:  milosu  | Owner:  nobody
Status:  new | Milestone:  1.3   
 Component:  Core framework  |   Version:  1.2   
Resolution:  |  Keywords:
 Stage:  Unreviewed  | Has_patch:  1 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Changes (by codemonkey):

  * milestone:  => 1.3

Comment:

 This bug affects me too. Patch is working for 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.



Re: [Django] #14594: Django/CherryPy problem with POST data

2010-11-01 Thread Django
#14594: Django/CherryPy problem with POST data
+---
  Reporter:  msundstr   | Owner:  nobody
Status:  new| Milestone:  1.3   
 Component:  HTTP handling  |   Version:  SVN   
Resolution: |  Keywords:
 Stage:  Unreviewed | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by msundstr):

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

Comment:

 Steps to reproduce Ticket #14594

 I used a virtualenv running Python 2.7, but I don't think the Python
 version matters

 # Install or make sure you are using Django trunk >= 14394
 pip install CherryPy # 3.1.2
 django-admin.py startproject newbug
 cd newbug
 python manage.py runserver # verify on port 8000 that "It works!"
 # Edit urls.py to enable the admin
 # Edit settings.py to enable the admin
 # Edit settings.py to create a database.
 # I used sqlite3 and specified a path
 python manage.py syncdb # setup the database and create a superuser
 # Verify that you can login, using the development server and your new
 superuser at
 # localhost:8000/admin/
 # Log out, stop the development server
 python manage.py shell
 >>>import cherrypy
 >>>from django.core.handlers.wsgi import WSGIHandler
 >>>cherrypy.tree.graft( WSGIHandler(), script_name="")
 >>>cherrypy.quickstart() # this will start the CherryPy server on 8080
 # The admin media will not be served, but this doesn't matter
 # Go to localhost:8080/admin/
 # Try to login with your superuser, or just click the login button with
 blank input
 # Hangs

-- 
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] #14594: Django/CherryPy problem with POST data

2010-11-01 Thread Django
#14594: Django/CherryPy problem with POST data
---+
 Reporter:  msundstr   |   Owner:  nobody
   Status:  new|   Milestone:  1.3   
Component:  HTTP handling  | Version:  SVN   
 Keywords: |   Stage:  Unreviewed
Has_patch:  0  |  
---+
 Changeset [14394] causes a hang when reading POST data running Django
 trunk behind CherryPy 3.1.2 and Python 2.7.

 See this thread on Django Developers:
 

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