Re: [Django] #11735: Wrong documentation for changing Model formsets queryset

2009-10-17 Thread Django
#11735: Wrong documentation for changing Model formsets queryset
+---
  Reporter:  claudep| Owner:  nobody
Status:  new| Milestone:
 Component:  Documentation  |   Version:  1.1   
Resolution: |  Keywords:
 Stage:  Ready for checkin  | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by timo):

  * needs_better_patch:  => 0
  * has_patch:  0 => 1
  * stage:  Unreviewed => Ready for checkin
  * needs_tests:  => 0
  * needs_docs:  => 0

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-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] #11735: Wrong documentation for changing Model formsets queryset

2009-08-18 Thread Django
#11735: Wrong documentation for changing Model formsets queryset
---+
 Reporter:  claudep|   Owner:  nobody
   Status:  new|   Milestone:
Component:  Documentation  | Version:  1.1   
 Keywords: |   Stage:  Unreviewed
Has_patch:  0  |  
---+
 In the documentation, we can read that a Model Formset queryset can be
 changed with the following code:
 {{{
 class BaseAuthorFormSet(BaseModelFormSet):
 def __init__(self, *args, **kwargs):
 self.queryset = Author.objects.filter(name__startswith='O')
 super(BaseAuthorFormSet, self).__init__(*args, **kwargs)
 }}}
 See http://docs.djangoproject.com/en/dev/topics/forms/modelforms
 /#changing-the-queryset

 This doesn't work. The problem is that in the {{{__init__}}} function of
 BaseModelFormSet, the queryset is redefined from the queryset parameter
 which default to None.
 See
 http://code.djangoproject.com/browser/django/trunk/django/forms/models.py#L448

 To make it work, the queryset should be added to the {{{__init__}}} call
 as a keyword parameter. Or it might also be a bug in the {{{__init__}}}
 function where it should test if self.queryset is not None before
 assigning to it. Either in docs, either in code, I think there is
 something to solve.

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