Re: [Django] #9857: URLfield with verify_exists hangs if given an unresponsive URL

2009-05-02 Thread Django
#9857: URLfield with verify_exists hangs if given an unresponsive URL
---+
  Reporter:  aptiko| Owner:  nobody
Status:  new   | Milestone:  1.1   
 Component:  Forms |   Version:  1.0   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  1 |  
---+
Changes (by russellm):

  * needs_better_patch:  0 => 1

Comment:

 I acknowledge the problem that exists here, but I _really_ don't like this
 solution. Setting the default timeout is a really nasty workaround that
 has potential for nasty side-effects. I don't have a better suggestion
 though, so we might need to hold our nose and wear this particular stink
 until Python 2.6 is our minimum supported version.

 I'm also not particularly enthused about introducing a global setting for
 the timeout - this strikes me as something that should be a per-URLField
 setting, not a global setting.

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



Re: [Django] #2538: Add throttling middleware

2009-05-02 Thread Django
#2538: Add throttling middleware
-+--
  Reporter:  adrian  | Owner:  adrian  
Status:  reopened| Milestone:  
 Component:  Core framework  |   Version:  
Resolution:  |  Keywords:  session handling
 Stage:  Unreviewed  | Has_patch:  0   
Needs_docs:  0   |   Needs_tests:  0   
Needs_better_patch:  0   |  
-+--
Changes (by elsigh):

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

Comment:

 In the world of App Engine this would be handy to prevent too much data
 submission from a single IP perhaps? i.e. when running django in a non-
 apache environment.

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



Re: [Django] #10047: TemporaryFile.seek has bad interface under Windows NT

2009-05-02 Thread Django
#10047: TemporaryFile.seek has bad interface under Windows NT
---+
  Reporter:  ftartag...@h-umus.it  | Owner:  jkistler
Status:  assigned  | Milestone:  1.1 
 Component:  File uploads/storage  |   Version:  SVN 
Resolution:|  Keywords:  
 Stage:  Accepted  | Has_patch:  1   
Needs_docs:  0 |   Needs_tests:  0   
Needs_better_patch:  0 |  
---+
Changes (by jkistler):

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

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



Re: [Django] #10983: Won't render jpg image in html file

2009-05-02 Thread Django
#10983: Won't render jpg image in html file
+---
  Reporter:  Mac| Owner:  nobody
Status:  closed | Milestone:
 Component:  Uncategorized  |   Version:  1.0   
Resolution:  invalid|  Keywords:
 Stage:  Unreviewed | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by dc):

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

Comment:

 Please post usage questions to the django-users list.

 Reopen if you sure that this is a Django bug and you can provide more
 information.

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



[Django] #10983: Won't render jpg image in html file

2009-05-02 Thread Django
#10983: Won't render jpg image in html file
---+
 Reporter:  Mac|   Owner:  nobody
   Status:  new|   Milestone:
Component:  Uncategorized  | Version:  1.0   
 Keywords: |   Stage:  Unreviewed
Has_patch:  0  |  
---+
 When I load an html file with jpg image, it fails to render it. Here's the
 error I receive:

 "GET /sportdata/photos/webgallery/action/images/mens10.jpg HTTP/1.1" 404
 2331

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



Re: [Django] #10982: In the tutorial part 2, when I reached the point were we tried "StackeInLine", there was and error.

2009-05-02 Thread Django
#10982: In the tutorial part 2, when I reached the point were we tried
"StackeInLine", there was and error.
+---
  Reporter:  pc | Owner:  nobody 
Status:  closed | Milestone: 
 Component:  Uncategorized  |   Version:  1.0
Resolution:  invalid|  Keywords:  tutorial, StackedInLine
 Stage:  Unreviewed | Has_patch:  0  
Needs_docs:  0  |   Needs_tests:  0  
Needs_better_patch:  0  |  
+---
Changes (by dc):

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

Comment:

 Inline not In'''L'''ine

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



Re: [Django] #10982: In the tutorial part 2, when I reached the point were we tried "StackeInLine", there was and error.

2009-05-02 Thread Django
#10982: In the tutorial part 2, when I reached the point were we tried
"StackeInLine", there was and error.
+---
  Reporter:  pc | Owner:  nobody 
Status:  new| Milestone: 
 Component:  Uncategorized  |   Version:  1.0
Resolution: |  Keywords:  tutorial, StackedInLine
 Stage:  Unreviewed | Has_patch:  0  
Needs_docs:  0  |   Needs_tests:  0  
Needs_better_patch:  0  |  
+---
Changes (by pc):

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

Comment:

 Ubuntu 8.04
 Using sqlite3
 All was working fine until the "StackedInLine"
 My admin.py:

 from mysite.polls.models import Poll, Choice
 from django.contrib import admin

 class ChoiceInLine(admin.StackedInLine):
 model = Choice
 extra = 3

 class PollAdmin(admin.ModelAdmin):
 #fields = ['pub_date', 'question']
 fieldsets = [
 (None,   {'fields': ['question']}),
 ('Date information', {'fields': ['pub_date'],
   'classes':['collapse']}),
 ]
 inlines = [ChoiceInLine]


 admin.site.register(Poll, PollAdmin)

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



[Django] #10982: In the tutorial part 2, when I reached the point were we tried "StackeInLine", there was and error.

2009-05-02 Thread Django
#10982: In the tutorial part 2, when I reached the point were we tried
"StackeInLine", there was and error.
-+--
 Reporter:  pc   |   Owner:  nobody
   Status:  new  |   Milestone:
Component:  Uncategorized| Version:  1.0   
 Keywords:  tutorial, StackedInLine  |   Stage:  Unreviewed
Has_patch:  0|  
-+--
 AttributeError at /admin/polls/poll/

 'module' object has no attribute 'StackedInLine'

 Request Method: GET
 Request URL:http://localhost:8000/admin/polls/poll/
 Exception Type: AttributeError
 Exception Value:

 'module' object has no attribute 'StackedInLine'

 Exception Location:
 /home/pc/python/django/mysite/../mysite/polls/admin.py in , line 4
 Python Executable:  /usr/bin/python
 Python Version: 2.5.2


 Environment:

 Request Method: GET
 Request URL: http://localhost:8000/admin/polls/poll/
 Django Version: 1.0.2 final
 Python Version: 2.5.2
 Installed Applications:
 ['django.contrib.auth',
  'django.contrib.contenttypes',
  'django.contrib.sessions',
  'django.contrib.sites',
  'django.contrib.admin',
  'mysite.polls']
 Installed Middleware:
 ('django.middleware.common.CommonMiddleware',
  'django.contrib.sessions.middleware.SessionMiddleware',
  'django.contrib.auth.middleware.AuthenticationMiddleware')

 ---

 Traceback:
 File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py" in
 get_response
   77. request.path_info)
 File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py" in
 resolve
   179. for pattern in self.urlconf_module.urlpatterns:
 File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py" in
 _get_urlconf_module
   198. self._urlconf_module = __import__(self.urlconf_name,
 {}, {}, [''])
 File "/home/pc/python/django/mysite/../mysite/urls.py" in 
   5. admin.autodiscover()
 File "/usr/lib/python2.5/site-packages/django/contrib/admin/__init__.py"
 in autodiscover
   40. __import__("%s.admin" % app)
 File "/home/pc/python/django/mysite/../mysite/polls/admin.py" in 
   4. class ChoiceInLine(admin.StackedInLine):

 Exception Type: AttributeError at /admin/polls/poll/
 Exception Value: 'module' object has no attribute 'StackedInLine'

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



Re: [Django] #8968: No way to utilize `next` parameter to redirect after comment deletion

2009-05-02 Thread Django
#8968: No way to utilize `next` parameter to redirect after comment deletion
--+-
  Reporter:  Dzhus| Owner:  kkubasik
Status:  reopened | Milestone:  1.1 
 Component:  django.contrib.comments  |   Version:  1.0 
Resolution:   |  Keywords:  comments
 Stage:  Accepted | Has_patch:  1   
Needs_docs:  1|   Needs_tests:  1   
Needs_better_patch:  1|  
--+-
Changes (by gsong):

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

Comment:

 The latest patch breaks the use case that Jacob cited [#comment:9 above].
 I think we need to decided on the order of precedence here, as there are
 multiple places where `next` could come from: view arg, `GET` param,
 `POST` param. The following feels right to me:

  * `POST`: `POST` param > `GET` param > view arg
  * `GET`: `GET` param > view arg

 If this is the case, we need to test and document 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-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #10980: url tag viewname should be treated as string-or-variable to allow dynamic viewnames

2009-05-02 Thread Django
#10980: url tag viewname should be treated as string-or-variable to allow 
dynamic
viewnames
+---
  Reporter:  jfla...@gmail.com  | Owner:  nobody

Status:  closed | Milestone:

 Component:  Template system|   Version:  1.0   

Resolution:  duplicate  |  Keywords:  url tag, dynamic 
viewnames
 Stage:  Unreviewed | Has_patch:  1 

Needs_docs:  0  |   Needs_tests:  0 

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

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

Comment:

 This is a straight-up duplicate of the above-mentioned tickets.

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



Re: [Django] #10979: FixedOffset.__repr__ is misleading for negative offsets

2009-05-02 Thread Django
#10979: FixedOffset.__repr__ is misleading for negative offsets
-+--
  Reporter:  gsong   | Owner:  gsong 
Status:  assigned| Milestone:
 Component:  Core framework  |   Version:  SVN   
Resolution:  |  Keywords:  tzinfo
 Stage:  Accepted| Has_patch:  1 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Changes (by mtredinnick):

  * needs_docs:  1 => 0

Comment:

 The needs_docs was me being retarded. I was only to set needs_better_patch
 in that column.

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



Re: [Django] #10979: FixedOffset.__repr__ is misleading for negative offsets

2009-05-02 Thread Django
#10979: FixedOffset.__repr__ is misleading for negative offsets
-+--
  Reporter:  gsong   | Owner:  gsong 
Status:  assigned| Milestone:
 Component:  Core framework  |   Version:  SVN   
Resolution:  |  Keywords:  tzinfo
 Stage:  Accepted| Has_patch:  1 
Needs_docs:  1   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Changes (by gsong):

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

Comment:

 Good call on the tests as I caught additional cases. I'm not sure what
 kind of documentation is needed as `needs_docs` is set to 1.

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



Re: [Django] #10981: Notes about using string for relationship target model name slightly unclear

2009-05-02 Thread Django
#10981: Notes about using string for relationship target model name slightly
unclear
+---
  Reporter:  ramiro | Owner:  nobody
Status:  new| Milestone:
 Component:  Documentation  |   Version:  SVN   
Resolution: |  Keywords:
 Stage:  Unreviewed | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by ramiro):

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

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



[Django] #10981: Notes about using string for relationship target model name slightly unclear

2009-05-02 Thread Django
#10981: Notes about using string for relationship target model name slightly
unclear
---+
 Reporter:  ramiro |   Owner:  nobody
   Status:  new|   Milestone:
Component:  Documentation  | Version:  SVN   
 Keywords: |   Stage:  Unreviewed
Has_patch:  0  |  
---+
 The section that describes usage of string of !ForeingKeys (and that is
 linked from the !ManyToManyField and !OneToOneField sections when
 describing similar features) isn't completely clear about if the
 `'other_app.model_name'` notation is supported or not. Attached patch
 tries to solve this and adds a description of the supported scenario with
 an example, also marking it with `'versionchanged:: 1.0'`.

 Found while trying to understand #10405, see django-dev thread:
 http://groups.google.com/group/django-
 
developers/browse_frm/thread/3c38afb3355ecda6/2e533858fd1a64c6?hl=en&tvc=1#2e533858fd1a64c6

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



Re: [Django] #9850: Outdated documentation - (date format strings)

2009-05-02 Thread Django
#9850: Outdated documentation - (date format strings)
-+--
  Reporter:  cezz| Owner:  timo 
 
Status:  assigned| Milestone:   
 
 Component:  Documentation   |   Version:  SVN  
 
Resolution:  |  Keywords:  now format 
strings
 Stage:  Design decision needed  | Has_patch:  1
 
Needs_docs:  0   |   Needs_tests:  0
 
Needs_better_patch:  0   |  
-+--
Comment (by gsong):

 Patch over at #10825 that incorporates changes for this ticket as well,
 since they go hand-in-hand.

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



Re: [Django] #10539: Sphinx error: Could not import extension djangodocs, when running sphinx v0.6b1

2009-05-02 Thread Django
#10539: Sphinx error: Could not import extension djangodocs, when running sphinx
v0.6b1
+---
  Reporter:  waa| Owner:  ramiro
Status:  new| Milestone:
 Component:  Documentation  |   Version:  SVN   
Resolution: |  Keywords:  sphinx 0.6
 Stage:  Accepted   | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Comment (by ramiro):

 See also #10707

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



Re: [Django] #10707: Sphinx & LaTeX: too many nesting section levels for LaTeX

2009-05-02 Thread Django
#10707: Sphinx & LaTeX: too many nesting section levels for LaTeX
+---
  Reporter:  kgrandis   | Owner:  nobody 
Status:  new| Milestone: 
 Component:  Documentation  |   Version:  1.0
Resolution: |  Keywords:  sphinx docs
 Stage:  Unreviewed | Has_patch:  1  
Needs_docs:  0  |   Needs_tests:  0  
Needs_better_patch:  0  |  
+---
Comment (by ramiro):

 Seems like
 [http://bitbucket.org/birkenfeld/sphinx-06/changeset/9ba927d2f18c/ this]
 change in Sphinx would also solve this by automatically converting the
 levels with a depth over the LaTeX limitation to the "subparagraph" style
 instead of raising an exception. It will be included in Sphinx >= 0.6.2

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



Re: [Django] #10825: Template filter date 'U' raises an AttributeError under certain circumstances

2009-05-02 Thread Django
#10825: Template filter date 'U' raises an AttributeError under certain
circumstances
--+-
  Reporter:  mk   | Owner:  gsong
Status:  assigned | Milestone:  1.1  
 Component:  Template system  |   Version:  SVN  
Resolution:   |  Keywords:  template date
 Stage:  Accepted | Has_patch:  1
Needs_docs:  0|   Needs_tests:  0
Needs_better_patch:  0|  
--+-
Changes (by gsong):

  * has_patch:  0 => 1

Comment:

 Provided patch to let Python do its timezone thing, instead of futzing
 with offsets, etc.

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



Re: [Django] #10980: url tag viewname should be treated as string-or-variable to allow dynamic viewnames

2009-05-02 Thread Django
#10980: url tag viewname should be treated as string-or-variable to allow 
dynamic
viewnames
+---
  Reporter:  jfla...@gmail.com  | Owner:  nobody

Status:  new| Milestone:

 Component:  Template system|   Version:  1.0   

Resolution: |  Keywords:  url tag, dynamic 
viewnames
 Stage:  Unreviewed | Has_patch:  1 

Needs_docs:  0  |   Needs_tests:  0 

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

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

Comment:

 See #10745 and #7917.

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



Re: [Django] #10979: FixedOffset.__repr__ is misleading for negative offsets

2009-05-02 Thread Django
#10979: FixedOffset.__repr__ is misleading for negative offsets
-+--
  Reporter:  gsong   | Owner:  nobody
Status:  new | Milestone:
 Component:  Core framework  |   Version:  SVN   
Resolution:  |  Keywords:  tzinfo
 Stage:  Accepted| Has_patch:  1 
Needs_docs:  1   |   Needs_tests:  1 
Needs_better_patch:  0   |  
-+--
Changes (by mtredinnick):

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

Comment:

 You appear to have left off the portion of the patch that changes the
 tests. :-)

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



[Django] #10980: url tag viewname should be treated as string-or-variable to allow dynamic viewnames

2009-05-02 Thread Django
#10980: url tag viewname should be treated as string-or-variable to allow 
dynamic
viewnames
+---
 Reporter:  jfla...@gmail.com   |   Owner:  nobody
   Status:  new |   Milestone:
Component:  Template system | Version:  1.0   
 Keywords:  url tag, dynamic viewnames  |   Stage:  Unreviewed
Has_patch:  1   |  
+---
 I think the url tag should allow dynamic viewnames in the following way
 (dynamic_view_name is a context variable):

 {% url dynamic_view_name args,kwargs=values %}

 This means existing url tags will now be:

 {% url "static_view_name" args,kwargs=values %}

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



[Django] #10979: FixedOffset.__repr__ is misleading for negative offsets

2009-05-02 Thread Django
#10979: FixedOffset.__repr__ is misleading for negative offsets
+---
 Reporter:  gsong   |   Owner:  nobody
   Status:  new |   Milestone:
Component:  Core framework  | Version:  SVN   
 Keywords:  tzinfo  |   Stage:  Unreviewed
Has_patch:  1   |  
+---
 If you pass a negative offset to `FixedOffset`, the tzinfo representation
 is misleading:

 {{{
 >>> from django.utils.tzinfo import FixedOffset
 >>> tz = FixedOffset(-510)
 >>> tz
 -0930
 }}}

 The attached patch simply calculates the hours as a float, which yields
 the more correct representation.

 {{{
 >>> from django.utils.tzinfo import FixedOffset
 >>> tz = FixedOffset(-510)
 >>> tz
 -0830
 }}}

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



[Django] #10978: 1.0 Url Include Documenation

2009-05-02 Thread Django
#10978: 1.0 Url Include Documenation
-+--
 Reporter:  swatermasysk |   Owner:  nobody
   Status:  new  |   Milestone:
Component:  Documentation| Version:  1.0   
 Keywords:  urls, urlpatterns, tutorial  |   Stage:  Unreviewed
Has_patch:  0|  
-+--
 I found the documentation on setting up an include file for urls a little
 confusing for a new django user:
 http://docs.djangoproject.com/en/1.0/intro/tutorial03/#intro-tutorial03

 The part I got tripped up on was code sample:

 (r'^polls/', include('mysite.polls.urls')),

 It was not apparent to me until after I read the docs here
 http://docs.djangoproject.com/en/dev/topics/http/urls/ that the include
 was supposed to be part of the urlpatterns.

 I mistakenly just added the include statement above and was greated with
 the error message, "'module' object has no attribute 'urlpatterns'". It
 could be just me, but I would recommend either expanding the code sample
 to include the urlpatterns or add a note about this potential error
 message.

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



Re: [Django] #9206: Improve documentation on PostgreSQL transactions, exceptions and savepoints

2009-05-02 Thread Django
#9206: Improve documentation on PostgreSQL transactions, exceptions and 
savepoints
---+
  Reporter:  Richard Davies   |
 Owner:  nobody
Status:  reopened  | 
Milestone:  1.1   
 Component:  Documentation |   
Version:  SVN   
Resolution:|  
Keywords:
 Stage:  Accepted  | 
Has_patch:  1 
Needs_docs:  0 |   
Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by Richard Davies ):

  * summary:  Improve documentation on raw SQL queries => Improve
  documentation on PostgreSQL transactions,
  exceptions and savepoints

Comment:

 (aside - I believe the behaviour which my last version fully documents is
 a serious bug in the combination of Django and PostgreSQL. However various
 tickets to resolve it have gone nowhere (#5043, #9205) so we should at
 least clearly document it!)

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



Re: [Django] #9206: Improve documentation on raw SQL queries

2009-05-02 Thread Django
#9206: Improve documentation on raw SQL queries
---+
  Reporter:  Richard Davies   |
 Owner:  nobody
Status:  reopened  | 
Milestone:  1.1   
 Component:  Documentation |   
Version:  SVN   
Resolution:|  
Keywords:
 Stage:  Accepted  | 
Has_patch:  1 
Needs_docs:  0 |   
Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by Richard Davies ):

 OK - here's another version which is rather longer and spells out the
 different behaviours in full, hence answering your comment 2. On
 reflection, I think all of this detail is worth including, as you say.

 On your comment 1, if that use of versionadded does not work then I have
 no idea how to solve my problem! So I have omitted the flag entirely. The
 last bullet point is still Django 1.1 specific, so I guess you should
 either only commit to the Django 1.1 branch, or alternatively also commit
 to the Django 1.0.x branch with that bullet point removed.

 On the issue of separate savepoint documentation, I think you are right
 that there is none. However, I believe that they were specifically
 introduced for exactly this situation [8314], so there's no shame in
 putting the primary documentation here.

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



[Changeset] r10665 - django/trunk/django/contrib/gis/tests

2009-05-02 Thread noreply

Author: jbronn
Date: 2009-05-02 11:17:36 -0500 (Sat, 02 May 2009)
New Revision: 10665

Modified:
   django/trunk/django/contrib/gis/tests/__init__.py
Log:
Removed module-level imports from `django.test` -- this prevented running the 
GEOS, GDAL tests from outside a Django environment (e.g., when there's no 
`settings.py`).


Modified: django/trunk/django/contrib/gis/tests/__init__.py
===
--- django/trunk/django/contrib/gis/tests/__init__.py   2009-05-02 16:04:44 UTC 
(rev 10664)
+++ django/trunk/django/contrib/gis/tests/__init__.py   2009-05-02 16:17:36 UTC 
(rev 10665)
@@ -1,5 +1,4 @@
 import sys, unittest
-from django.test.simple import reorder_suite, TestCase
 from django.utils.importlib import import_module
 
 def geo_suite():
@@ -120,7 +119,7 @@
 from django.conf import settings
 from django.db import connection
 from django.db.models import get_app, get_apps
-from django.test.simple import build_suite, build_test
+from django.test.simple import build_suite, build_test, reorder_suite, 
TestCase
 from django.test.utils import setup_test_environment, 
teardown_test_environment
 
 # The `create_test_spatial_db` routine abstracts away all the steps 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-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



[Changeset] r10664 - django/trunk

2009-05-02 Thread noreply

Author: jbronn
Date: 2009-05-02 11:04:44 -0500 (Sat, 02 May 2009)
New Revision: 10664

Modified:
   django/trunk/MANIFEST.in
Log:
Removed directories that no longer exist from the packaging manifest.


Modified: django/trunk/MANIFEST.in
===
--- django/trunk/MANIFEST.in2009-05-02 15:00:01 UTC (rev 10663)
+++ django/trunk/MANIFEST.in2009-05-02 16:04:44 UTC (rev 10664)
@@ -23,7 +23,4 @@
 recursive-include django/contrib/gis/templates *
 recursive-include django/contrib/gis/tests/data *
 recursive-include django/contrib/gis/tests/geoapp/sql *
-recursive-include django/contrib/gis/tests/layermap/cities *
-recursive-include django/contrib/gis/tests/layermap/counties *
-recursive-include django/contrib/gis/tests/layermap/interstates *
 recursive-include django/contrib/sitemaps/templates *


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



Re: [Django] #9206: Improve documentation on raw SQL queries

2009-05-02 Thread Django
#9206: Improve documentation on raw SQL queries
---+
  Reporter:  Richard Davies   |
 Owner:  nobody
Status:  reopened  | 
Milestone:  1.1   
 Component:  Documentation |   
Version:  SVN   
Resolution:|  
Keywords:
 Stage:  Accepted  | 
Has_patch:  1 
Needs_docs:  0 |   
Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by russellm):

 This is better, but two comments:

  1. The versionadded flag doesn't render - you can't have a versionadded
 in between bullet points like you have used

  2. When discussing savepoints, you present an example. You have tried to
 keep the example simple, which is good - but as a result, it isn't obvious
 to me how savepoints are any different to normal rollbacks. This possibly
 points to a bigger problem - the fact that savepoints aren't documented
 anywhere (as far as I can make out). If there was a good block of
 savepoint documentation, you could just use a link to that documentation.
 If savepoint docs existed, you wouldn't need an example at all - you could
 just link to the relevant section and move on.

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



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

2009-05-02 Thread noreply

Author: russellm
Date: 2009-05-02 10:00:01 -0500 (Sat, 02 May 2009)
New Revision: 10663

Modified:
   django/branches/releases/1.0.X/
Log:
[1.0.X] Updated svnmerge properties for recent changes


Property changes on: django/branches/releases/1.0.X
___
Name: svnmerge-integrated
   - 
/django/trunk:1-9097,9099-9102,9104-9109,9111,9113-9144,9146-9151,9153-9156,9158-9159,9161-9187,9189-9247,9249-9262,9264-9277,9279-9298,9301-9302,9305-9331,9333-9343,9345,9347,9350-9352,9355-9396,9399-9462,9466-9469,9471-9488,9491-9526,9529,9533-9536,9539-9550,9556-9557,9559-9560,9562-9568,9570-9591,9595-9619,9621-9624,9626-9636,9638-9642,9644-9645,9647-9689,9691-9699,9703-9706,9709-9713,9716-9723,9725-9726,9730-9738,9740-9741,9750-9751,9757-9758,9761-9762,9767-9768,9770-9780,9782-9784,9789-9790,9793-9798,9801-9802,9806-9807,9809-9813,9821-9837,9842-9843,9847-9859,9861,9863-9875,9877-9881,9883-9887,9899-9903,9906-9909,9912,9914,9916-9917,9919-9920,9922-9927,9929,9931-9937,9939,9942-9943,9945-9950,9953-9954,9956-9962,9966-9977,9979-9984,9986-9988,9990-10001,10003-10004,10007,10009-10010,10013-10017,10019-10020,10022-10025,10031,10036-10041,10049-10052,10054-10061,10066-10069,10071-10076,10078-10079,10085-10087,10104,10106,10125-10127,10136,10138-10140,10143,10145-10147,10149-10160,10163-10167,10170,10173,10175-10176,10180,10185,10189,10192-10196,10198-10221,10223-10228,10230-10234,10236-10247,10250-10257,10259-10270,10273-10274,10276-10280,10282-10314,10316,10319-10322,10324-10325,10328-10329,10333-10344,10348-10351,10353-10356,10358-10363,10365-10368,10371-10380,10386-10407,10411,10413-10427,10429-10437,10440-10442,10444-10445,10447-10450,10452-10453,10457-10464,10466-10467,10469-10480,10482-10485,10489-10492,10495-10497,10499-10504,10508-10509,10511-10514,10517-10520,10524-10525,10528,10530-10535,10536-10537,10539-10548,10550-10557,10561,10563-10564,10567-10571,10573-10574,10576-10578,10580-10589,10591-10592,10595-10596,10599-10601,10603-10620,10643,10646,10652,10654-10655
   + 
/django/trunk:1-9097,9099-9102,9104-9109,9111,9113-9144,9146-9151,9153-9156,9158-9159,9161-9187,9189-9247,9249-9262,9264-9277,9279-9298,9301-9302,9305-9331,9333-9343,9345,9347,9350-9352,9355-9396,9399-9462,9466-9469,9471-9488,9491-9526,9529,9533-9536,9539-9550,9556-9557,9559-9560,9562-9568,9570-9591,9595-9619,9621-9624,9626-9636,9638-9642,9644-9645,9647-9689,9691-9699,9703-9706,9709-9713,9716-9723,9725-9726,9730-9738,9740-9741,9750-9751,9757-9758,9761-9762,9767-9768,9770-9780,9782-9784,9789-9790,9793-9798,9801-9802,9806-9807,9809-9813,9821-9837,9842-9843,9847-9859,9861,9863-9875,9877-9881,9883-9887,9899-9903,9906-9909,9912,9914,9916-9917,9919-9920,9922-9927,9929,9931-9937,9939,9942-9943,9945-9950,9953-9954,9956-9962,9966-9977,9979-9984,9986-9988,9990-10001,10003-10004,10007,10009-10010,10013-10017,10019-10020,10022-10025,10031,10036-10041,10049-10052,10054-10061,10066-10069,10071-10076,10078-10079,10085-10087,10104,10106,10125-10127,10136,10138-10140,10143,10145-10147,10149-10160,10163-10167,10170,10173,10175-10176,10180,10185,10189,10192-10196,10198-10221,10223-10228,10230-10234,10236-10247,10250-10257,10259-10270,10273-10274,10276-10280,10282-10314,10316,10319-10322,10324-10325,10328-10329,10333-10344,10348-10351,10353-10356,10358-10363,10365-10368,10371-10380,10386-10407,10411,10413-10427,10429-10437,10440-10442,10444-10445,10447-10450,10452-10453,10457-10464,10466-10467,10469-10480,10482-10485,10489-10492,10495-10497,10499-10504,10508-10509,10511-10514,10517-10520,10524-10525,10528,10530-10535,10536-10537,10539-10548,10550-10557,10561,10563-10564,10567-10571,10573-10574,10576-10578,10580-10589,10591-10592,10595-10596,10599-10601,10603-10620,10643,10646,10652,10654-10655,10659-10660


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



[Changeset] r10662 - in django/branches/releases/1.0.X: django/forms tests/regressiontests/forms

2009-05-02 Thread noreply

Author: russellm
Date: 2009-05-02 09:56:35 -0500 (Sat, 02 May 2009)
New Revision: 10662

Modified:
   django/branches/releases/1.0.X/django/forms/fields.py
   django/branches/releases/1.0.X/tests/regressiontests/forms/fields.py
Log:
Fixed #9609 -- Modified the clean method of(Null)Boolean field to accept '1' 
and '0' as valid inputs. Thanks to psagers for the patch.

This is required to support the use of non-default form widgets such as 
RadioSelect when the data comes from MySQL, which uses 1/0 to represent 
booleans.

Merge of r10660 from trunk.

Modified: django/branches/releases/1.0.X/django/forms/fields.py
===
--- django/branches/releases/1.0.X/django/forms/fields.py   2009-05-02 
14:55:50 UTC (rev 10661)
+++ django/branches/releases/1.0.X/django/forms/fields.py   2009-05-02 
14:56:35 UTC (rev 10662)
@@ -585,9 +585,10 @@
 def clean(self, value):
 """Returns a Python boolean object."""
 # Explicitly check for the string 'False', which is what a hidden field
-# will submit for False. Because bool("True") == True, we don't need to
-# handle that explicitly.
-if value == 'False':
+# will submit for False. Also check for '0', since this is what
+# RadioSelect will provide. Because bool("True") == bool('1') == True,
+# we don't need to handle that explicitly.
+if value in ('False', '0'):
 value = False
 else:
 value = bool(value)
@@ -606,13 +607,13 @@
 def clean(self, value):
 """
 Explicitly checks for the string 'True' and 'False', which is what a
-hidden field will submit for True and False. Unlike the
-Booleanfield we also need to check for True, because we are not using
-the bool() function
+hidden field will submit for True and False, and for '1' and '0', which
+is what a RadioField will submit. Unlike the Booleanfield we need to
+explicitly check for True, because we are not using the bool() function
 """
-if value in (True, 'True'):
+if value in (True, 'True', '1'):
 return True
-elif value in (False, 'False'):
+elif value in (False, 'False', '0'):
 return False
 else:
 return None

Modified: django/branches/releases/1.0.X/tests/regressiontests/forms/fields.py
===
--- django/branches/releases/1.0.X/tests/regressiontests/forms/fields.py
2009-05-02 14:55:50 UTC (rev 10661)
+++ django/branches/releases/1.0.X/tests/regressiontests/forms/fields.py
2009-05-02 14:56:35 UTC (rev 10662)
@@ -1077,6 +1077,10 @@
 True
 >>> f.clean(0)
 False
+>>> f.clean('1')
+True
+>>> f.clean('0')
+False
 >>> f.clean('Django rocks')
 True
 
@@ -1201,7 +1205,10 @@
 >>> f.clean(False)
 False
 >>> f.clean(None)
+>>> f.clean('0')
+False
 >>> f.clean('1')
+True
 >>> f.clean('2')
 >>> f.clean('3')
 >>> f.clean('hello')
@@ -1220,6 +1227,21 @@
 >>> f.cleaned_data['hidden_nullbool2']
 False
 
+# Make sure we're compatible with MySQL, which uses 0 and 1 for its boolean
+# values. (#9609)
+>>> NULLBOOL_CHOICES = (('1', 'Yes'), ('0', 'No'), ('', 'Unknown'))
+>>> class MySQLNullBooleanForm(Form):
+... nullbool0 = 
NullBooleanField(widget=RadioSelect(choices=NULLBOOL_CHOICES))
+... nullbool1 = 
NullBooleanField(widget=RadioSelect(choices=NULLBOOL_CHOICES))
+... nullbool2 = 
NullBooleanField(widget=RadioSelect(choices=NULLBOOL_CHOICES))
+>>> f = MySQLNullBooleanForm({ 'nullbool0': '1', 'nullbool1': '0', 
'nullbool2': '' })
+>>> f.full_clean()
+>>> f.cleaned_data['nullbool0']
+True
+>>> f.cleaned_data['nullbool1']
+False
+>>> f.cleaned_data['nullbool2']
+
 # MultipleChoiceField #
 
 >>> f = MultipleChoiceField(choices=[('1', 'One'), ('2', 'Two')])


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



[Changeset] r10661 - django/branches/releases/1.0.X/docs/ref/contrib

2009-05-02 Thread noreply

Author: russellm
Date: 2009-05-02 09:55:50 -0500 (Sat, 02 May 2009)
New Revision: 10661

Modified:
   django/branches/releases/1.0.X/docs/ref/contrib/contenttypes.txt
Log:
[1.0.x] Fixed #10367 -- Corrected an example in the documentation for 
GenericRelation. Thanks to George Song for the patch.

Merge of r10659 from trunk.

Modified: django/branches/releases/1.0.X/docs/ref/contrib/contenttypes.txt
===
--- django/branches/releases/1.0.X/docs/ref/contrib/contenttypes.txt
2009-05-02 14:52:34 UTC (rev 10660)
+++ django/branches/releases/1.0.X/docs/ref/contrib/contenttypes.txt
2009-05-02 14:55:50 UTC (rev 10661)
@@ -313,7 +313,7 @@
 ``object_primary_key`` to create its generic foreign key, then a
 ``GenericRelation`` back to it would need to be defined like so::
 
-tags = generic.GenericRelation('content_type_fk', 'object_primary_key')
+tags = generic.GenericRelation(TaggedItem, 
content_type_field='content_type_fk', object_id_field='object_primary_key')
 
 Of course, if you don't add the reverse relationship, you can do the
 same types of lookups manually::
@@ -324,14 +324,14 @@
 ...   object_id=b.id)
 [, ]
 
-Note that if the model with a 
:class:`~django.contrib.contenttypes.generic.GenericForeignKey` 
-that you're referring to uses a non-default value for ``ct_field`` or 
``fk_field`` 
-(e.g. the :mod:`django.contrib.comments` app uses ``ct_field="object_pk"``), 
+Note that if the model with a 
:class:`~django.contrib.contenttypes.generic.GenericForeignKey`
+that you're referring to uses a non-default value for ``ct_field`` or 
``fk_field``
+(e.g. the :mod:`django.contrib.comments` app uses ``ct_field="object_pk"``),
 you'll need to pass ``content_type_field`` and ``object_id_field`` to
 :class:`~django.contrib.contenttypes.generic.GenericRelation`.::
 
comments = generic.GenericRelation(Comment, 
content_type_field="content_type", object_id_field="object_pk")
-   
+
 Note that if you delete an object that has a
 :class:`~django.contrib.contenttypes.generic.GenericRelation`, any objects
 which have a :class:`~django.contrib.contenttypes.generic.GenericForeignKey`
@@ -342,7 +342,7 @@
 Generic relations in forms and admin
 
 
-:mod:`django.contrib.contenttypes.generic` provides both a 
+:mod:`django.contrib.contenttypes.generic` provides both a
 :class:`~django.contrib.contenttypes.generic.GenericInlineFormSet`
 and :class:`~django.contrib.contenttypes.generic.GenericInlineModelAdmin`.
 This enables the use of generic relations in forms and the admin. See the
@@ -361,8 +361,8 @@
 The name of the
 :class:`~django.contrib.contenttypes.models.ContentType` foreign key
 field on the model. Defaults to ``content_type``.
-
+
 .. attribute:: generic.GenericInlineModelAdmin.ct_fk_field
-
+
 The name of the integer field that represents the ID of the related
 object. Defaults to ``object_id``.


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



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

2009-05-02 Thread noreply

Author: russellm
Date: 2009-05-02 09:52:34 -0500 (Sat, 02 May 2009)
New Revision: 10660

Modified:
   django/trunk/django/forms/fields.py
   django/trunk/tests/regressiontests/forms/fields.py
Log:
Fixed #9609 -- Modified the clean method of(Null)Boolean field to accept '1' 
and '0' as valid inputs. Thanks to psagers for the patch.

This is required to support the use of non-default form widgets such as 
RadioSelect when the data comes from MySQL, which uses 1/0 to represent 
booleans.

Modified: django/trunk/django/forms/fields.py
===
--- django/trunk/django/forms/fields.py 2009-05-02 14:51:54 UTC (rev 10659)
+++ django/trunk/django/forms/fields.py 2009-05-02 14:52:34 UTC (rev 10660)
@@ -586,9 +586,10 @@
 def clean(self, value):
 """Returns a Python boolean object."""
 # Explicitly check for the string 'False', which is what a hidden field
-# will submit for False. Because bool("True") == True, we don't need to
-# handle that explicitly.
-if value == 'False':
+# will submit for False. Also check for '0', since this is what
+# RadioSelect will provide. Because bool("True") == bool('1') == True,
+# we don't need to handle that explicitly.
+if value in ('False', '0'):
 value = False
 else:
 value = bool(value)
@@ -607,13 +608,13 @@
 def clean(self, value):
 """
 Explicitly checks for the string 'True' and 'False', which is what a
-hidden field will submit for True and False. Unlike the
-Booleanfield we also need to check for True, because we are not using
-the bool() function
+hidden field will submit for True and False, and for '1' and '0', which
+is what a RadioField will submit. Unlike the Booleanfield we need to
+explicitly check for True, because we are not using the bool() function
 """
-if value in (True, 'True'):
+if value in (True, 'True', '1'):
 return True
-elif value in (False, 'False'):
+elif value in (False, 'False', '0'):
 return False
 else:
 return None

Modified: django/trunk/tests/regressiontests/forms/fields.py
===
--- django/trunk/tests/regressiontests/forms/fields.py  2009-05-02 14:51:54 UTC 
(rev 10659)
+++ django/trunk/tests/regressiontests/forms/fields.py  2009-05-02 14:52:34 UTC 
(rev 10660)
@@ -1077,6 +1077,10 @@
 True
 >>> f.clean(0)
 False
+>>> f.clean('1')
+True
+>>> f.clean('0')
+False
 >>> f.clean('Django rocks')
 True
 
@@ -1201,7 +1205,10 @@
 >>> f.clean(False)
 False
 >>> f.clean(None)
+>>> f.clean('0')
+False
 >>> f.clean('1')
+True
 >>> f.clean('2')
 >>> f.clean('3')
 >>> f.clean('hello')
@@ -1220,6 +1227,21 @@
 >>> f.cleaned_data['hidden_nullbool2']
 False
 
+# Make sure we're compatible with MySQL, which uses 0 and 1 for its boolean
+# values. (#9609)
+>>> NULLBOOL_CHOICES = (('1', 'Yes'), ('0', 'No'), ('', 'Unknown'))
+>>> class MySQLNullBooleanForm(Form):
+... nullbool0 = 
NullBooleanField(widget=RadioSelect(choices=NULLBOOL_CHOICES))
+... nullbool1 = 
NullBooleanField(widget=RadioSelect(choices=NULLBOOL_CHOICES))
+... nullbool2 = 
NullBooleanField(widget=RadioSelect(choices=NULLBOOL_CHOICES))
+>>> f = MySQLNullBooleanForm({ 'nullbool0': '1', 'nullbool1': '0', 
'nullbool2': '' })
+>>> f.full_clean()
+>>> f.cleaned_data['nullbool0']
+True
+>>> f.cleaned_data['nullbool1']
+False
+>>> f.cleaned_data['nullbool2']
+
 # MultipleChoiceField #
 
 >>> f = MultipleChoiceField(choices=[('1', 'One'), ('2', 'Two')])


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



[Changeset] r10659 - django/trunk/docs/ref/contrib

2009-05-02 Thread noreply

Author: russellm
Date: 2009-05-02 09:51:54 -0500 (Sat, 02 May 2009)
New Revision: 10659

Modified:
   django/trunk/docs/ref/contrib/contenttypes.txt
Log:
Fixed #10367 -- Corrected an example in the documentation for GenericRelation. 
Thanks to George Song for the patch.

Modified: django/trunk/docs/ref/contrib/contenttypes.txt
===
--- django/trunk/docs/ref/contrib/contenttypes.txt  2009-05-02 07:46:37 UTC 
(rev 10658)
+++ django/trunk/docs/ref/contrib/contenttypes.txt  2009-05-02 14:51:54 UTC 
(rev 10659)
@@ -313,7 +313,7 @@
 ``object_primary_key`` to create its generic foreign key, then a
 ``GenericRelation`` back to it would need to be defined like so::
 
-tags = generic.GenericRelation('content_type_fk', 'object_primary_key')
+tags = generic.GenericRelation(TaggedItem, 
content_type_field='content_type_fk', object_id_field='object_primary_key')
 
 Of course, if you don't add the reverse relationship, you can do the
 same types of lookups manually::
@@ -324,14 +324,14 @@
 ...   object_id=b.id)
 [, ]
 
-Note that if the model with a 
:class:`~django.contrib.contenttypes.generic.GenericForeignKey` 
-that you're referring to uses a non-default value for ``ct_field`` or 
``fk_field`` 
-(e.g. the :mod:`django.contrib.comments` app uses ``ct_field="object_pk"``), 
+Note that if the model with a 
:class:`~django.contrib.contenttypes.generic.GenericForeignKey`
+that you're referring to uses a non-default value for ``ct_field`` or 
``fk_field``
+(e.g. the :mod:`django.contrib.comments` app uses ``ct_field="object_pk"``),
 you'll need to pass ``content_type_field`` and ``object_id_field`` to
 :class:`~django.contrib.contenttypes.generic.GenericRelation`.::
 
comments = generic.GenericRelation(Comment, 
content_type_field="content_type", object_id_field="object_pk")
-   
+
 Note that if you delete an object that has a
 :class:`~django.contrib.contenttypes.generic.GenericRelation`, any objects
 which have a :class:`~django.contrib.contenttypes.generic.GenericForeignKey`
@@ -342,7 +342,7 @@
 Generic relations in forms and admin
 
 
-:mod:`django.contrib.contenttypes.generic` provides both a 
+:mod:`django.contrib.contenttypes.generic` provides both a
 :class:`~django.contrib.contenttypes.generic.GenericInlineFormSet`
 and :class:`~django.contrib.contenttypes.generic.GenericInlineModelAdmin`.
 This enables the use of generic relations in forms and the admin. See the
@@ -361,8 +361,8 @@
 The name of the
 :class:`~django.contrib.contenttypes.models.ContentType` foreign key
 field on the model. Defaults to ``content_type``.
-
+
 .. attribute:: generic.GenericInlineModelAdmin.ct_fk_field
-
+
 The name of the integer field that represents the ID of the related
 object. Defaults to ``object_id``.


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



Re: [Django] #9459: forms.DateTimeField() rendered with HiddenInput looses microseconds

2009-05-02 Thread Django
#9459: forms.DateTimeField() rendered with HiddenInput looses microseconds
---+
  Reporter:  guettli   | Owner:  nobody
Status:  new   | Milestone:
 Component:  Forms |   Version:  1.0   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  1 |  
---+
Changes (by russellm):

  * needs_better_patch:  0 => 1
  * milestone:  1.1 =>

Comment:

 The proposed patch is extremely brittle - it only works providing you
 don't use a '.' in the your custom rendering of datetime. If you allow an
 input format of '%Y.%m.%d %H:%M:%S", the code will break hard.

 If you dig into the code, it isn't just HiddenField that is affected by
 this - the default DateTimeField also loses milliseconds. Essentially,
 what is required is a way to parse milliseconds from a string. Python 2.6
 adds %f to strftime/strptime, which will solve this problem - you can then
 allow "%Y-%m-%d %H:%M:%S.%f" as an input format. We may need to port
 strftime and strptime back from Python 2.6. Other options also welcome.

 This problem:
  1. Is Annoying
  2. Has always existed in newforms, and probably in oldforms before that
  3. Only affects a subset of the user community

 Since the required fix will be quite big, and we're already overdue for
 v1.1, I'm going to drop this from the v1.1 roadmap. If someone wants to
 tackle porting strptime and strftime (and this includes resolving any
 licensing issues) and they can get a patch ready quickly, feel free to put
 this back on the v1.1 path.

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



Re: [Django] #9206: Improve documentation on raw SQL queries

2009-05-02 Thread Django
#9206: Improve documentation on raw SQL queries
---+
  Reporter:  Richard Davies   |
 Owner:  nobody
Status:  reopened  | 
Milestone:  1.1   
 Component:  Documentation |   
Version:  SVN   
Resolution:|  
Keywords:
 Stage:  Accepted  | 
Has_patch:  1 
Needs_docs:  0 |   
Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by Richard Davies ):

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

Comment:

 OK - I've worked up another draft, which I think explains it better - my
 point is that savepoints are not necessary for people using the database-
 native autocommit mode.

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



Re: [Django] #8754: PYTHONPATH not passed through to regressiontests/admin_scripts/AdminScriptTestCase.run_test()

2009-05-02 Thread Django
#8754: PYTHONPATH not passed through to
regressiontests/admin_scripts/AdminScriptTestCase.run_test()
---+
  Reporter:  Richard Davies   |
 Owner:  nobody
Status:  new   | 
Milestone:  1.1   
 Component:  Testing framework |   
Version:  SVN   
Resolution:|  
Keywords:
 Stage:  Accepted  | 
Has_patch:  1 
Needs_docs:  0 |   
Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by russellm):

 The reason for removing the full system PYTHONPATH from the test-time
 environment was that it was causing test failures that were very hard to
 diagnose. The closest I can come to documentation of this reasoning is
 [http://code.djangoproject.com/ticket/8047#comment:5 comment 5 of #8047].
 However, it's easy to demonstrate that this is still a problem:
  1. Create a directory that contains a valid settings.py.
  2. Put that directory in your PYTHONPATH.
  3. Apply one of the patches from this ticket.
  4. Run the admin_scripts tests.
  5. Enjoy your brand new 11 failures from 109 tests.
  6. Profit.

 We're kind of stuck between a rock and a hard place here. On the one hand,
 some users (like Richard) will need extra PYTHONPATH settings in order to
 make the admin_script test suite pass; on the other hand, some users (I
 have a vague recollection that either Malcolm or Karen was one of the
 victims here) will accidentally break the test suite by virtue of their
 PYTHONPATH.

 I'm +0 to including this patch on the grounds that documenting the
 required test conditions is a known workaround for those people affected
 by PYTHONPATH-based test failures, but there is no workaround if you
 actually need the extra PYTHONPATH entries. Any other opinions?

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



Re: [Django] #9206: Improve documentation on raw SQL queries

2009-05-02 Thread Django
#9206: Improve documentation on raw SQL queries
---+
  Reporter:  Richard Davies   |
 Owner:  nobody
Status:  closed| 
Milestone:  1.1   
 Component:  Documentation |   
Version:  SVN   
Resolution:  fixed |  
Keywords:
 Stage:  Accepted  | 
Has_patch:  1 
Needs_docs:  0 |   
Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by russellm):

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

Comment:

 Richard: Thanks, but I left that bit out deliberately - I might be missing
 the point, but I didn't really see what that section was adding to the
 discussion. The fact that django uses a pseudo-autocommit mode is covered
 earlier, and isn't Postgres specific. The operation of the database-native
 autocommit mode is discussed in the docs for the Postgres binding (which
 is linked to). To me, the 'missing' paragraph only served to confuse the
 issue of what autocommit meant. This comes back to Malcolm's comment about
 auto-commit confusion.

 I'm fully willing to admit that more documentation may be required - It
 just isn't obvious to me what is missing (or how the paragraph I omitted
 could be turned into the missing piece). If you feel there is some vital
 information that needs to be included, feel free to work up another draft
 for that paragraph and we'll take a look at it.

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



Re: [Django] #10476: Fix(?) model insert handling when autcommit=True for PostgreSQL <= 8.1

2009-05-02 Thread Django
#10476: Fix(?) model insert handling when autcommit=True for PostgreSQL <= 8.1
---+
  Reporter:  mtredinnick   | Owner:  mtredinnick
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 Richard Davies ):

 * cc: richard.dav...@elastichosts.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-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #9206: Improve documentation on raw SQL queries

2009-05-02 Thread Django
#9206: Improve documentation on raw SQL queries
---+
  Reporter:  Richard Davies   |
 Owner:  nobody
Status:  reopened  | 
Milestone:  1.1   
 Component:  Documentation |   
Version:  SVN   
Resolution:|  
Keywords:
 Stage:  Accepted  | 
Has_patch:  1 
Needs_docs:  0 |   
Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by Richard Davies ):

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

Comment:

 Russell - thanks for the check in. One small piece which you missed, so
 I've attached it as "extra.diff" and reopened the ticket. This last bit is
 Django 1.1 specific.

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



Re: [Django] #10797: Set up Trac so post-commit hook sends emails

2009-05-02 Thread Django
#10797: Set up Trac so post-commit hook sends emails
--+-
  Reporter:  carljm   | Owner:  nobody
Status:  new  | Milestone:
 Component:  Django Web site  |   Version:
Resolution:   |  Keywords:
 Stage:  Unreviewed   | Has_patch:  0 
Needs_docs:  0|   Needs_tests:  0 
Needs_better_patch:  0|  
--+-
Changes (by Richard Davies ):

 * cc: richard.dav...@elastichosts.com (added)
  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * needs_docs:  => 0

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



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

2009-05-02 Thread noreply

Author: russellm
Date: 2009-05-02 02:46:37 -0500 (Sat, 02 May 2009)
New Revision: 10658

Modified:
   django/branches/releases/1.0.X/
Log:
[1.0.X] Updated svnmerge properties for recent changes


Property changes on: django/branches/releases/1.0.X
___
Name: svnmerge-integrated
   - 
/django/trunk:1-9097,9099-9102,9104-9109,9111,9113-9144,9146-9151,9153-9156,9158-9159,9161-9187,9189-9247,9249-9262,9264-9277,9279-9298,9301-9302,9305-9331,9333-9343,9345,9347,9350-9352,9355-9396,9399-9462,9466-9469,9471-9488,9491-9526,9529,9533-9536,9539-9550,9556-9557,9559-9560,9562-9568,9570-9591,9595-9619,9621-9624,9626-9636,9638-9642,9644-9645,9647-9689,9691-9699,9703-9706,9709-9713,9716-9723,9725-9726,9730-9738,9740-9741,9750-9751,9757-9758,9761-9762,9767-9768,9770-9780,9782-9784,9789-9790,9793-9798,9801-9802,9806-9807,9809-9813,9821-9837,9842-9843,9847-9859,9861,9863-9875,9877-9881,9883-9887,9899-9903,9906-9909,9912,9914,9916-9917,9919-9920,9922-9927,9929,9931-9937,9939,9942-9943,9945-9950,9953-9954,9956-9962,9966-9977,9979-9984,9986-9988,9990-10001,10003-10004,10007,10009-10010,10013-10017,10019-10020,10022-10025,10031,10036-10041,10049-10052,10054-10061,10066-10069,10071-10076,10078-10079,10085-10087,10104,10106,10125-10127,10136,10138-10140,10143,10145-10147,10149-10160,10163-10167,10170,10173,10175-10176,10180,10185,10189,10192-10196,10198-10221,10223-10228,10230-10234,10236-10247,10250-10257,10259-10270,10273-10274,10276-10280,10282-10314,10316,10319-10322,10324-10325,10328-10329,10333-10344,10348-10351,10353-10356,10358-10363,10365-10368,10371-10380,10386-10407,10411,10413-10427,10429-10437,10440-10442,10444-10445,10447-10450,10452-10453,10457-10464,10466-10467,10469-10480,10482-10485,10489-10492,10495-10497,10499-10504,10508-10509,10511-10514,10517-10520,10524-10525,10528,10530-10535,10536-10537,10539-10548,10550-10557,10561,10563-10564,10567-10571,10573-10574,10576-10578,10580-10589,10591-10592,10595-10596,10599-10601,10603-10620,10643,10646
   + 
/django/trunk:1-9097,9099-9102,9104-9109,9111,9113-9144,9146-9151,9153-9156,9158-9159,9161-9187,9189-9247,9249-9262,9264-9277,9279-9298,9301-9302,9305-9331,9333-9343,9345,9347,9350-9352,9355-9396,9399-9462,9466-9469,9471-9488,9491-9526,9529,9533-9536,9539-9550,9556-9557,9559-9560,9562-9568,9570-9591,9595-9619,9621-9624,9626-9636,9638-9642,9644-9645,9647-9689,9691-9699,9703-9706,9709-9713,9716-9723,9725-9726,9730-9738,9740-9741,9750-9751,9757-9758,9761-9762,9767-9768,9770-9780,9782-9784,9789-9790,9793-9798,9801-9802,9806-9807,9809-9813,9821-9837,9842-9843,9847-9859,9861,9863-9875,9877-9881,9883-9887,9899-9903,9906-9909,9912,9914,9916-9917,9919-9920,9922-9927,9929,9931-9937,9939,9942-9943,9945-9950,9953-9954,9956-9962,9966-9977,9979-9984,9986-9988,9990-10001,10003-10004,10007,10009-10010,10013-10017,10019-10020,10022-10025,10031,10036-10041,10049-10052,10054-10061,10066-10069,10071-10076,10078-10079,10085-10087,10104,10106,10125-10127,10136,10138-10140,10143,10145-10147,10149-10160,10163-10167,10170,10173,10175-10176,10180,10185,10189,10192-10196,10198-10221,10223-10228,10230-10234,10236-10247,10250-10257,10259-10270,10273-10274,10276-10280,10282-10314,10316,10319-10322,10324-10325,10328-10329,10333-10344,10348-10351,10353-10356,10358-10363,10365-10368,10371-10380,10386-10407,10411,10413-10427,10429-10437,10440-10442,10444-10445,10447-10450,10452-10453,10457-10464,10466-10467,10469-10480,10482-10485,10489-10492,10495-10497,10499-10504,10508-10509,10511-10514,10517-10520,10524-10525,10528,10530-10535,10536-10537,10539-10548,10550-10557,10561,10563-10564,10567-10571,10573-10574,10576-10578,10580-10589,10591-10592,10595-10596,10599-10601,10603-10620,10643,10646,10652,10654-10655


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



[Changeset] r10657 - django/branches/releases/1.0.X/docs/topics/db

2009-05-02 Thread noreply

Author: russellm
Date: 2009-05-02 02:44:39 -0500 (Sat, 02 May 2009)
New Revision: 10657

Modified:
   django/branches/releases/1.0.X/docs/topics/db/models.txt
   django/branches/releases/1.0.X/docs/topics/db/sql.txt
   django/branches/releases/1.0.X/docs/topics/db/transactions.txt
Log:
[1.0.X] Fixed #9206 -- Clarified documentation of transaction handling in raw 
SQL, and error recovery for Postgres. Thanks to Richard Davies for the 
suggestion and draft text.

Merge of r10655 from trunk.

Modified: django/branches/releases/1.0.X/docs/topics/db/models.txt
===
--- django/branches/releases/1.0.X/docs/topics/db/models.txt2009-05-02 
07:43:55 UTC (rev 10656)
+++ django/branches/releases/1.0.X/docs/topics/db/models.txt2009-05-02 
07:44:39 UTC (rev 10657)
@@ -171,15 +171,15 @@
 (u'SR', u'Senior'),
 (u'GR', u'Graduate'),
 )
-
+
 The first element in each tuple is the value that will be stored in the
 database, the second element will be displayed by the admin interface,
 or in a ModelChoiceField. Given an instance of a model object, the
 display value for a choices field can be accessed using the
 ``get_FOO_display`` method. For example::
-
+
 from django.db import models
-
+
 class Person(models.Model):
 GENDER_CHOICES = (
 (u'M', u'Male'),
@@ -187,9 +187,9 @@
 )
 name = models.CharField(max_length=60)
 gender = models.CharField(max_length=2, choices=GENDER_CHOICES)
-
+
 ::
-
+
 >>> p = Person(name="Fred Flinstone", gender="M")
 >>> p.save()
 >>> p.gender
@@ -752,38 +752,9 @@
 
 
 Another common pattern is writing custom SQL statements in model methods and
-module-level methods. The object :class:`django.db.connection
-` represents the current database
-connection. To use it, call :meth:`connection.cursor()
-` to get a cursor object. Then, call
-``cursor.execute(sql, [params])`` to execute the SQL and
-:meth:`cursor.fetchone() ` or
-:meth:`cursor.fetchall() ` to return
-the resulting rows. For example::
+module-level methods. For more details on using raw SQL, see the documentation
+on :ref:`using raw SQL`.
 
-def my_custom_sql(self):
-from django.db import connection
-cursor = connection.cursor()
-cursor.execute("SELECT foo FROM bar WHERE baz = %s", [self.baz])
-row = cursor.fetchone()
-return row
-
-:class:`connection ` and :class:`cursor
-` mostly implement the standard Python
-DB-API -- see :pep:`249` -- with the addition of Django's :ref:`transaction
-handling `. If you're not familiar with the Python
-DB-API, note that the SQL statement in :meth:`cursor.execute()
-` uses placeholders, ``"%s"``, rather
-than adding parameters directly within the SQL. If you use this technique, the
-underlying database library will automatically add quotes and escaping to your
-parameter(s) as necessary. (Also note that Django expects the ``"%s"``
-placeholder, *not* the ``"?"`` placeholder, which is used by the SQLite Python
-bindings. This is for the sake of consistency and sanity.)
-
-A final note: If all you want to do is a custom ``WHERE`` clause, you can use
-the :meth:`~QuerySet.extra` lookup method, which lets you add custom SQL to a
-query.
-
 .. _model-inheritance:
 
 Model inheritance

Modified: django/branches/releases/1.0.X/docs/topics/db/sql.txt
===
--- django/branches/releases/1.0.X/docs/topics/db/sql.txt   2009-05-02 
07:43:55 UTC (rev 10656)
+++ django/branches/releases/1.0.X/docs/topics/db/sql.txt   2009-05-02 
07:44:39 UTC (rev 10657)
@@ -5,16 +5,28 @@
 
 Feel free to write custom SQL statements in custom model methods and
 module-level methods. The object ``django.db.connection`` represents the
-current database connection. To use it, call ``connection.cursor()`` to get a
-cursor object. Then, call ``cursor.execute(sql, [params])`` to execute the SQL
-and ``cursor.fetchone()`` or ``cursor.fetchall()`` to return the resulting
-rows. Example::
+current database connection, and ``django.db.transaction`` represents the
+current database transaction. To use the database connection, call
+``connection.cursor()`` to get a cursor object. Then, call
+``cursor.execute(sql, [params])`` to execute the SQL and ``cursor.fetchone()``
+or ``cursor.fetchall()`` to return the resulting rows. After performing a data
+changing operation, you should then call
+``transaction.commit_unless_managed()`` to ensure your changes are committed
+to the database. If your query is purely a data retrieval operation, no commit
+is required. For example::
 
 def my_custom_sql(self):
-from django.db import connection
+from django.db import c

[Changeset] r10656 - django/branches/releases/1.0.X/docs/topics

2009-05-02 Thread noreply

Author: russellm
Date: 2009-05-02 02:43:55 -0500 (Sat, 02 May 2009)
New Revision: 10656

Modified:
   django/branches/releases/1.0.X/docs/topics/serialization.txt
Log:
[1.0.X] Fixed #10954 -- Corrected error in docs example describing extending 
the JSON serializer. Thanks to Glenn for the report.

Merge of r10654 from trunk.

Modified: django/branches/releases/1.0.X/docs/topics/serialization.txt
===
--- django/branches/releases/1.0.X/docs/topics/serialization.txt
2009-05-02 07:40:25 UTC (rev 10655)
+++ django/branches/releases/1.0.X/docs/topics/serialization.txt
2009-05-02 07:43:55 UTC (rev 10656)
@@ -181,6 +181,6 @@
 def default(self, obj):
 if isinstance(obj, Promise):
 return force_unicode(obj)
-return obj
+return super(LazyEncoder, self).default(obj)
 
 .. _special encoder: 
http://svn.red-bean.com/bob/simplejson/tags/simplejson-1.7/docs/index.html


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



[Changeset] r10655 - django/trunk/docs/topics/db

2009-05-02 Thread noreply

Author: russellm
Date: 2009-05-02 02:40:25 -0500 (Sat, 02 May 2009)
New Revision: 10655

Modified:
   django/trunk/docs/topics/db/models.txt
   django/trunk/docs/topics/db/sql.txt
   django/trunk/docs/topics/db/transactions.txt
Log:
Fixed #9206 -- Clarified documentation of transaction handling in raw SQL, and 
error recovery for Postgres. Thanks to Richard Davies for the suggestion and 
draft text.

Modified: django/trunk/docs/topics/db/models.txt
===
--- django/trunk/docs/topics/db/models.txt  2009-05-02 07:39:45 UTC (rev 
10654)
+++ django/trunk/docs/topics/db/models.txt  2009-05-02 07:40:25 UTC (rev 
10655)
@@ -171,15 +171,15 @@
 (u'SR', u'Senior'),
 (u'GR', u'Graduate'),
 )
-
+
 The first element in each tuple is the value that will be stored in the
 database, the second element will be displayed by the admin interface,
 or in a ModelChoiceField. Given an instance of a model object, the
 display value for a choices field can be accessed using the
 ``get_FOO_display`` method. For example::
-
+
 from django.db import models
-
+
 class Person(models.Model):
 GENDER_CHOICES = (
 (u'M', u'Male'),
@@ -187,9 +187,9 @@
 )
 name = models.CharField(max_length=60)
 gender = models.CharField(max_length=2, choices=GENDER_CHOICES)
-
+
 ::
-
+
 >>> p = Person(name="Fred Flinstone", gender="M")
 >>> p.save()
 >>> p.gender
@@ -752,38 +752,9 @@
 
 
 Another common pattern is writing custom SQL statements in model methods and
-module-level methods. The object :class:`django.db.connection
-` represents the current database
-connection. To use it, call :meth:`connection.cursor()
-` to get a cursor object. Then, call
-``cursor.execute(sql, [params])`` to execute the SQL and
-:meth:`cursor.fetchone() ` or
-:meth:`cursor.fetchall() ` to return
-the resulting rows. For example::
+module-level methods. For more details on using raw SQL, see the documentation
+on :ref:`using raw SQL`.
 
-def my_custom_sql(self):
-from django.db import connection
-cursor = connection.cursor()
-cursor.execute("SELECT foo FROM bar WHERE baz = %s", [self.baz])
-row = cursor.fetchone()
-return row
-
-:class:`connection ` and :class:`cursor
-` mostly implement the standard Python
-DB-API -- see :pep:`249` -- with the addition of Django's :ref:`transaction
-handling `. If you're not familiar with the Python
-DB-API, note that the SQL statement in :meth:`cursor.execute()
-` uses placeholders, ``"%s"``, rather
-than adding parameters directly within the SQL. If you use this technique, the
-underlying database library will automatically add quotes and escaping to your
-parameter(s) as necessary. (Also note that Django expects the ``"%s"``
-placeholder, *not* the ``"?"`` placeholder, which is used by the SQLite Python
-bindings. This is for the sake of consistency and sanity.)
-
-A final note: If all you want to do is a custom ``WHERE`` clause, you can use
-the :meth:`~QuerySet.extra` lookup method, which lets you add custom SQL to a
-query.
-
 .. _model-inheritance:
 
 Model inheritance

Modified: django/trunk/docs/topics/db/sql.txt
===
--- django/trunk/docs/topics/db/sql.txt 2009-05-02 07:39:45 UTC (rev 10654)
+++ django/trunk/docs/topics/db/sql.txt 2009-05-02 07:40:25 UTC (rev 10655)
@@ -5,16 +5,28 @@
 
 Feel free to write custom SQL statements in custom model methods and
 module-level methods. The object ``django.db.connection`` represents the
-current database connection. To use it, call ``connection.cursor()`` to get a
-cursor object. Then, call ``cursor.execute(sql, [params])`` to execute the SQL
-and ``cursor.fetchone()`` or ``cursor.fetchall()`` to return the resulting
-rows. Example::
+current database connection, and ``django.db.transaction`` represents the
+current database transaction. To use the database connection, call
+``connection.cursor()`` to get a cursor object. Then, call
+``cursor.execute(sql, [params])`` to execute the SQL and ``cursor.fetchone()``
+or ``cursor.fetchall()`` to return the resulting rows. After performing a data
+changing operation, you should then call
+``transaction.commit_unless_managed()`` to ensure your changes are committed
+to the database. If your query is purely a data retrieval operation, no commit
+is required. For example::
 
 def my_custom_sql(self):
-from django.db import connection
+from django.db import connection, transaction
 cursor = connection.cursor()
+
+# Data modifying operation - commit required
+cursor.execute("UPDATE bar SET foo = 1 WHERE baz = %s", [self.baz])
+transa

[Changeset] r10654 - django/trunk/docs/topics

2009-05-02 Thread noreply

Author: russellm
Date: 2009-05-02 02:39:45 -0500 (Sat, 02 May 2009)
New Revision: 10654

Modified:
   django/trunk/docs/topics/serialization.txt
Log:
Fixed #10954 -- Corrected error in docs example describing extending the JSON 
serializer. Thanks to Glenn for the report.

Modified: django/trunk/docs/topics/serialization.txt
===
--- django/trunk/docs/topics/serialization.txt  2009-05-02 07:16:30 UTC (rev 
10653)
+++ django/trunk/docs/topics/serialization.txt  2009-05-02 07:39:45 UTC (rev 
10654)
@@ -187,7 +187,7 @@
 def default(self, obj):
 if isinstance(obj, Promise):
 return force_unicode(obj)
-return obj
+return super(LazyEncoder, self).default(obj)
 
 .. _special encoder: 
http://svn.red-bean.com/bob/simplejson/tags/simplejson-1.7/docs/index.html
 


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



[Changeset] r10653 - in django/branches/releases/1.0.X: django/db/models/fields tests/modeltests/model_forms tests/regressiontests/forms tests/regressiontests/model_forms_regress

2009-05-02 Thread noreply

Author: russellm
Date: 2009-05-02 02:16:30 -0500 (Sat, 02 May 2009)
New Revision: 10653

Modified:
   django/branches/releases/1.0.X/django/db/models/fields/related.py
   django/branches/releases/1.0.X/tests/modeltests/model_forms/models.py
   django/branches/releases/1.0.X/tests/regressiontests/forms/forms.py
   
django/branches/releases/1.0.X/tests/regressiontests/model_forms_regress/models.py
   
django/branches/releases/1.0.X/tests/regressiontests/model_forms_regress/tests.py
Log:
[1.0.X] Fixed #10349 -- Modified ManyToManyFields to allow initial form values 
to be callables. Thanks to fas for the report and patch.

Merge of r10652 from trunk.

Modified: django/branches/releases/1.0.X/django/db/models/fields/related.py
===
--- django/branches/releases/1.0.X/django/db/models/fields/related.py   
2009-05-02 07:03:33 UTC (rev 10652)
+++ django/branches/releases/1.0.X/django/db/models/fields/related.py   
2009-05-02 07:16:30 UTC (rev 10653)
@@ -943,7 +943,10 @@
 # If initial is passed in, it's a list of related objects, but the
 # MultipleChoiceField takes a list of IDs.
 if defaults.get('initial') is not None:
-defaults['initial'] = [i._get_pk_val() for i in 
defaults['initial']]
+initial = defaults['initial']
+if callable(initial):
+initial = initial()
+defaults['initial'] = [i._get_pk_val() for i in initial]
 return super(ManyToManyField, self).formfield(**defaults)
 
 def db_type(self):

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   
2009-05-02 07:03:33 UTC (rev 10652)
+++ django/branches/releases/1.0.X/tests/modeltests/model_forms/models.py   
2009-05-02 07:16:30 UTC (rev 10653)
@@ -569,6 +569,30 @@
 Third test
   Hold down "Control", or "Command" on a Mac, to select more than 
one.
 
+Initial values can be provided for model forms
+>>> f = TestArticleForm(auto_id=False, initial={'headline': 'Your headline 
here', 'categories': ['1','2']})
+>>> print f.as_ul()
+Headline: 
+Slug: 
+Pub date: 
+Writer: 
+-
+Mike Royko
+Bob Woodward
+
+Article: 
+Status: 
+-
+Draft
+Pending
+Live
+
+Categories: 
+Entertainment
+It's a test
+Third test
+  Hold down "Control", or "Command" on a Mac, to select more than 
one.
+
 >>> f = TestArticleForm({'headline': u'New headline', 'slug': u'new-headline', 
 >>> 'pub_date': u'1988-01-04',
 ... 'writer': u'1', 'article': u'Hello.', 'categories': [u'1', u'2']}, 
instance=new_art)
 >>> new_art = f.save()

Modified: django/branches/releases/1.0.X/tests/regressiontests/forms/forms.py
===
--- django/branches/releases/1.0.X/tests/regressiontests/forms/forms.py 
2009-05-02 07:03:33 UTC (rev 10652)
+++ django/branches/releases/1.0.X/tests/regressiontests/forms/forms.py 
2009-05-02 07:16:30 UTC (rev 10653)
@@ -1146,37 +1146,63 @@
 >>> class UserRegistration(Form):
 ...username = CharField(max_length=10)
 ...password = CharField(widget=PasswordInput)
+...options = 
MultipleChoiceField(choices=[('f','foo'),('b','bar'),('w','whiz')])
 
 We need to define functions that get called later.
 >>> def initial_django():
 ... return 'django'
 >>> def initial_stephane():
 ... return 'stephane'
+>>> def initial_options():
+... return ['f','b']
+>>> def initial_other_options():
+... return ['b','w']
 
+
 Here, we're not submitting any data, so the initial value will be displayed.
->>> p = UserRegistration(initial={'username': initial_django}, auto_id=False)
+>>> p = UserRegistration(initial={'username': initial_django, 'options': 
initial_options}, auto_id=False)
 >>> print p.as_ul()
 Username: 
 Password: 
+Options: 
+foo
+bar
+whiz
+
 
 The 'initial' parameter is meaningless if you pass data.
->>> p = UserRegistration({}, initial={'username': initial_django}, 
auto_id=False)
+>>> p = UserRegistration({}, initial={'username': initial_django, 'options': 
initial_options}, auto_id=False)
 >>> print p.as_ul()
 This field is required.Username: 

 This field is required.Password: 

+This field is required.Options: 

+foo
+bar
+whiz
+
 >>> p = UserRegistration({'username': u''}, initial={'username': 
 >>> initial_django}, auto_id=False)
 >>> print p.as_ul()
 This field is required.Username: 

 This field is required.Password: 

->>> p = UserRegistration({'username': u'foo'}, initial={'username': 
initial_django}, auto_id=False)
+This field is required.Options: 

+foo
+bar
+whiz
+
+>>> p = UserRegistration({'username': u'foo', 'options':['f','b']}, 
initial={'username': initial_django}, auto_id=False)
 >>> print p.as_ul()
 Username: 
 This field is required.Password: 

+Options: 
+foo
+bar
+whiz
+
 
 A callable 'initial' value is *not* used as a fal

[Changeset] r10652 - in django/trunk: django/db/models/fields tests/modeltests/model_forms tests/regressiontests/forms tests/regressiontests/model_forms_regress

2009-05-02 Thread noreply

Author: russellm
Date: 2009-05-02 02:03:33 -0500 (Sat, 02 May 2009)
New Revision: 10652

Modified:
   django/trunk/django/db/models/fields/related.py
   django/trunk/tests/modeltests/model_forms/models.py
   django/trunk/tests/regressiontests/forms/forms.py
   django/trunk/tests/regressiontests/model_forms_regress/models.py
   django/trunk/tests/regressiontests/model_forms_regress/tests.py
Log:
Fixed #10349 -- Modified ManyToManyFields to allow initial form values to be 
callables. Thanks to fas for the report and patch.

Modified: django/trunk/django/db/models/fields/related.py
===
--- django/trunk/django/db/models/fields/related.py 2009-05-01 22:03:14 UTC 
(rev 10651)
+++ django/trunk/django/db/models/fields/related.py 2009-05-02 07:03:33 UTC 
(rev 10652)
@@ -948,7 +948,10 @@
 # If initial is passed in, it's a list of related objects, but the
 # MultipleChoiceField takes a list of IDs.
 if defaults.get('initial') is not None:
-defaults['initial'] = [i._get_pk_val() for i in 
defaults['initial']]
+initial = defaults['initial']
+if callable(initial):
+initial = initial()
+defaults['initial'] = [i._get_pk_val() for i in initial]
 return super(ManyToManyField, self).formfield(**defaults)
 
 def db_type(self):

Modified: django/trunk/tests/modeltests/model_forms/models.py
===
--- django/trunk/tests/modeltests/model_forms/models.py 2009-05-01 22:03:14 UTC 
(rev 10651)
+++ django/trunk/tests/modeltests/model_forms/models.py 2009-05-02 07:03:33 UTC 
(rev 10652)
@@ -613,6 +613,30 @@
 Third test
   Hold down "Control", or "Command" on a Mac, to select more than 
one.
 
+Initial values can be provided for model forms
+>>> f = TestArticleForm(auto_id=False, initial={'headline': 'Your headline 
here', 'categories': ['1','2']})
+>>> print f.as_ul()
+Headline: 
+Slug: 
+Pub date: 
+Writer: 
+-
+Mike Royko
+Bob Woodward
+
+Article: 
+Status: 
+-
+Draft
+Pending
+Live
+
+Categories: 
+Entertainment
+It's a test
+Third test
+  Hold down "Control", or "Command" on a Mac, to select more than 
one.
+
 >>> f = TestArticleForm({'headline': u'New headline', 'slug': u'new-headline', 
 >>> 'pub_date': u'1988-01-04',
 ... 'writer': u'1', 'article': u'Hello.', 'categories': [u'1', u'2']}, 
instance=new_art)
 >>> new_art = f.save()

Modified: django/trunk/tests/regressiontests/forms/forms.py
===
--- django/trunk/tests/regressiontests/forms/forms.py   2009-05-01 22:03:14 UTC 
(rev 10651)
+++ django/trunk/tests/regressiontests/forms/forms.py   2009-05-02 07:03:33 UTC 
(rev 10652)
@@ -1146,37 +1146,63 @@
 >>> class UserRegistration(Form):
 ...username = CharField(max_length=10)
 ...password = CharField(widget=PasswordInput)
+...options = 
MultipleChoiceField(choices=[('f','foo'),('b','bar'),('w','whiz')])
 
 We need to define functions that get called later.
 >>> def initial_django():
 ... return 'django'
 >>> def initial_stephane():
 ... return 'stephane'
+>>> def initial_options():
+... return ['f','b']
+>>> def initial_other_options():
+... return ['b','w']
 
+
 Here, we're not submitting any data, so the initial value will be displayed.
->>> p = UserRegistration(initial={'username': initial_django}, auto_id=False)
+>>> p = UserRegistration(initial={'username': initial_django, 'options': 
initial_options}, auto_id=False)
 >>> print p.as_ul()
 Username: 
 Password: 
+Options: 
+foo
+bar
+whiz
+
 
 The 'initial' parameter is meaningless if you pass data.
->>> p = UserRegistration({}, initial={'username': initial_django}, 
auto_id=False)
+>>> p = UserRegistration({}, initial={'username': initial_django, 'options': 
initial_options}, auto_id=False)
 >>> print p.as_ul()
 This field is required.Username: 

 This field is required.Password: 

+This field is required.Options: 

+foo
+bar
+whiz
+
 >>> p = UserRegistration({'username': u''}, initial={'username': 
 >>> initial_django}, auto_id=False)
 >>> print p.as_ul()
 This field is required.Username: 

 This field is required.Password: 

->>> p = UserRegistration({'username': u'foo'}, initial={'username': 
initial_django}, auto_id=False)
+This field is required.Options: 

+foo
+bar
+whiz
+
+>>> p = UserRegistration({'username': u'foo', 'options':['f','b']}, 
initial={'username': initial_django}, auto_id=False)
 >>> print p.as_ul()
 Username: 
 This field is required.Password: 

+Options: 
+foo
+bar
+whiz
+
 
 A callable 'initial' value is *not* used as a fallback if data is not provided.
 In this example, we don't provide a value for 'username', and the form raises a
 validation error rather than using the initial value for 'username'.
->>> p = UserRegistration({'password': 'secret'}, initial={'username': 
initial_django})
+>>> p = UserRegistratio