Re: [Django] #2284: [patch] Extra /sql files with whitespace break syncdb

2008-10-10 Thread Django
#2284: [patch] Extra /sql files with whitespace break syncdb
--+-
  Reporter:  scottanderson| Owner:  nobody
Status:  new  | Milestone:
 Component:  django-admin.py  |   Version:  SVN   
Resolution:   |  Keywords:  syncdb
 Stage:  Accepted | Has_patch:  1 
Needs_docs:  0|   Needs_tests:  1 
Needs_better_patch:  0|  
--+-
Changes (by russellm):

  * needs_better_patch:  1 => 0
  * component:  django.contrib.databrowse => django-admin.py
  * version:  1.0-alpha => SVN
  * milestone:  post-1.0 =>
  * owner:  anonymoushgjdhj  vf => nobody
  * needs_docs:  1 => 0

Comment:

 Reverting some unhelpful status changes

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



Re: [Django] #9334: The docs don't explain how django names cache keys

2008-10-10 Thread Django
#9334: The docs don't explain how django names cache keys
--+-
  Reporter:  [EMAIL PROTECTED]  | Owner:  nobody
Status:  new  | Milestone:
 Component:  Documentation|   Version:  1.0   
Resolution:   |  Keywords:
 Stage:  Unreviewed   | Has_patch:  0 
Needs_docs:  0|   Needs_tests:  0 
Needs_better_patch:  0|  
--+-
Changes (by simonredfern):

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

Comment:

 After adding some print statements to the django cache files we found the
 answer to our question.

 If you have a template with the following:

 {% cache 3600 control_panel CACHE_KEY_PREFIX mem_id cache_modifier %}

 ...

 {% endcache %}


 Then the key that django generates will be like:

 key = 'control_panel:%s:%s:%s' % (CACHE_KEY_PREFIX, mem_id,
 cache_modifier)

 e.g.

 control_panel:sitename-LIVE:1:x

 cheers,

 Simon.

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



Re: [Django] #6845: Model validation and its propagation to ModelForms

2008-10-10 Thread Django
#6845: Model validation and its propagation to ModelForms
-+--
  Reporter:  Honza_Kral  | Owner:  nobody   
 
Status:  new | Milestone:  post-1.0 
 
 Component:  Forms   |   Version:  SVN  
 
Resolution:  |  Keywords:  newforms validation model 
modelform ep2008
 Stage:  Accepted| Has_patch:  1
 
Needs_docs:  1   |   Needs_tests:  1
 
Needs_better_patch:  1   |  
-+--
Comment (by Honza_Kral):

 Another version of the patch.

 Implemented:

  * moved ValidationError to django.core.exceptions, leaving ErrorList in
 django.forms
  * field.validate and field.clean on db fields
  * model.clean and model.validate on models
  * moved validate_unique to models
  * have formsets call form.save instead of save_instance (split
 save_instance into two functions for that purpose)

 Not yet implemented:
  * validators and their use in both db and form fields
  * custom error messages (being able to override the messages from models
 in forms etc.)

 Broken:
  * save_as_new on formsets - the model without the FK doesn't validate
 well, I don't know what to do with this one - on one hand it shouldn't
 validate (the model IS invalid), on the otherhand it's useful feature.
 Maybe when I get around to enable turning model validation off for a form
 instance, that might help a bit. Or some sort of delayed validation.
 suggestions welcome.

 Changed and untested:
  * BaseGenericInlineFormSet

 stay tuned for more.

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



[Changeset] r9228 - in django/branches/releases/1.0.X: django/db/backends/oracle tests/regressiontests/queries

2008-10-10 Thread noreply

Author: mtredinnick
Date: 2008-10-10 19:26:11 -0500 (Fri, 10 Oct 2008)
New Revision: 9228

Modified:
   django/branches/releases/1.0.X/django/db/backends/oracle/query.py
   django/branches/releases/1.0.X/tests/regressiontests/queries/models.py
Log:
[1.0.X] Fixed .distinct() not working with slicing in Oracle, due to the
row numbers necessarily being distinct.

Backport of r9221 from trunk (since Ian doesn't have commit privileges at the
moment).


Modified: django/branches/releases/1.0.X/django/db/backends/oracle/query.py
===
--- django/branches/releases/1.0.X/django/db/backends/oracle/query.py   
2008-10-10 22:14:24 UTC (rev 9227)
+++ django/branches/releases/1.0.X/django/db/backends/oracle/query.py   
2008-10-11 00:26:11 UTC (rev 9228)
@@ -26,8 +26,16 @@
 
 class OracleQuery(QueryClass):
 def resolve_columns(self, row, fields=()):
-index_start = len(self.extra_select.keys())
-values = [self.convert_values(v, None) for v in row[:index_start]]
+# If this query has limit/offset information, then we expect the
+# first column to be an extra "_RN" column that we need to throw
+# away.
+if self.high_mark is not None or self.low_mark:
+rn_offset = 1
+else:
+rn_offset = 0
+index_start = rn_offset + len(self.extra_select.keys())
+values = [self.convert_values(v, None)
+  for v in row[rn_offset:index_start]]
 for value, field in map(None, row[index_start:], fields):
 values.append(self.convert_values(value, field))
 return values
@@ -97,49 +105,17 @@
 sql, params = super(OracleQuery, 
self).as_sql(with_limits=False,
 with_col_aliases=with_col_aliases)
 else:
-# `get_columns` needs to be called before `get_ordering` to
-# populate `_select_alias`.
-self.pre_sql_setup()
-self.get_columns()
-ordering = self.get_ordering()
-
-# Oracle's ROW_NUMBER() function requires an ORDER BY clause.
-if ordering:
-rn_orderby = ', '.join(ordering)
-else:
-# Create a default ORDER BY since none was specified.
-qn = self.quote_name_unless_alias
-opts = self.model._meta
-rn_orderby = '%s.%s' % (qn(opts.db_table),
-qn(opts.fields[0].db_column or opts.fields[0].column))
-
-# Ensure the base query SELECTs our special "_RN" column
-self.extra_select['_RN'] = ('ROW_NUMBER() OVER (ORDER BY %s)'
-% rn_orderby, '')
 sql, params = super(OracleQuery, 
self).as_sql(with_limits=False,
 with_col_aliases=True)
 
 # Wrap the base query in an outer SELECT * with boundaries on
 # the "_RN" column.  This is the canonical way to emulate LIMIT
 # and OFFSET on Oracle.
-sql = 'SELECT * FROM (%s) WHERE "_RN" > %d' % (sql, 
self.low_mark)
+sql = 'SELECT * FROM (SELECT ROW_NUMBER() OVER (ORDER BY 1) AS 
"_RN", "_SUB".* FROM (%s) "_SUB") WHERE "_RN" > %d' % (sql, self.low_mark)
 if self.high_mark is not None:
 sql = '%s AND "_RN" <= %d' % (sql, self.high_mark)
 
 return sql, params
 
-def set_limits(self, low=None, high=None):
-super(OracleQuery, self).set_limits(low, high)
-# We need to select the row number for the LIMIT/OFFSET sql.
-# A placeholder is added to extra_select now, because as_sql is
-# too late to be modifying extra_select.  However, the actual sql
-# depends on the ordering, so that is generated in as_sql.
-self.extra_select['_RN'] = ('1', '')
-
-def clear_limits(self):
-super(OracleQuery, self).clear_limits()
-if '_RN' in self.extra_select:
-del self.extra_select['_RN']
-
 _classes[QueryClass] = OracleQuery
 return OracleQuery

Modified: django/branches/releases/1.0.X/tests/regressiontests/queries/models.py
===
--- django/branches/releases/1.0.X/tests/regressiontests/queries/models.py  
2008-10-10 22:14:24 UTC (rev 9227)
+++ django/branches/releases/1.0.X/tests/regressiontests/queries/models.py  
2008-10-11 00:26:11 UTC (rev 9228)
@@ -334,6 +334,12 @@
 >>> Item.objects.filter(tags__in=[t1, t2]).filter(tags=t3)
 []
 
+Make sure .distinct() works with slicing (this was broken in Oracle).
+>>> Item.objects.filter(tags__in=[t1, t2]).order_by('name')[:3]
+[, , ]
+>>> Item.objects.filter(tags__in=[t1, 

Re: [Django] #8916: admin auth change password not working

2008-10-10 Thread Django
#8916: admin auth change password not working
---+
  Reporter:  [EMAIL PROTECTED]| Owner:  nobody
Status:  reopened  | Milestone:
 Component:  django.contrib.admin  |   Version:  1.0   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by kmtracey):

 I assume you're supposed to add:

 `from django.contrib.auth.admin import UserAdmin`

 and change:

 `class UserOptions(admin.ModelAdmin):`

 to

 `class UserOptions(UserAdmin):`

 That way your customized User admin doesn't lose the code already in
 !UserAdmin, you just override or add what you want.

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



Re: [Django] #8916: admin auth change password not working

2008-10-10 Thread Django
#8916: admin auth change password not working
---+
  Reporter:  [EMAIL PROTECTED]| Owner:  nobody
Status:  reopened  | Milestone:
 Component:  django.contrib.admin  |   Version:  1.0   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by benshapiro):

 Aha! I think we're on to something here. I had the following:
 {{{
 from spackle.spackle1.models import *
 from django.contrib import admin

 admin.site.register(School)
 admin.site.register(Cohort)
 admin.site.register(PersonAggregation)
 admin.site.register(Course)

 class PersonInline(admin.StackedInline):
 model=Person
 max_num=1
 extra=1

 class UserOptions(admin.ModelAdmin):
 inlines = [PersonInline,]

 admin.site.unregister(User)
 admin.site.register(User, UserOptions)

 admin.site.register(Person)

 }}}

 It works fine, now that I've taken out the UserOptions stuff.

 So, what's the trick in newforms admin to doing what I'm trying to do
 here? Is there a recommended way to do this?

 Ben

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



Re: [Django] #9342: query optimization issue

2008-10-10 Thread Django
#9342: query optimization issue
--+-
  Reporter:  [EMAIL PROTECTED]  | Owner:  nobody
Status:  new  | Milestone:
 Component:  Uncategorized|   Version:  1.0   
Resolution:   |  Keywords:
 Stage:  Unreviewed   | Has_patch:  0 
Needs_docs:  0|   Needs_tests:  0 
Needs_better_patch:  0|  
--+-
Changes (by anonymous):

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

Comment:

 After looking at this more, I think the fault possibly lays in
 Query::get_from_clause (...\django\db\models\sql\query.py).

 The code iterates over an array of joins for known alias fields; checking
 whether its internal counter indicates that the alias is referenced or
 not. If the number of references is zero, it just skips that join. The
 problem is that that alias is possibly referenced in another join; but
 that is not being checked.

 I added a check and if such a case exists, the internal reference counter
 is increased for such an alias. I'm not sure if this is the  correct patch
 but it is a start:
 {{{
 def get_from_clause(self):
 """
 Returns a list of strings that are joined together to go after the
 "FROM" part of the query, as well as a list any extra parameters
 that
 need to be included. Sub-classes, can override this to create a
 from-clause via a "select", for example (e.g. CountQuery).

 This should only be called after any SQL construction methods that
 might change the tables we need. This means the select columns and
 ordering must be done first.
 """
 result = []
 qn = self.quote_name_unless_alias
 qn2 = self.connection.ops.quote_name
 first = True
 for alias in self.tables:
 if not self.alias_refcount[alias]:
 #START HACK: No sure if it is a problem with
 self.alias_refcount somewhere else or this code.
 #  Need to iterate over self.alias_map to ensure that
 another alias map does not
 #  reference this alias.
 for alias_check in self.tables:
 if alias != alias_check:
 try:
 name, rhs, join_type, lhs, lhs_col, col,
 nullable = self.alias_map[alias_check]
 except KeyError:
 continue
 if alias in [rhs,lhs]:
 self.ref_alias(alias)
 #END HACK

 if not self.alias_refcount[alias]:
 continue
 try:
 name, alias, join_type, lhs, lhs_col, col, nullable =
 self.alias_map[alias]
 except KeyError:
 # Extra tables can end up in self.tables, but not in the
 # alias_map if they aren't in a join. That's OK. We skip
 them.
 continue
 alias_str = (alias != name and ' %s' % alias or '')
 if join_type and not first:
 result.append('%s %s%s ON (%s.%s = %s.%s)'
 % (join_type, qn(name), alias_str, qn(lhs),
qn2(lhs_col), qn(alias), qn2(col)))
 else:
 connector = not first and ', ' or ''
 result.append('%s%s%s' % (connector, qn(name), alias_str))
 first = False
 for t in self.extra_tables:
 alias, unused = self.table_alias(t)
 # Only add the alias if it's not already present (the
 table_alias()
 # calls increments the refcount, so an alias refcount of one
 means
 # this is the only reference.
 if alias not in self.alias_map or self.alias_refcount[alias]
 == 1:
 connector = not first and ', ' or ''
 result.append('%s%s' % (connector, qn(alias)))
 first = False
 return result, []

 }}}

 One thing to note about this initial patch attempt; the SQL is *correct*
 but joins the missing table twice, once in the where clause and once in
 the sub-select. Here is what the SQL would look like:
 {{{
 SELECT "tableB"."key_id"
 FROM "tableB" INNER JOIN "tableA" ON ("tableB"."key_id" =
 "tableA"."key_id")
  WHERE NOT ("tableB"."key_id" IN (SELECT U2."key_id" FROM "tableB" U0
   INNER JOIN
 "tableA" U1 ON (U1."key_id" = U0."key_id")
   INNER JOIN
 "tableC" U2 ON (U1."key_id" = U2."key_id") WHERE UPPER(U2."data"::text) =
 UPPER('test') ))

 }}}

-- 
Ticket URL: 

Re: [Django] #8916: admin auth change password not working

2008-10-10 Thread Django
#8916: admin auth change password not working
---+
  Reporter:  [EMAIL PROTECTED]| Owner:  nobody
Status:  reopened  | Milestone:
 Component:  django.contrib.admin  |   Version:  1.0   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by kmtracey):

 For future reference please enclose traceback in triple braces (`{{{
 }}}`) so they format properly.

 Pity the original poster did not explain what was they did to cause this
 error, because you seem to have done the same thing.  Have you done
 something to customize the Admin handling for the User object?  Because
 the traceback shows you are calling into the !ModelAdmin `__call__`
 function in django/contrib/admin/options.py instead of the one for
 !UserAdmin in django/contrib/auth/admin.py.

 Really, this is not a bug in Django, this works out of the box.  You've
 done something with your config to cause this though I'm not sure exactly
 what.  It's really more properly pursued on django-users but it'd be nice
 to get a resolution noted in this ticket as to how users can cause this.
 So, please share more details of your config, particularly any
 admin.site.register calls you have.

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



[Changeset] r9227 - in django/branches/releases/1.0.X: . tests/modeltests/model_forms tests/regressiontests/file_storage

2008-10-10 Thread noreply

Author: jacob
Date: 2008-10-10 17:14:24 -0500 (Fri, 10 Oct 2008)
New Revision: 9227

Modified:
   django/branches/releases/1.0.X/
   django/branches/releases/1.0.X/tests/modeltests/model_forms/models.py
   django/branches/releases/1.0.X/tests/regressiontests/file_storage/models.py
   django/branches/releases/1.0.X/tests/regressiontests/file_storage/tests.py
Log:
[1.0.X] Yet more file storage testing cleanup for the sake of buildbots; this 
should be the last of it, I hope.
  
Backport of r9226 from trunk.




Property changes on: django/branches/releases/1.0.X
___
Name: svnmerge-integrated
   - 
/django/trunk:1-9097,9099-9102,9104-9109,9111,9113-9144,9146-9151,9153-9156,9158-9159,9161-9187,9189-9211,9222,9224
   + 
/django/trunk:1-9097,9099-9102,9104-9109,9111,9113-9144,9146-9151,9153-9156,9158-9159,9161-9187,9189-9211,9222,9224,9226

Modified: django/branches/releases/1.0.X/tests/modeltests/model_forms/models.py
===
--- django/branches/releases/1.0.X/tests/modeltests/model_forms/models.py   
2008-10-10 22:13:16 UTC (rev 9226)
+++ django/branches/releases/1.0.X/tests/modeltests/model_forms/models.py   
2008-10-10 22:14:24 UTC (rev 9227)
@@ -19,7 +19,8 @@
 except NameError:
 from django.utils.itercompat import sorted
 
-temp_storage = FileSystemStorage(tempfile.gettempdir())
+temp_storage_dir = tempfile.mkdtemp()
+temp_storage = FileSystemStorage(temp_storage_dir)
 
 ARTICLE_STATUS = (
 (1, 'Draft'),
@@ -1251,4 +1252,8 @@
 >>> core = form.save()
 >>> core.parent
 
+
+# Clean up
+>>> import shutil
+>>> shutil.rmtree(temp_storage_dir)
 """}

Modified: 
django/branches/releases/1.0.X/tests/regressiontests/file_storage/models.py
===
--- django/branches/releases/1.0.X/tests/regressiontests/file_storage/models.py 
2008-10-10 22:13:16 UTC (rev 9226)
+++ django/branches/releases/1.0.X/tests/regressiontests/file_storage/models.py 
2008-10-10 22:14:24 UTC (rev 9227)
@@ -1,10 +1,12 @@
 import os
 import tempfile
+import shutil
 from django.db import models
 from django.core.files.storage import FileSystemStorage
 from django.core.files.base import ContentFile
 
-temp_storage = FileSystemStorage(tempfile.gettempdir())
+temp_storage_dir = tempfile.mkdtemp()
+temp_storage = FileSystemStorage(temp_storage_dir)
 
 # Test for correct behavior of width_field/height_field.
 # Of course, we can't run this without PIL.
@@ -64,5 +66,7 @@
 >>> _ = p3.mugshot.size
 >>> hasattr(p3.mugshot, '_file')
 False
+
+>>> shutil.rmtree(temp_storage_dir)
 """}
 
\ No newline at end of file

Modified: 
django/branches/releases/1.0.X/tests/regressiontests/file_storage/tests.py
===
--- django/branches/releases/1.0.X/tests/regressiontests/file_storage/tests.py  
2008-10-10 22:13:16 UTC (rev 9226)
+++ django/branches/releases/1.0.X/tests/regressiontests/file_storage/tests.py  
2008-10-10 22:14:24 UTC (rev 9227)
@@ -88,10 +88,12 @@
 # without threading.
 import os
 import time
+import shutil
+import tempfile
 from unittest import TestCase
 from django.conf import settings
 from django.core.files.base import ContentFile
-from models import temp_storage
+from django.core.files.storage import FileSystemStorage
 try:
 import threading
 except ImportError:
@@ -104,29 +106,38 @@
 
 class FileSaveRaceConditionTest(TestCase):
 def setUp(self):
+self.storage_dir = tempfile.mkdtemp()
+self.storage = FileSystemStorage(self.storage_dir)
 self.thread = threading.Thread(target=self.save_file, 
args=['conflict'])
 
+def tearDown(self):
+shutil.rmtree(self.storage_dir)
+
 def save_file(self, name):
-name = temp_storage.save(name, SlowFile("Data"))
+name = self.storage.save(name, SlowFile("Data"))
 
 def test_race_condition(self):
 self.thread.start()
 name = self.save_file('conflict')
 self.thread.join()
-self.assert_(temp_storage.exists('conflict'))
-self.assert_(temp_storage.exists('conflict_'))
-temp_storage.delete('conflict')
-temp_storage.delete('conflict_')
+self.assert_(self.storage.exists('conflict'))
+self.assert_(self.storage.exists('conflict_'))
+self.storage.delete('conflict')
+self.storage.delete('conflict_')
 
 class FileStoragePermissions(TestCase):
 def setUp(self):
 self.old_perms = settings.FILE_UPLOAD_PERMISSIONS
 settings.FILE_UPLOAD_PERMISSIONS = 0666
-
+self.storage_dir = tempfile.mkdtemp()
+self.storage = FileSystemStorage(self.storage_dir)
+
+def tearDown(self):
+settings.FILE_UPLOAD_PERMISSIONS = self.old_perms
+shutil.rmtree(self.storage_dir)
+
 def test_file_upload_permissions(self):
-name = temp_storage.save("the_file", 

[Changeset] r9226 - in django/trunk/tests: modeltests/model_forms regressiontests/file_storage

2008-10-10 Thread noreply

Author: jacob
Date: 2008-10-10 17:13:16 -0500 (Fri, 10 Oct 2008)
New Revision: 9226

Modified:
   django/trunk/tests/modeltests/model_forms/models.py
   django/trunk/tests/regressiontests/file_storage/models.py
   django/trunk/tests/regressiontests/file_storage/tests.py
Log:
Yet more file storage testing cleanup for the sake of buildbots; this should be 
the last of it, I hope.

Modified: django/trunk/tests/modeltests/model_forms/models.py
===
--- django/trunk/tests/modeltests/model_forms/models.py 2008-10-10 21:42:26 UTC 
(rev 9225)
+++ django/trunk/tests/modeltests/model_forms/models.py 2008-10-10 22:13:16 UTC 
(rev 9226)
@@ -19,7 +19,8 @@
 except NameError:
 from django.utils.itercompat import sorted
 
-temp_storage = FileSystemStorage(tempfile.gettempdir())
+temp_storage_dir = tempfile.mkdtemp()
+temp_storage = FileSystemStorage(temp_storage_dir)
 
 ARTICLE_STATUS = (
 (1, 'Draft'),
@@ -1251,4 +1252,8 @@
 >>> core = form.save()
 >>> core.parent
 
+
+# Clean up
+>>> import shutil
+>>> shutil.rmtree(temp_storage_dir)
 """}

Modified: django/trunk/tests/regressiontests/file_storage/models.py
===
--- django/trunk/tests/regressiontests/file_storage/models.py   2008-10-10 
21:42:26 UTC (rev 9225)
+++ django/trunk/tests/regressiontests/file_storage/models.py   2008-10-10 
22:13:16 UTC (rev 9226)
@@ -1,10 +1,12 @@
 import os
 import tempfile
+import shutil
 from django.db import models
 from django.core.files.storage import FileSystemStorage
 from django.core.files.base import ContentFile
 
-temp_storage = FileSystemStorage(tempfile.gettempdir())
+temp_storage_dir = tempfile.mkdtemp()
+temp_storage = FileSystemStorage(temp_storage_dir)
 
 # Test for correct behavior of width_field/height_field.
 # Of course, we can't run this without PIL.
@@ -64,5 +66,7 @@
 >>> _ = p3.mugshot.size
 >>> hasattr(p3.mugshot, '_file')
 False
+
+>>> shutil.rmtree(temp_storage_dir)
 """}
 
\ No newline at end of file

Modified: django/trunk/tests/regressiontests/file_storage/tests.py
===
--- django/trunk/tests/regressiontests/file_storage/tests.py2008-10-10 
21:42:26 UTC (rev 9225)
+++ django/trunk/tests/regressiontests/file_storage/tests.py2008-10-10 
22:13:16 UTC (rev 9226)
@@ -88,10 +88,12 @@
 # without threading.
 import os
 import time
+import shutil
+import tempfile
 from unittest import TestCase
 from django.conf import settings
 from django.core.files.base import ContentFile
-from models import temp_storage
+from django.core.files.storage import FileSystemStorage
 try:
 import threading
 except ImportError:
@@ -104,29 +106,38 @@
 
 class FileSaveRaceConditionTest(TestCase):
 def setUp(self):
+self.storage_dir = tempfile.mkdtemp()
+self.storage = FileSystemStorage(self.storage_dir)
 self.thread = threading.Thread(target=self.save_file, 
args=['conflict'])
 
+def tearDown(self):
+shutil.rmtree(self.storage_dir)
+
 def save_file(self, name):
-name = temp_storage.save(name, SlowFile("Data"))
+name = self.storage.save(name, SlowFile("Data"))
 
 def test_race_condition(self):
 self.thread.start()
 name = self.save_file('conflict')
 self.thread.join()
-self.assert_(temp_storage.exists('conflict'))
-self.assert_(temp_storage.exists('conflict_'))
-temp_storage.delete('conflict')
-temp_storage.delete('conflict_')
+self.assert_(self.storage.exists('conflict'))
+self.assert_(self.storage.exists('conflict_'))
+self.storage.delete('conflict')
+self.storage.delete('conflict_')
 
 class FileStoragePermissions(TestCase):
 def setUp(self):
 self.old_perms = settings.FILE_UPLOAD_PERMISSIONS
 settings.FILE_UPLOAD_PERMISSIONS = 0666
-
+self.storage_dir = tempfile.mkdtemp()
+self.storage = FileSystemStorage(self.storage_dir)
+
+def tearDown(self):
+settings.FILE_UPLOAD_PERMISSIONS = self.old_perms
+shutil.rmtree(self.storage_dir)
+
 def test_file_upload_permissions(self):
-name = temp_storage.save("the_file", ContentFile("data"))
-actual_mode = os.stat(temp_storage.path(name))[0] & 0777
+name = self.storage.save("the_file", ContentFile("data"))
+actual_mode = os.stat(self.storage.path(name))[0] & 0777
 self.assertEqual(actual_mode, 0666)
-
-def tearDown(self):
-settings.FILE_UPLOAD_PERMISSIONS = self.old_perms
\ No newline at end of file
+


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit 

Re: [Django] #2284: [patch] Extra /sql files with whitespace break syncdb

2008-10-10 Thread Django
#2284: [patch] Extra /sql files with whitespace break syncdb
+---
  Reporter:  scottanderson  | Owner:  
anonymoushgjdhj  vf
Status:  new| Milestone:  post-1.0  
 
 Component:  django.contrib.databrowse  |   Version:  1.0-alpha 
 
Resolution: |  Keywords:  syncdb
 
 Stage:  Accepted   | Has_patch:  1 
 
Needs_docs:  1  |   Needs_tests:  1 
 
Needs_better_patch:  1  |  
+---
Changes (by anonymous):

  * needs_better_patch:  0 => 1
  * component:  django-admin.py => django.contrib.databrowse
  * version:  SVN => 1.0-alpha
  * milestone:  => post-1.0
  * owner:  nobody => anonymoushgjdhj  vf
  * needs_docs:  0 => 1

Comment:

 Replying to [ticket:2284 scottanderson]:
 > Extra .sql files in /sql directories break syncdb when the files have
 whitespace.
 >
 > Example:jgnjn   njngjnj jnj koijiojij jiojiojibvj iojiojbio jiojioji ji
 jiojio joi joijoijovijfiji ijoijkioj  iojoij oij oijioj iojio joijiojioj
 iojioj ioj
 >
 > CREATE TABLE "forum_post_fulltext" (
 > etc...
 >   ) WITHOUT OIDS;
 >
 > CREATE INDEX idxcontent ON forum_post_fulltext USING gist (content_idx);
 >
 > CREATE INDEX idxposttree ON forum_post (thread_id, leftid, rightid);
 >
 > CREATE FUNCTION f_post_insert() RETURNS trigger AS '
 > ... etc. ...
 > ' LANGUAGE plpgsql
 > ;
 >
 > The above will cause syncdb to display errors.

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



Re: [Django] #8916: admin auth change password not working

2008-10-10 Thread Django
#8916: admin auth change password not working
---+
  Reporter:  [EMAIL PROTECTED]| Owner:  nobody
Status:  reopened  | Milestone:
 Component:  django.contrib.admin  |   Version:  1.0   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by [EMAIL PROTECTED]):

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

Comment:

 Sure looks the same to me. The new admin seems to work fine for me
 otherwise. My regular password changing forms work fine, btw.



 Traceback (most recent call last):

  File "/home/dynnetwork/lib/python2.5/django/core/handlers/base.py", line
 86, in get_response
response = callback(request, *callback_args, **callback_kwargs)

  File "/home/dynnetwork/lib/python2.5/django/contrib/admin/sites.py", line
 157, in root
return self.model_page(request, *url.split('/', 2))

  File "/home/dynnetwork/lib/python2.5/django/views/decorators/cache.py",
 line 44, in _wrapped_view_func
response = view_func(request, *args, **kwargs)

  File "/home/dynnetwork/lib/python2.5/django/contrib/admin/sites.py", line
 176, in model_page
return admin_obj(request, rest_of_url)

  File "/home/dynnetwork/lib/python2.5/django/contrib/admin/options.py",
 line 197, in __call__
return self.change_view(request, unquote(url))

  File "/home/dynnetwork/lib/python2.5/django/db/transaction.py", line 238,
 in _commit_on_success
res = func(*args, **kw)

  File "/home/dynnetwork/lib/python2.5/django/contrib/admin/options.py",
 line 548, in change_view
obj = model._default_manager.get(pk=object_id)

  File "/home/dynnetwork/lib/python2.5/django/db/models/manager.py", line
 93, in get
return self.get_query_set().get(*args, **kwargs)

  File "/home/dynnetwork/lib/python2.5/django/db/models/query.py", line
 303, in get
clone = self.filter(*args, **kwargs)

  File "/home/dynnetwork/lib/python2.5/django/db/models/query.py", line
 489, in filter
return self._filter_or_exclude(False, *args, **kwargs)

  File "/home/dynnetwork/lib/python2.5/django/db/models/query.py", line
 507, in _filter_or_exclude
clone.query.add_q(Q(*args, **kwargs))

  File "/home/dynnetwork/lib/python2.5/django/db/models/sql/query.py", line
 1248, in add_q
can_reuse=used_aliases)

  File "/home/dynnetwork/lib/python2.5/django/db/models/sql/query.py", line
 1191, in add_filter
self.where.add((alias, col, field, lookup_type, value), connector)

  File "/home/dynnetwork/lib/python2.5/django/db/models/sql/where.py", line
 48, in add
params = field.get_db_prep_lookup(lookup_type, value)

  File
 "/home/dynnetwork/lib/python2.5/django/db/models/fields/__init__.py", line
 202, in get_db_prep_lookup
return [self.get_db_prep_value(value)]

  File
 "/home/dynnetwork/lib/python2.5/django/db/models/fields/__init__.py", line
 353, in get_db_prep_value
return int(value)

 ValueError: invalid literal for int() with base 10: '12/password'

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



Re: [Django] #937: Autoreload reloads for every request.

2008-10-10 Thread Django
#937: Autoreload reloads for every request.
+---
  Reporter:  [EMAIL PROTECTED] | Owner:  adrian
Status:  reopened   | Milestone:
 Component:  django-admin.py runserver  |   Version:  SVN   
Resolution: |  Keywords:
 Stage:  Accepted   | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Comment (by lgastako):

 I am experiencing this problem (.so files getting incorrect mtime results
 and causing reloads on every request) on Django 1.0 on Leopard.  I am
 working around it by adding a check to exclude .so files for now, but I
 would love to see this fixed.  I am happy to provide more information if
 it would be helpful.

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



Re: [Django] #8916: admin auth change password not working

2008-10-10 Thread Django
#8916: admin auth change password not working
---+
  Reporter:  [EMAIL PROTECTED]| Owner:  nobody
Status:  closed| Milestone:
 Component:  django.contrib.admin  |   Version:  1.0   
Resolution:  worksforme|  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by kmtracey):

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

Comment:

 Really the exact same error with the exact same traceback?  Because the
 original poster seemed to come to the conclusion it was a user error.  And
 I can do a get on the change password form in admin using current trunk,
 so there's something different about what you are doing.  Please elaborate
 on how you have configured things and what exact error you get, including
 traceback.

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



[Changeset] r9225 - in django/branches/releases/1.0.X: . django/contrib/sessions tests/regressiontests/cache

2008-10-10 Thread noreply

Author: jacob
Date: 2008-10-10 16:42:26 -0500 (Fri, 10 Oct 2008)
New Revision: 9225

Modified:
   django/branches/releases/1.0.X/
   django/branches/releases/1.0.X/django/contrib/sessions/tests.py
   django/branches/releases/1.0.X/tests/regressiontests/cache/tests.py
Log:
[1.0.X] More be-nice-to-the-buildbot: be better about cleaning up files created 
by the cache/session tests.

Backport of r9924 from trunk.




Property changes on: django/branches/releases/1.0.X
___
Name: svnmerge-integrated
   - 
/django/trunk:1-9097,9099-9102,9104-9109,9111,9113-9144,9146-9151,9153-9156,9158-9159,9161-9187,9189-9211,9222
   + 
/django/trunk:1-9097,9099-9102,9104-9109,9111,9113-9144,9146-9151,9153-9156,9158-9159,9161-9187,9189-9211,9222,9224

Modified: django/branches/releases/1.0.X/django/contrib/sessions/tests.py
===
--- django/branches/releases/1.0.X/django/contrib/sessions/tests.py 
2008-10-10 21:41:12 UTC (rev 9224)
+++ django/branches/releases/1.0.X/django/contrib/sessions/tests.py 
2008-10-10 21:42:26 UTC (rev 9225)
@@ -54,6 +54,11 @@
 >>> db_session.save()
 >>> DatabaseSession('1').get('cat')
 
+# Do file session tests in an isolated directory, and kill it after we're done.
+>>> original_session_file_path = settings.SESSION_FILE_PATH
+>>> import tempfile
+>>> temp_session_store = settings.SESSION_FILE_PATH = tempfile.mkdtemp()
+
 >>> file_session = FileSession()
 >>> file_session.modified
 False
@@ -105,6 +110,17 @@
 ...
 ImproperlyConfigured: The session storage path 
'/if/this/directory/exists/you/have/a/weird/computer' doesn't exist. Please set 
your SESSION_FILE_PATH setting to an existing directory in which Django can 
store session data.
 
+# Clean up after the file tests
+>>> settings.SESSION_FILE_PATH = original_session_file_path
+>>> import shutil
+>>> shutil.rmtree(temp_session_store)
+
+#
+# Cache-based tests
+# NB: be careful to delete any sessions created; stale sessions fill up the
+# /tmp and eventually overwhelm it after lots of runs (think buildbots)
+#
+
 >>> cache_session = CacheSession()
 >>> cache_session.modified
 False
@@ -144,7 +160,7 @@
 >>> Session.objects.filter(pk=cache_session.session_key).delete()
 >>> cache_session = CacheSession(cache_session.session_key)
 >>> cache_session.save()
->>> CacheSession('1').get('cat')
+>>> cache_session.delete(cache_session.session_key)
 
 >>> s = SessionBase()
 >>> s._session['some key'] = 'exists' # Pre-populate the session with some data

Modified: django/branches/releases/1.0.X/tests/regressiontests/cache/tests.py
===
--- django/branches/releases/1.0.X/tests/regressiontests/cache/tests.py 
2008-10-10 21:41:12 UTC (rev 9224)
+++ django/branches/releases/1.0.X/tests/regressiontests/cache/tests.py 
2008-10-10 21:42:26 UTC (rev 9225)
@@ -9,7 +9,7 @@
 import time
 import unittest
 
-from django.core.cache import cache
+from django.core.cache import cache, get_cache
 from django.core.cache.backends.filebased import CacheClass as FileCache
 from django.http import HttpResponse
 from django.utils.cache import patch_vary_headers
@@ -23,51 +23,64 @@
 return 24
 
 class Cache(unittest.TestCase):
+def setUp(self):
+# Special-case the file cache so we can clean up after ourselves.
+if isinstance(cache, FileCache):
+self.cache_dir = tempfile.mkdtemp()
+self.cache = get_cache("file:///%s" % self.cache_dir)
+else:
+self.cache_dir = None
+self.cache = cache
+
+def tearDown(self):
+if self.cache_dir is not None:
+shutil.rmtree(self.cache_dir)
+
 def test_simple(self):
 # simple set/get
-cache.set("key", "value")
-self.assertEqual(cache.get("key"), "value")
+self.cache.set("key", "value")
+self.assertEqual(self.cache.get("key"), "value")
 
 def test_add(self):
 # test add (only add if key isn't already in cache)
-cache.add("addkey1", "value")
-result = cache.add("addkey1", "newvalue")
+self.cache.add("addkey1", "value")
+result = self.cache.add("addkey1", "newvalue")
 self.assertEqual(result, False)
-self.assertEqual(cache.get("addkey1"), "value")
+self.assertEqual(self.cache.get("addkey1"), "value")
 
 def test_non_existent(self):
 # get with non-existent keys
-self.assertEqual(cache.get("does_not_exist"), None)
-self.assertEqual(cache.get("does_not_exist", "bang!"), "bang!")
+self.assertEqual(self.cache.get("does_not_exist"), None)
+self.assertEqual(self.cache.get("does_not_exist", "bang!"), "bang!")
 
 def test_get_many(self):
 # get_many
-cache.set('a', 'a')
-cache.set('b', 'b')
-cache.set('c', 'c')
-cache.set('d', 'd')
-

Re: [Django] #8916: admin auth change password not working

2008-10-10 Thread Django
#8916: admin auth change password not working
---+
  Reporter:  [EMAIL PROTECTED]| Owner:  nobody
Status:  reopened  | Milestone:
 Component:  django.contrib.admin  |   Version:  1.0   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Old description:

> Trying to access the change password form in auth admin will cause a
> "ValueError"
>
> Trace is below
>
> Environment:
>
> Request Method: GET
> Request URL: http://localhost:8000/admin/auth/user/1/password/
> Django Version: 1.0-final-SVN-unknown
> Python Version: 2.5.0
> Installed Applications:
> ['django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.admin',
>  'django.contrib.databrowse',
>  'pressDB.press',
>  'pressDB.ext']
> Installed Middleware:
> ('django.middleware.common.CommonMiddleware',
>  'django.contrib.sessions.middleware.SessionMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'django.middleware.doc.XViewMiddleware')
>

> Traceback:
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
> /site-packages/django/core/handlers/base.py" in get_response
>   86. response = callback(request, *callback_args,
> **callback_kwargs)
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
> /site-packages/django/contrib/admin/sites.py" in root
>   158. return self.model_page(request, *url.split('/',
> 2))
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
> /site-packages/django/views/decorators/cache.py" in _wrapped_view_func
>   44. response = view_func(request, *args, **kwargs)
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
> /site-packages/django/contrib/admin/sites.py" in model_page
>   177. return admin_obj(request, rest_of_url)
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
> /site-packages/django/contrib/admin/options.py" in __call__
>   197. return self.change_view(request, unquote(url))
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
> /site-packages/django/db/transaction.py" in _commit_on_success
>   238. res = func(*args, **kw)
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
> /site-packages/django/contrib/admin/options.py" in change_view
>   557. obj = model._default_manager.get(pk=object_id)
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
> /site-packages/django/db/models/manager.py" in get
>   93. return self.get_query_set().get(*args, **kwargs)
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
> /site-packages/django/db/models/query.py" in get
>   297. clone = self.filter(*args, **kwargs)
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
> /site-packages/django/db/models/query.py" in filter
>   483. return self._filter_or_exclude(False, *args, **kwargs)
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
> /site-packages/django/db/models/query.py" in _filter_or_exclude
>   501. clone.query.add_q(Q(*args, **kwargs))
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
> /site-packages/django/db/models/sql/query.py" in add_q
>   1224. can_reuse=used_aliases)
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
> /site-packages/django/db/models/sql/query.py" in add_filter
>   1167. self.where.add((alias, col, field, lookup_type, value),
> connector)
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
> /site-packages/django/db/models/sql/where.py" in add
>   48. params = field.get_db_prep_lookup(lookup_type,
> value)
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
> /site-packages/django/db/models/fields/__init__.py" in get_db_prep_lookup
>   202. return [self.get_db_prep_value(value)]
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
> /site-packages/django/db/models/fields/__init__.py" in get_db_prep_value
>   353. return int(value)
>
> Exception Type: ValueError at /admin/auth/user/1/password/
> Exception Value: invalid literal for int() with base 10: '1/password'

New description:

 Trying to access the change password form in auth admin will cause a
 "ValueError"

 Trace is below
 {{{
 Environment:

 Request Method: GET
 Request URL: http://localhost:8000/admin/auth/user/1/password/
 Django Version: 

[Changeset] r9224 - in django/trunk: django/contrib/sessions tests/regressiontests/cache

2008-10-10 Thread noreply

Author: jacob
Date: 2008-10-10 16:41:12 -0500 (Fri, 10 Oct 2008)
New Revision: 9224

Modified:
   django/trunk/django/contrib/sessions/tests.py
   django/trunk/tests/regressiontests/cache/tests.py
Log:
More be-nice-to-the-buildbot: be better about cleaning up files created by the 
cache/session tests.

Modified: django/trunk/django/contrib/sessions/tests.py
===
--- django/trunk/django/contrib/sessions/tests.py   2008-10-10 20:14:52 UTC 
(rev 9223)
+++ django/trunk/django/contrib/sessions/tests.py   2008-10-10 21:41:12 UTC 
(rev 9224)
@@ -54,6 +54,11 @@
 >>> db_session.save()
 >>> DatabaseSession('1').get('cat')
 
+# Do file session tests in an isolated directory, and kill it after we're done.
+>>> original_session_file_path = settings.SESSION_FILE_PATH
+>>> import tempfile
+>>> temp_session_store = settings.SESSION_FILE_PATH = tempfile.mkdtemp()
+
 >>> file_session = FileSession()
 >>> file_session.modified
 False
@@ -105,6 +110,17 @@
 ...
 ImproperlyConfigured: The session storage path 
'/if/this/directory/exists/you/have/a/weird/computer' doesn't exist. Please set 
your SESSION_FILE_PATH setting to an existing directory in which Django can 
store session data.
 
+# Clean up after the file tests
+>>> settings.SESSION_FILE_PATH = original_session_file_path
+>>> import shutil
+>>> shutil.rmtree(temp_session_store)
+
+#
+# Cache-based tests
+# NB: be careful to delete any sessions created; stale sessions fill up the
+# /tmp and eventually overwhelm it after lots of runs (think buildbots)
+#
+
 >>> cache_session = CacheSession()
 >>> cache_session.modified
 False
@@ -144,7 +160,7 @@
 >>> Session.objects.filter(pk=cache_session.session_key).delete()
 >>> cache_session = CacheSession(cache_session.session_key)
 >>> cache_session.save()
->>> CacheSession('1').get('cat')
+>>> cache_session.delete(cache_session.session_key)
 
 >>> s = SessionBase()
 >>> s._session['some key'] = 'exists' # Pre-populate the session with some data

Modified: django/trunk/tests/regressiontests/cache/tests.py
===
--- django/trunk/tests/regressiontests/cache/tests.py   2008-10-10 20:14:52 UTC 
(rev 9223)
+++ django/trunk/tests/regressiontests/cache/tests.py   2008-10-10 21:41:12 UTC 
(rev 9224)
@@ -9,7 +9,7 @@
 import time
 import unittest
 
-from django.core.cache import cache
+from django.core.cache import cache, get_cache
 from django.core.cache.backends.filebased import CacheClass as FileCache
 from django.http import HttpResponse
 from django.utils.cache import patch_vary_headers
@@ -23,51 +23,64 @@
 return 24
 
 class Cache(unittest.TestCase):
+def setUp(self):
+# Special-case the file cache so we can clean up after ourselves.
+if isinstance(cache, FileCache):
+self.cache_dir = tempfile.mkdtemp()
+self.cache = get_cache("file:///%s" % self.cache_dir)
+else:
+self.cache_dir = None
+self.cache = cache
+
+def tearDown(self):
+if self.cache_dir is not None:
+shutil.rmtree(self.cache_dir)
+
 def test_simple(self):
 # simple set/get
-cache.set("key", "value")
-self.assertEqual(cache.get("key"), "value")
+self.cache.set("key", "value")
+self.assertEqual(self.cache.get("key"), "value")
 
 def test_add(self):
 # test add (only add if key isn't already in cache)
-cache.add("addkey1", "value")
-result = cache.add("addkey1", "newvalue")
+self.cache.add("addkey1", "value")
+result = self.cache.add("addkey1", "newvalue")
 self.assertEqual(result, False)
-self.assertEqual(cache.get("addkey1"), "value")
+self.assertEqual(self.cache.get("addkey1"), "value")
 
 def test_non_existent(self):
 # get with non-existent keys
-self.assertEqual(cache.get("does_not_exist"), None)
-self.assertEqual(cache.get("does_not_exist", "bang!"), "bang!")
+self.assertEqual(self.cache.get("does_not_exist"), None)
+self.assertEqual(self.cache.get("does_not_exist", "bang!"), "bang!")
 
 def test_get_many(self):
 # get_many
-cache.set('a', 'a')
-cache.set('b', 'b')
-cache.set('c', 'c')
-cache.set('d', 'd')
-self.assertEqual(cache.get_many(['a', 'c', 'd']), {'a' : 'a', 'c' : 
'c', 'd' : 'd'})
-self.assertEqual(cache.get_many(['a', 'b', 'e']), {'a' : 'a', 'b' : 
'b'})
+self.cache.set('a', 'a')
+self.cache.set('b', 'b')
+self.cache.set('c', 'c')
+self.cache.set('d', 'd')
+self.assertEqual(self.cache.get_many(['a', 'c', 'd']), {'a' : 'a', 'c' 
: 'c', 'd' : 'd'})
+self.assertEqual(self.cache.get_many(['a', 'b', 'e']), {'a' : 'a', 'b' 
: 'b'})
 
 def test_delete(self):
 # delete
-cache.set("key1", "spam")
-cache.set("key2", "eggs")

Re: [Django] #6961: loaddata fails if models directory instead of models.py

2008-10-10 Thread Django
#6961: loaddata fails if models directory instead of models.py
--+-
  Reporter:  pmd  | Owner:  nobody  
Status:  new  | Milestone:  
 Component:  django-admin.py  |   Version:  SVN 
Resolution:   |  Keywords:  loaddata
 Stage:  Accepted | Has_patch:  1   
Needs_docs:  0|   Needs_tests:  0   
Needs_better_patch:  0|  
--+-
Changes (by zhaoz):

  * needs_better_patch:  1 => 0

Comment:

 Replying to [comment:5 zhaoz]:
 > The patch did not work for me when patched against svn trunk's 9222,
 failed test.

 Scratch what I last said, it's working, but it doesn't seem to be done in
 a very elegant way.

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



Re: [Django] #6961: loaddata fails if models directory instead of models.py

2008-10-10 Thread Django
#6961: loaddata fails if models directory instead of models.py
--+-
  Reporter:  pmd  | Owner:  nobody  
Status:  new  | Milestone:  
 Component:  django-admin.py  |   Version:  SVN 
Resolution:   |  Keywords:  loaddata
 Stage:  Accepted | Has_patch:  1   
Needs_docs:  0|   Needs_tests:  0   
Needs_better_patch:  1|  
--+-
Changes (by zhaoz):

  * needs_better_patch:  0 => 1

Comment:

 The patch did not work for me when patched against svn trunk's 9222,
 failed test.

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



[Changeset] r9223 - in django/branches/releases/1.0.X: . tests/modeltests/files

2008-10-10 Thread noreply

Author: jacob
Date: 2008-10-10 15:14:52 -0500 (Fri, 10 Oct 2008)
New Revision: 9223

Modified:
   django/branches/releases/1.0.X/
   django/branches/releases/1.0.X/tests/modeltests/files/models.py
Log:
[1.0.X] Be nice to buildbots: switched `modeltests/files` to use a proper 
isolated directory for file storage

Backport of r9222 from trunk.



Property changes on: django/branches/releases/1.0.X
___
Name: svnmerge-integrated
   - 
/django/trunk:1-9097,9099-9102,9104-9109,9111,9113-9144,9146-9151,9153-9156,9158-9159,9161-9187,9189-9211
   + 
/django/trunk:1-9097,9099-9102,9104-9109,9111,9113-9144,9146-9151,9153-9156,9158-9159,9161-9187,9189-9211,9222

Modified: django/branches/releases/1.0.X/tests/modeltests/files/models.py
===
--- django/branches/releases/1.0.X/tests/modeltests/files/models.py 
2008-10-10 20:09:51 UTC (rev 9222)
+++ django/branches/releases/1.0.X/tests/modeltests/files/models.py 
2008-10-10 20:14:52 UTC (rev 9223)
@@ -5,14 +5,15 @@
 and where files should be stored.
 """
 
+import shutil
 import tempfile
-
 from django.db import models
 from django.core.files.base import ContentFile
 from django.core.files.storage import FileSystemStorage
 from django.core.cache import cache
 
-temp_storage = FileSystemStorage(location=tempfile.gettempdir())
+temp_storage_location = tempfile.mkdtemp()
+temp_storage = FileSystemStorage(location=temp_storage_location)
 
 # Write out a file to be used as default content
 temp_storage.save('tests/default.txt', ContentFile('default content'))
@@ -109,10 +110,10 @@
 >>> obj4.random
 
 
-# Clean up the temporary files.
-
+# Clean up the temporary files and dir.
 >>> obj1.normal.delete()
 >>> obj2.normal.delete()
 >>> obj3.default.delete()
 >>> obj4.random.delete()
+>>> shutil.rmtree(temp_storage_location)
 """}


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



[Django] #9343: Changed text of testing page to reflect status of db between doctests

2008-10-10 Thread Django
#9343: Changed text of testing page to reflect status of db between doctests
---+
 Reporter:  davenaff   |   Owner:  nobody
   Status:  new|   Milestone:
Component:  Uncategorized  | Version:  1.0   
 Keywords: |   Stage:  Unreviewed
Has_patch:  1  |  
---+
 The db is not flushed between doctests.  See here for more:
 http://groups.google.com/group/django-
 
developers/browse_thread/thread/226e6eb129493809/47b1c250d359107a?lnk=gst=test+flush#47b1c250d359107a

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



Re: [Django] #8916: admin auth change password not working

2008-10-10 Thread Django
#8916: admin auth change password not working
---+
  Reporter:  [EMAIL PROTECTED]| Owner:  nobody
Status:  reopened  | Milestone:
 Component:  django.contrib.admin  |   Version:  1.0   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by [EMAIL PROTECTED]):

  * status:  closed => reopened
  * resolution:  invalid =>
  * component:  Authentication => django.contrib.admin

Comment:

 I am having the same problem on both 1.0 and trunk.

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



[Django] #9342: query optimization issue

2008-10-10 Thread Django
#9342: query optimization issue
-+--
 Reporter:  [EMAIL PROTECTED]  |   Owner:  nobody
   Status:  new  |   Milestone:
Component:  Uncategorized| Version:  1.0   
 Keywords:   |   Stage:  Unreviewed
Has_patch:  0|  
-+--
 The generated SQL for the following example is incorrect. It appears that
 an optimization to reduce the number of table joins is at fault.

 Example:
 {{{
 class tableA(models.Model):
 key = models.AutoField(primary_key=True)

 class tableB(models.Model):
 key = models.ForeignKey(tableA)

 class tableC(models.Model):
 key = models.OneToOneField(tableA, primary_key=True)
 data = models.CharField(max_length=40, null=True)
 }}}
 The following filter will produce incorrect SQL:
 {{{
 qs = tableB.objects.exclude(key__tablec__data__iexact='test')
 qs.count()
 }}}
 The generated SQL will be something like:
 {{{
 SELECT "tableB"."key_id"
 FROM "tableB"
  WHERE NOT ("tableB"."key_id" IN (SELECT U2."key_id" FROM "tableB" U0
   INNER JOIN
 "tableC" U2 ON (U1."key_id" = U2."key_id") WHERE UPPER(U2."data"::text) =
 UPPER('test') ))
 }}}

 In the sub-select, tableA is being referenced as alias "U1" but is not
 defined. The non-optimized SQL would have been:

 {{{
 SELECT "tableB"."key_id"
 FROM "tableB"
  WHERE NOT ("tableB"."key_id" IN (SELECT U2."key_id" FROM "tableB" U0
   INNER JOIN
 "tableA" U1 ON (U1."key_id" = U0."key_id")
   INNER JOIN
 "tableC" U2 ON (U1."key_id" = U2."key_id") WHERE UPPER(U2."data"::text) =
 UPPER('test') ))
 }}}

 Tracing through the source, it seems that code in functions:
 {{{
 Query::add_filter(self, filter_expr, connector=AND, negate=False,
 trim=False,
 can_reuse=None, process_extras=True)

 and

 Query::setup_joins(self, names, opts, alias, dupe_multis, allow_many=True,
 allow_explicit_fk=False, can_reuse=None, negate=False,
 process_extras=True)
 }}}

 possibly are not agreeing.

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



Re: [Django] #5986: Custom field order in newforms

2008-10-10 Thread Django
#5986: Custom field order in newforms
-+--
  Reporter:  emes| Owner:  nobody   
   
Status:  new | Milestone:  post-1.0 
   
 Component:  Forms   |   Version:  SVN  
   
Resolution:  |  Keywords:  field order 
weight form newforms
 Stage:  Design decision needed  | Has_patch:  1
   
Needs_docs:  1   |   Needs_tests:  0
   
Needs_better_patch:  0   |  
-+--
Comment (by GertSteyn):

 After reeding CookBookNewFormsFieldOrdering this came to mind...

 class FooForm(forms.ModelForm):
 class Meta:
 fields  = ('first_field', 'second_field', 'third_field',)

 def __init__(self, *args, **kwargs):
 super(FooForm, self).__init__(*args, **kwargs)
 self.fields.keyOrder = self.Meta.fields

 The patch has now been reduced to a one liner:
 "self.fields.keyOrder = self.Meta.fields"

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



[Changeset] r9221 - in django/trunk: django/db/backends/oracle tests/regressiontests/queries

2008-10-10 Thread noreply

Author: ikelly
Date: 2008-10-10 12:15:58 -0500 (Fri, 10 Oct 2008)
New Revision: 9221

Modified:
   django/trunk/django/db/backends/oracle/query.py
   django/trunk/tests/regressiontests/queries/models.py
Log:
Fixed .distinct() not working with slicing in Oracle, due to the 
row numbers necessarily being distinct.


Modified: django/trunk/django/db/backends/oracle/query.py
===
--- django/trunk/django/db/backends/oracle/query.py 2008-10-09 23:38:09 UTC 
(rev 9220)
+++ django/trunk/django/db/backends/oracle/query.py 2008-10-10 17:15:58 UTC 
(rev 9221)
@@ -26,8 +26,16 @@
 
 class OracleQuery(QueryClass):
 def resolve_columns(self, row, fields=()):
-index_start = len(self.extra_select.keys())
-values = [self.convert_values(v, None) for v in row[:index_start]]
+# If this query has limit/offset information, then we expect the
+# first column to be an extra "_RN" column that we need to throw
+# away.
+if self.high_mark is not None or self.low_mark:
+rn_offset = 1
+else:
+rn_offset = 0
+index_start = rn_offset + len(self.extra_select.keys())
+values = [self.convert_values(v, None)
+  for v in row[rn_offset:index_start]]
 for value, field in map(None, row[index_start:], fields):
 values.append(self.convert_values(value, field))
 return values
@@ -97,49 +105,17 @@
 sql, params = super(OracleQuery, 
self).as_sql(with_limits=False,
 with_col_aliases=with_col_aliases)
 else:
-# `get_columns` needs to be called before `get_ordering` to
-# populate `_select_alias`.
-self.pre_sql_setup()
-self.get_columns()
-ordering = self.get_ordering()
-
-# Oracle's ROW_NUMBER() function requires an ORDER BY clause.
-if ordering:
-rn_orderby = ', '.join(ordering)
-else:
-# Create a default ORDER BY since none was specified.
-qn = self.quote_name_unless_alias
-opts = self.model._meta
-rn_orderby = '%s.%s' % (qn(opts.db_table),
-qn(opts.fields[0].db_column or opts.fields[0].column))
-
-# Ensure the base query SELECTs our special "_RN" column
-self.extra_select['_RN'] = ('ROW_NUMBER() OVER (ORDER BY %s)'
-% rn_orderby, '')
 sql, params = super(OracleQuery, 
self).as_sql(with_limits=False,
 with_col_aliases=True)
 
 # Wrap the base query in an outer SELECT * with boundaries on
 # the "_RN" column.  This is the canonical way to emulate LIMIT
 # and OFFSET on Oracle.
-sql = 'SELECT * FROM (%s) WHERE "_RN" > %d' % (sql, 
self.low_mark)
+sql = 'SELECT * FROM (SELECT ROW_NUMBER() OVER (ORDER BY 1) AS 
"_RN", "_SUB".* FROM (%s) "_SUB") WHERE "_RN" > %d' % (sql, self.low_mark)
 if self.high_mark is not None:
 sql = '%s AND "_RN" <= %d' % (sql, self.high_mark)
 
 return sql, params
 
-def set_limits(self, low=None, high=None):
-super(OracleQuery, self).set_limits(low, high)
-# We need to select the row number for the LIMIT/OFFSET sql.
-# A placeholder is added to extra_select now, because as_sql is
-# too late to be modifying extra_select.  However, the actual sql
-# depends on the ordering, so that is generated in as_sql.
-self.extra_select['_RN'] = ('1', '')
-
-def clear_limits(self):
-super(OracleQuery, self).clear_limits()
-if '_RN' in self.extra_select:
-del self.extra_select['_RN']
-
 _classes[QueryClass] = OracleQuery
 return OracleQuery

Modified: django/trunk/tests/regressiontests/queries/models.py
===
--- django/trunk/tests/regressiontests/queries/models.py2008-10-09 
23:38:09 UTC (rev 9220)
+++ django/trunk/tests/regressiontests/queries/models.py2008-10-10 
17:15:58 UTC (rev 9221)
@@ -334,6 +334,12 @@
 >>> Item.objects.filter(tags__in=[t1, t2]).filter(tags=t3)
 []
 
+Make sure .distinct() works with slicing (this was broken in Oracle).
+>>> Item.objects.filter(tags__in=[t1, t2]).order_by('name')[:3]
+[, , ]
+>>> Item.objects.filter(tags__in=[t1, t2]).distinct().order_by('name')[:3]
+[, ]
+
 Bug #2080, #3592
 >>> Author.objects.filter(item__name='one') | Author.objects.filter(name='a3')
 [, ]


--~--~-~--~~~---~--~~
You received this message 

Re: [Django] #29: Fix usability issue with limit_choices_to and "Add another" in admin

2008-10-10 Thread Django
#29: Fix usability issue with limit_choices_to and "Add another" in admin
---+
  Reporter:  adrian| Owner:  nobody  
Status:  new   | Milestone:  post-1.0
 Component:  django.contrib.admin  |   Version:  SVN 
Resolution:|  Keywords:  
 Stage:  Someday/Maybe | Has_patch:  0   
Needs_docs:  0 |   Needs_tests:  0   
Needs_better_patch:  0 |  
---+
Changes (by anonymous):

 * cc: [EMAIL PROTECTED] (added)

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



[Django] #9341: Adding a completely new item via raw_id_fields overwrites contents of the many-to-many field

2008-10-10 Thread Django
#9341: Adding a completely new item via raw_id_fields overwrites contents of the
many-to-many field
+---
 Reporter:  [EMAIL PROTECTED]  |   Owner:  nobody
   Status:  new |   Milestone:
Component:  django.contrib.admin| Version:  1.0   
 Keywords:  raw_id_fields many-to-many  |   Stage:  Unreviewed
Has_patch:  0   |  
+---
 Steps to reproduce:

 {{{
 Define a many-to-many field, use raw_id_fields for the admin.
 Populate the field in the admin with one or more IDs.
 In the admin, click its magnifying glass.
 Click Add on the index page, and add one.
 Click Save.
 }}}

 You're automatically returned to the admin page with ONLY the new ID
 showing up in the field. This behavior is great for most foreign keys, but
 for many-to-many fields, it risks losing previous entries.

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



Re: [Django] #8138: Switch django tests to use transactions

2008-10-10 Thread Django
#8138: Switch django tests to use transactions
+---
  Reporter:  mremolt| Owner:  nobody  
Status:  new| Milestone:  post-1.0
 Component:  Testing framework  |   Version:  SVN 
Resolution: |  Keywords:  
 Stage:  Accepted   | Has_patch:  1   
Needs_docs:  0  |   Needs_tests:  0   
Needs_better_patch:  0  |  
+---
Changes (by anonymous):

 * cc: copelco (added)

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



Re: [Django] #7231: New "join" parameter for the "extra" QuerySet method

2008-10-10 Thread Django
#7231: New "join" parameter for the "extra" QuerySet method
-+--
  Reporter:  Davide "Design" Muzzarelli  | Owner:  nobody   
  
Status:  new | Milestone:  post-1.0 
  
 Component:  Core framework  |   Version:  SVN  
  
Resolution:  |  Keywords:  queryset 
extra join
 Stage:  Design decision needed  | Has_patch:  1
  
Needs_docs:  1   |   Needs_tests:  1
  
Needs_better_patch:  0   |  
-+--
Changes (by tobias):

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

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



Re: [Django] #7231: New "join" parameter for the "extra" QuerySet method

2008-10-10 Thread Django
#7231: New "join" parameter for the "extra" QuerySet method
-+--
  Reporter:  Davide "Design" Muzzarelli  | Owner:  tobias   
  
Status:  assigned| Milestone:  post-1.0 
  
 Component:  Core framework  |   Version:  SVN  
  
Resolution:  |  Keywords:  queryset 
extra join
 Stage:  Design decision needed  | Has_patch:  1
  
Needs_docs:  1   |   Needs_tests:  1
  
Needs_better_patch:  0   |  
-+--
Changes (by tobias):

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

Comment:

 see also #9049

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



Re: [Django] #9049: queryset .extra(tables=[...]) unnecessarily quotes table names

2008-10-10 Thread Django
#9049: queryset .extra(tables=[...]) unnecessarily quotes table names
---+
  Reporter:  tobias| Owner:  nobody
Status:  new   | Milestone:
 Component:  Database layer (models, ORM)  |   Version:  1.0   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by tobias):

 Looks like there's already a partial solution to this in #7231, though
 having 'tables', 'join', and potentially 'subquery' keyword arguments to
 .extra() might raise unnecessary confusion when they all do virtually the
 same thing.

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



Re: [Django] #5863: list_display does not allow functions of referenced objects

2008-10-10 Thread Django
#5863: list_display does not allow functions of referenced objects
---+
  Reporter:  Beat Bolli <[EMAIL PROTECTED]>  | Owner:  nobody   
   
Status:  reopened  | Milestone: 
 
 Component:  django.contrib.admin  |   Version:  SVN
 
Resolution:|  Keywords:  
list_display
 Stage:  Design decision needed| Has_patch:  1  
 
Needs_docs:  1 |   Needs_tests:  0  
 
Needs_better_patch:  1 |  
---+
Comment (by kmtracey):

 Replying to [comment:11 pihentagy]:
 > Consistency and DRY: so you shouldn't write boilerplate code. You
 shouldn't specify column name django alredy knows.

 I understand wanting to avoid boilerplate code but I'm missing how this is
 a common enough case to warrant inclusion and balance the additional
 complexity (both for users -- the list of things you can put in
 list_display is getting a bit long -- and code maintainers).  What's the
 common situation where user's would really like to see the value of a
 field in a related model instead of just the text representation of the
 related model?  I'm just not seeing that as a very common need, meaning
 when you need it if you have to write a little extra code it's no big
 deal.  It's not boilerplate if you only have to do it in rare situations.
 I'm looking for something a little more concrete as motivation than mom
 and apple pie goodness.

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



[Django] #9340: `translation.get_language()` should process `settings.LANGUAGE_CODE`

2008-10-10 Thread Django
#9340: `translation.get_language()` should process `settings.LANGUAGE_CODE`
--+-
 Reporter:  jcassee   |   Owner:  nobody
   Status:  new   |   Milestone:
Component:  Internationalization  | Version:  1.0   
 Keywords:|   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 When `translation.get_language_from_request()` processes the `Accept-
 Language` HTTP header it makes sure to remove the 'sublanguage'
 (territory) code if it is not in `settings.LANGUAGES`. So for example, if
 the HTTP headers contain `Accept-Language: en_US` and `LANGUAGES = ('en',
 ...)`, then `get_language_from_request()` returns `'en'`. However, if
 language negotiation fails then `get_language_from_request()` returns
 `settings.LANGUAGE_CODE` without checking `LANGUAGES`. Using default
 settings, `get_language_from_request()` would return `'en-us'` while
 `LANGUAGES` only contains `'en'`.

 This behaviour is inconsistent. Either `get_language_from_request()`
 should not remove the sublanguage code from the negotiated language or it
 should also do so for the default language. In other words, either

  1. `translation.get_language()` is always in `LANGUAGES`, or
  1. `translation.get_language()` or its root language is always in
 `LANGUAGES`.

 In the first case, 'en-us' should not be the default `LANGUAGE_CODE` (at
 least not as returned from `get_language()`). In the second case Django
 should not strip the sublanguage from the negotiated language code.

 Because installations that do not use content negotiation will never call
 `get_language_from_request()` any stripping of the sublanguage code might
 need to be moved to `translation.get_language()`.

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



Re: [Django] #5863: list_display does not allow functions of referenced objects

2008-10-10 Thread Django
#5863: list_display does not allow functions of referenced objects
---+
  Reporter:  Beat Bolli <[EMAIL PROTECTED]>  | Owner:  nobody   
   
Status:  reopened  | Milestone: 
 
 Component:  django.contrib.admin  |   Version:  SVN
 
Resolution:|  Keywords:  
list_display
 Stage:  Design decision needed| Has_patch:  1  
 
Needs_docs:  1 |   Needs_tests:  0  
 
Needs_better_patch:  1 |  
---+
Comment (by pihentagy):

 Replying to [comment:10 kmtracey]:
 > but even before that please answer the first question I had: what does
 this provide that isn't already possible given the expanded options of
 things you can now specify in list_display?

 Consistency and DRY: so you shouldn't write boilerplate code. You
 shouldn't specify column name django alredy knows.

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



[Django] #9339: [l10n][zh_CN] fix translation in django.po

2008-10-10 Thread Django
#9339: [l10n][zh_CN] fix translation in django.po
--+-
 Reporter:  lidaobing |   Owner:  nobody
   Status:  new   |   Milestone:
Component:  Internationalization  | Version:  SVN   
 Keywords:|   Stage:  Unreviewed
Has_patch:  1 |  
--+-
 attachment as follows
 {{{
 --- django.po   (revision 9220)
 +++ django.po   (working copy)
 @@ -1262,7 +1262,7 @@

  #: contrib/auth/models.py:143
  msgid "Designates that this user has all permissions without explicitly
 assigning them."
 -msgstr "指明用户是否可以登录到这个管理站点。"
 +msgstr "指明该用户缺省拥有所有权限。"

  #: contrib/auth/models.py:144
  msgid "last login"

 }}}

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



[Django] #9338: admin-interface: inline formset should have can_order=True when using order_with_respect_to

2008-10-10 Thread Django
#9338: admin-interface: inline formset should have can_order=True when using
order_with_respect_to
--+-
 Reporter:  patrickk  |   Owner:  nobody
   Status:  new   |   Milestone:
Component:  Contrib apps  | Version:  SVN   
 Keywords:|   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 when using order_with_respect_to, the inline formset should have
 can_order=True, but it hasn´t.
 this is important if one tries to hack the admin-interface, e.g. for
 implementing drag/drop-functionality with edit-inlines.

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