Re: [Django] #28384: ModelAdmin.lookup_allowed() incorrectly raises DisallowedModelAdminLookup lookup with foreign key as primary key

2023-03-28 Thread Django
#28384: ModelAdmin.lookup_allowed() incorrectly raises 
DisallowedModelAdminLookup
lookup with foreign key as primary key
-+-
 Reporter:  elliott-omosheye |Owner:  Sarah
 |  Boyce
 Type:  Bug  |   Status:  closed
Component:  contrib.admin|  Version:  1.11
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak ):

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


Comment:

 In [changeset:"45ecd9acca9b36093e274f47b6877a5f79108d9e" 45ecd9ac]:
 {{{
 #!CommitTicketReference repository=""
 revision="45ecd9acca9b36093e274f47b6877a5f79108d9e"
 Fixed #28384 -- Fixed ModelAdmin.lookup_allowed() for OneToOneField
 primary keys and nested relations.
 }}}

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701872745f027-0f89fd48-6693-4af3-866e-8b08b8e8cd0b-00%40eu-central-1.amazonses.com.


Re: [Django] #28384: ModelAdmin.lookup_allowed() incorrectly raises DisallowedModelAdminLookup lookup with foreign key as primary key

2023-03-28 Thread Django
#28384: ModelAdmin.lookup_allowed() incorrectly raises 
DisallowedModelAdminLookup
lookup with foreign key as primary key
-+-
 Reporter:  elliott-omosheye |Owner:  Sarah
 |  Boyce
 Type:  Bug  |   Status:  assigned
Component:  contrib.admin|  Version:  1.11
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * stage:  Accepted => Ready for checkin


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701872718312d-b1f4ca33-5318-46d9-9585-059c245c0913-00%40eu-central-1.amazonses.com.


Re: [Django] #28384: ModelAdmin.lookup_allowed() incorrectly raises DisallowedModelAdminLookup lookup with foreign key as primary key

2023-03-27 Thread Django
#28384: ModelAdmin.lookup_allowed() incorrectly raises 
DisallowedModelAdminLookup
lookup with foreign key as primary key
--+---
 Reporter:  elliott-omosheye  |Owner:  Sarah Boyce
 Type:  Bug   |   Status:  assigned
Component:  contrib.admin |  Version:  1.11
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+---
Changes (by Sarah Boyce):

 * needs_better_patch:  1 => 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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018724124618-538a4d1b-a49e-43a0-b47c-4e29c72d3a8a-00%40eu-central-1.amazonses.com.


Re: [Django] #28384: ModelAdmin.lookup_allowed() incorrectly raises DisallowedModelAdminLookup lookup with foreign key as primary key

2023-03-27 Thread Django
#28384: ModelAdmin.lookup_allowed() incorrectly raises 
DisallowedModelAdminLookup
lookup with foreign key as primary key
--+---
 Reporter:  elliott-omosheye  |Owner:  Sarah Boyce
 Type:  Bug   |   Status:  assigned
Component:  contrib.admin |  Version:  1.11
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+---
Changes (by Mariusz Felisiak):

 * needs_better_patch:  0 => 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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187221c6b3f-dc4c9822-008e-490c-931c-04facc2ed594-00%40eu-central-1.amazonses.com.


Re: [Django] #28384: ModelAdmin.lookup_allowed() incorrectly raises DisallowedModelAdminLookup lookup with foreign key as primary key

2023-03-22 Thread Django
#28384: ModelAdmin.lookup_allowed() incorrectly raises 
DisallowedModelAdminLookup
lookup with foreign key as primary key
--+---
 Reporter:  elliott-omosheye  |Owner:  Sarah Boyce
 Type:  Bug   |   Status:  assigned
Component:  contrib.admin |  Version:  1.11
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+---
Changes (by Sarah Boyce):

 * needs_better_patch:  1 => 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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701870d272ee2-8e9fc952-eab5-4263-b54f-672d2fedecf3-00%40eu-central-1.amazonses.com.


Re: [Django] #28384: ModelAdmin.lookup_allowed() incorrectly raises DisallowedModelAdminLookup lookup with foreign key as primary key

2023-03-21 Thread Django
#28384: ModelAdmin.lookup_allowed() incorrectly raises 
DisallowedModelAdminLookup
lookup with foreign key as primary key
--+---
 Reporter:  elliott-omosheye  |Owner:  Sarah Boyce
 Type:  Bug   |   Status:  assigned
Component:  contrib.admin |  Version:  1.11
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+---
Changes (by Mariusz Felisiak):

 * needs_better_patch:  0 => 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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701870371b210-7883f7ff-5aae-4890-9729-cb6361b38e53-00%40eu-central-1.amazonses.com.


Re: [Django] #28384: ModelAdmin.lookup_allowed() incorrectly raises DisallowedModelAdminLookup lookup with foreign key as primary key

2023-03-18 Thread Django
#28384: ModelAdmin.lookup_allowed() incorrectly raises 
DisallowedModelAdminLookup
lookup with foreign key as primary key
--+---
 Reporter:  elliott-omosheye  |Owner:  Sarah Boyce
 Type:  Bug   |   Status:  assigned
Component:  contrib.admin |  Version:  1.11
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+---
Changes (by Sarah Boyce):

 * needs_better_patch:  1 => 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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070186f6a37a17-f60ab4bd-a34d-4871-bddf-4f7d5f990d95-00%40eu-central-1.amazonses.com.


Re: [Django] #28384: ModelAdmin.lookup_allowed() incorrectly raises DisallowedModelAdminLookup lookup with foreign key as primary key

2023-03-18 Thread Django
#28384: ModelAdmin.lookup_allowed() incorrectly raises 
DisallowedModelAdminLookup
lookup with foreign key as primary key
--+---
 Reporter:  elliott-omosheye  |Owner:  Sarah Boyce
 Type:  Bug   |   Status:  assigned
Component:  contrib.admin |  Version:  1.11
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+---
Changes (by Sarah Boyce):

 * needs_better_patch:  0 => 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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070186f476055a-553daedd-312b-419d-9c19-7c39ffaf7721-00%40eu-central-1.amazonses.com.


Re: [Django] #28384: ModelAdmin.lookup_allowed() incorrectly raises DisallowedModelAdminLookup lookup with foreign key as primary key

2023-03-18 Thread Django
#28384: ModelAdmin.lookup_allowed() incorrectly raises 
DisallowedModelAdminLookup
lookup with foreign key as primary key
--+---
 Reporter:  elliott-omosheye  |Owner:  Sarah Boyce
 Type:  Bug   |   Status:  assigned
Component:  contrib.admin |  Version:  1.11
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+---
Changes (by Sarah Boyce):

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


Comment:

 https://github.com/django/django/pull/16661

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070186f40c2f37-d71beff8-9235-4647-8213-dbf72122d892-00%40eu-central-1.amazonses.com.


Re: [Django] #28384: ModelAdmin.lookup_allowed() incorrectly raises DisallowedModelAdminLookup lookup with foreign key as primary key

2023-03-16 Thread Django
#28384: ModelAdmin.lookup_allowed() incorrectly raises 
DisallowedModelAdminLookup
lookup with foreign key as primary key
--+
 Reporter:  elliott-omosheye  |Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.admin |  Version:  1.11
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by Mariusz Felisiak):

 * cc: Sarah Boyce (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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070186e9cbc4ef-132a7127-9724-4bc2-afc1-324d6e75e647-00%40eu-central-1.amazonses.com.


Re: [Django] #28384: ModelAdmin.lookup_allowed() incorrectly raises DisallowedModelAdminLookup lookup with foreign key as primary key

2017-08-10 Thread Django
#28384: ModelAdmin.lookup_allowed() incorrectly raises 
DisallowedModelAdminLookup
lookup with foreign key as primary key
--+
 Reporter:  elliott-omosheye  |Owner:  Windson yang
 Type:  Bug   |   Status:  assigned
Component:  contrib.admin |  Version:  1.11
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by Windson yang):

 * status:  new => assigned
 * owner:  nobody => Windson yang


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/074.fb487e9b8a01ff79f1bc993ef4c008a1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28384: ModelAdmin.lookup_allowed() incorrectly raises DisallowedModelAdminLookup lookup with foreign key as primary key (was: ModelAdmin.lookup_allowed() incorrectly raises DisallowedMod

2017-07-11 Thread Django
#28384: ModelAdmin.lookup_allowed() incorrectly raises 
DisallowedModelAdminLookup
lookup with foreign key as primary key
--+
 Reporter:  elliott-omosheye  |Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.admin |  Version:  1.11
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by Tim Graham):

 * stage:  Unreviewed => Accepted


Old description:

> Wrote a failing test to demonstrate - same test/code passes on 1.8
> {{{
> @isolate_apps('modeladmin')
> def test_lookup_allowed_foreign_primary(self):
>
> class Country(models.Model):
> name = models.CharField(max_length=256)
>
> class Place(models.Model):
> country = models.ForeignKey(Country, models.CASCADE)
>
> class Restaurant(models.Model):
> place = models.OneToOneField(Place, models.CASCADE,
> primary_key=True)
>
> class Waiter(models.Model):
> restaurant = models.ForeignKey(Restaurant, models.CASCADE)
>
> class WaiterAdmin(ModelAdmin):
> list_filter = [
> 'restaurant__place__country',
> ]
>
> ma = WaiterAdmin(Waiter, self.site)
> self.assertIs(ma.lookup_allowed('restaurant__place__country',
> 'test_value'), True)
> }}}
>
> I think this is caused by the admin thinking that having a foreign key
> field as a primary key is the same as concrete inheritance. So when you
> try and check lookups for {{{restaurant__place__country}}} it thinks
> 'place' is the concrete parent of 'restaurant' and shortcuts it to
> {{{restaurant__country}}} which isn't in 'list_filter'. And you can't add
> {{{restaurant__country}}} to list_filter because country isn't actually
> on restaurant.

New description:

 Wrote a failing test for `tests/modeladmin/tests.py` to demonstrate - same
 test/code passes on 1.8
 {{{
 @isolate_apps('modeladmin')
 def test_lookup_allowed_foreign_primary(self):

 class Country(models.Model):
 name = models.CharField(max_length=256)

 class Place(models.Model):
 country = models.ForeignKey(Country, models.CASCADE)

 class Restaurant(models.Model):
 place = models.OneToOneField(Place, models.CASCADE,
 primary_key=True)

 class Waiter(models.Model):
 restaurant = models.ForeignKey(Restaurant, models.CASCADE)

 class WaiterAdmin(ModelAdmin):
 list_filter = [
 'restaurant__place__country',
 ]

 ma = WaiterAdmin(Waiter, self.site)
 self.assertIs(ma.lookup_allowed('restaurant__place__country',
 'test_value'), True)
 }}}

 I think this is caused by the admin thinking that having a foreign key
 field as a primary key is the same as concrete inheritance. So when you
 try and check lookups for `restaurant__place__country` it thinks 'place'
 is the concrete parent of 'restaurant' and shortcuts it to
 `restaurant__country` which isn't in 'list_filter'. And you can't add
 `restaurant__country` to `list_filter` because country isn't actually on
 restaurant.

--

Comment:

 Bisected to 8f30556329b64005d63b66859a74752a0b261315.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/074.cc78e465beb4ff29ecbe3cb0b639c567%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.