Re: [Django] #14880: raw_id_fields in admin does not work when limit_choices_to dictionary has value=False

2011-01-21 Thread Django
#14880: raw_id_fields in admin does not work when limit_choices_to dictionary 
has
value=False
---+
  Reporter:  smallm...@gmail.com   | Owner:  lukeplant
Status:  assigned  | Milestone:   
 Component:  django.contrib.admin  |   Version:  1.2  
Resolution:|  Keywords:   
 Stage:  Accepted  | Has_patch:  0
Needs_docs:  0 |   Needs_tests:  0
Needs_better_patch:  0 |  
---+
Changes (by lukeplant):

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

Comment:

 I will look at this, as it is related to the fix in #15103

-- 
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] #14880: raw_id_fields in admin does not work when limit_choices_to dictionary has value=False

2011-01-13 Thread Django
#14880: raw_id_fields in admin does not work when limit_choices_to dictionary 
has
value=False
---+
  Reporter:  smallm...@gmail.com   | Owner:  nobody
Status:  new   | Milestone:
 Component:  django.contrib.admin  |   Version:  1.2   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by lukeplant):

  * keywords:  blocker, regression =>
  * milestone:  1.3 =>

Comment:

 OK, so this isn't a regression, we can remove the blocker/regression
 keywords. It would still be nice to be fixed for 1.3, but we don't have
 to.

 For those looking to fix it, there are probably two routes:

  1. Change the generated query string to use '0' instead of 'False', since
 '0' does work.
  2. Fix the code that reads the query string to treat 'False' as boolean
 `False` (but obviously only for boolean fields).

 I have no idea at the moment which is the 'right' way to fix it, one of
 them is likely to be cleaner that the other.

-- 
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] #14880: raw_id_fields in admin does not work when limit_choices_to dictionary has value=False

2011-01-13 Thread Django
#14880: raw_id_fields in admin does not work when limit_choices_to dictionary 
has
value=False
---+
  Reporter:  smallm...@gmail.com   | Owner:  nobody 
Status:  new   | Milestone:  1.3
 Component:  django.contrib.admin  |   Version:  1.2
Resolution:|  Keywords:  blocker, regression
 Stage:  Accepted  | Has_patch:  0  
Needs_docs:  0 |   Needs_tests:  0  
Needs_better_patch:  0 |  
---+
Comment (by ramiro):

 The !SuspiciousOperation error you see in 1.2.4 is because of a problem in
 the security fix that triggered its release, it was fixed in r15140 and it
 is also already fixed in trunk. We can ignore the noise introduced by
 that.

 Regarding he original report of this ticket, I can trace back this problem
 showing itself as far as Django 1.1 (and even 1.0, but there bugs like
 #9561 introduce additional noise)(tested with sqlite3).

 In such environment, clicking in the magnifying glass icon opens a popup
 where only the overseas publisher is shown. Later, when trying to save the
 PublishedBook instance, validation rejects it so it seems there the filter
 `overseas=False` filter/validation is working in that stage.

-- 
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] #14880: raw_id_fields in admin does not work when limit_choices_to dictionary has value=False

2011-01-13 Thread Django
#14880: raw_id_fields in admin does not work when limit_choices_to dictionary 
has
value=False
---+
  Reporter:  smallm...@gmail.com   | Owner:  nobody 
Status:  new   | Milestone:  1.3
 Component:  django.contrib.admin  |   Version:  1.2
Resolution:|  Keywords:  blocker, regression
 Stage:  Accepted  | Has_patch:  0  
Needs_docs:  0 |   Needs_tests:  0  
Needs_better_patch:  0 |  
---+
Comment (by smallming):

 I will like to add a line to admin.py in the initial bug report so it
 properly reflects the bug and "skip" `SuspiciousOperation` exception.
 Reason below.
 [[BR]]


 {{{
 class PublisherAdmin(admin.ModelAdmin):
 list_display = ['name', 'overseas']
 list_filter = ['overseas'] # Added for illustration
 }}}


 I was tracing the bug using 1.2.4, and found that the
 `SuspiciousOperation` is due to the lack of corresponding
 `ModelAdmin.list_filter` specified. Adding `list_filter = ['overseas']` to
 `PublisherAdmin` will lead to the original bug reported (at least in
 1.2.4).

 Perhaps a separate bug can be filed under "raw_id_fields in admin raise
 `SuspiciousOperation` when `limit_choices_to` is used without
 corresponding `ModelAdmin.list_filter`".

-- 
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] #14880: raw_id_fields in admin does not work when limit_choices_to dictionary has value=False

2011-01-12 Thread Django
#14880: raw_id_fields in admin does not work when limit_choices_to dictionary 
has
value=False
---+
  Reporter:  smallm...@gmail.com   | Owner:  nobody 
Status:  new   | Milestone:  1.3
 Component:  django.contrib.admin  |   Version:  1.2
Resolution:|  Keywords:  blocker, regression
 Stage:  Accepted  | Has_patch:  0  
Needs_docs:  0 |   Needs_tests:  0  
Needs_better_patch:  0 |  
---+
Comment (by lukeplant):

 I don't think this was ever working. I have tried with a real life
 project, and with tests, and I get failure on 1.2.3.  On 1.2.4 I get the
 suspicious operation thing. The original reporter was using 1.2.1
 apparently, so this doesn't look like a regression.

 I will attach patches for the tests - against 1.2.3, 1.2.4, most recent
 1.2.X and most recent trunk, all slightly different.

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

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



Re: [Django] #14880: raw_id_fields in admin does not work when limit_choices_to dictionary has value=False

2011-01-05 Thread Django
#14880: raw_id_fields in admin does not work when limit_choices_to dictionary 
has
value=False
---+
  Reporter:  smallm...@gmail.com   | Owner:  nobody 
Status:  new   | Milestone:  1.3
 Component:  django.contrib.admin  |   Version:  1.2
Resolution:|  Keywords:  blocker, regression
 Stage:  Accepted  | Has_patch:  0  
Needs_docs:  0 |   Needs_tests:  0  
Needs_better_patch:  0 |  
---+
Changes (by russellm):

  * keywords:  => blocker, regression

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

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



Re: [Django] #14880: raw_id_fields in admin does not work when limit_choices_to dictionary has value=False

2010-12-31 Thread Django
#14880: raw_id_fields in admin does not work when limit_choices_to dictionary 
has
value=False
---+
  Reporter:  smallm...@gmail.com   | Owner:  nobody
Status:  new   | Milestone:  1.3   
 Component:  django.contrib.admin  |   Version:  1.2   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by russellm):

  * stage:  Unreviewed => Accepted
  * milestone:  => 1.3

Comment:

 Confirmed that this worked in 1.2.3, but doesn't in 1.2.4 or trunk. This
 makes it a release blocker for 1.3.

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

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



Re: [Django] #14880: raw_id_fields in admin does not work when limit_choices_to dictionary has value=False

2010-12-29 Thread Django
#14880: raw_id_fields in admin does not work when limit_choices_to dictionary 
has
value=False
---+
  Reporter:  smallm...@gmail.com   | Owner:  nobody
Status:  new   | Milestone:
 Component:  django.contrib.admin  |   Version:  1.2   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by smallm...@gmail.com):

 Replying to [comment:1 julien]:
 > I tried your example, but when clicking the hourglass to select a
 publisher, the popup crashes with an error: `SuspiciousOperation:
 Filtering by overseas not allowed`. What version of Django are you using?


 I'm using 1.2.1. Tested using manage.py runserver.

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

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



Re: [Django] #14880: raw_id_fields in admin does not work when limit_choices_to dictionary has value=False

2010-12-28 Thread Django
#14880: raw_id_fields in admin does not work when limit_choices_to dictionary 
has
value=False
---+
  Reporter:  smallm...@gmail.com   | Owner:  nobody
Status:  new   | Milestone:
 Component:  django.contrib.admin  |   Version:  1.2   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by julien):

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

Comment:

 I tried your example, but when clicking the hourglass to select a
 publisher, the popup crashes with an error: `SuspiciousOperation:
 Filtering by overseas not allowed`. What version of Django are you using?

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

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



[Django] #14880: raw_id_fields in admin does not work when limit_choices_to dictionary has value=False

2010-12-09 Thread Django
#14880: raw_id_fields in admin does not work when limit_choices_to dictionary 
has
value=False
--+-
 Reporter:  smallm...@gmail.com   |   Owner:  nobody
   Status:  new   |   Milestone:
Component:  django.contrib.admin  | Version:  1.2   
 Keywords:|   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 The related-lookup popup does not properly filter the queryset when the
 limit_choices_to dictionary has value=False. The models.py and admin.py
 demonstrate the problem.

 [[BR]]

 To reproduce:

 1. Using the following models.py and admin.py, do
 {{{
 Publisher(name='local', overseas=False).save()
 Publisher(name='overseas', overseas=True).save()
 }}}
 2. Inside admin interface > add book, select related-lookup link to
 display popup. Only publisher "overseas" is available. Should display
 publisher "local" only.

 [[BR]]

 Work-around: setting limit_choices_to={'overseas': 0} works, but this
 work-around is less intuitive than a fix.

 [[BR]]

 models.py

 {{{
 from django.db import models

 class Publisher(models.Model):
 name= models.CharField(max_length=20)
 overseas= models.BooleanField()

 class Book(models.Model):
 title   = models.CharField(max_length=20)
 local_publisher = models.ForeignKey(Publisher,
 limit_choices_to={'overseas': False})

 }}}

 admin.py

 {{{
 from testproj.testapp.models import *
 from django.contrib import admin

 class BookAdmin(admin.ModelAdmin):
 raw_id_fields = ['local_publisher',]

 class PublisherAdmin(admin.ModelAdmin):
 list_display = ['name', 'overseas']

 admin.site.register(Book, BookAdmin)
 admin.site.register(Publisher, PublisherAdmin)
 }}}

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

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