Re: [Django] #25622: InlineAdmin raises 'GenericRel' object has no attribute 'get_related_field'

2015-10-29 Thread Django
#25622: InlineAdmin raises 'GenericRel' object has no attribute 
'get_related_field'
-+-
 Reporter:  johnraz  |Owner:  charettes
 Type:  Bug  |   Status:  closed
Component:  contrib.admin|  Version:  1.8
 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
-+-

Comment (by Simon Charette ):

 In [changeset:"c42e4e736a587dc9858fe55fb972aefaa065867d" c42e4e7]:
 {{{
 #!CommitTicketReference repository=""
 revision="c42e4e736a587dc9858fe55fb972aefaa065867d"
 Fixed #25622 -- Accounted for generic relations in the admin to field
 validation

 Thanks to Jonathan Liuti for the report and Tim Graham for the review.

 Conflicts:
 django/contrib/admin/options.py
 }}}

--
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/065.18dd4cdc4f8e9bd6b628f220b556a1b3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25622: InlineAdmin raises 'GenericRel' object has no attribute 'get_related_field'

2015-10-29 Thread Django
#25622: InlineAdmin raises 'GenericRel' object has no attribute 
'get_related_field'
-+-
 Reporter:  johnraz  |Owner:  charettes
 Type:  Bug  |   Status:  closed
Component:  contrib.admin|  Version:  1.8
 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
-+-

Comment (by Simon Charette ):

 In [changeset:"6eaf43a24471f98939da18d031b4f0b4e49640c6" 6eaf43a2]:
 {{{
 #!CommitTicketReference repository=""
 revision="6eaf43a24471f98939da18d031b4f0b4e49640c6"
 [1.9.x] Fixed #25622 -- Accounted for generic relations in the admin to
 field validation

 Thanks to Jonathan Liuti for the report and Tim Graham for the review.

 Backport of 9dcfecb7c6c8285630ad271888a9ec4ba9140e3a from master
 }}}

--
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/065.7c52a6138c652a9d9be957ec36a24da4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25622: InlineAdmin raises 'GenericRel' object has no attribute 'get_related_field'

2015-10-29 Thread Django
#25622: InlineAdmin raises 'GenericRel' object has no attribute 
'get_related_field'
-+-
 Reporter:  johnraz  |Owner:  charettes
 Type:  Bug  |   Status:  closed
Component:  contrib.admin|  Version:  1.8
 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 Simon Charette ):

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


Comment:

 In [changeset:"9dcfecb7c6c8285630ad271888a9ec4ba9140e3a" 9dcfecb]:
 {{{
 #!CommitTicketReference repository=""
 revision="9dcfecb7c6c8285630ad271888a9ec4ba9140e3a"
 Fixed #25622 -- Accounted for generic relations in the admin to field
 validation

 Thanks to Jonathan Liuti for the report and Tim Graham for the review.
 }}}

--
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/065.b0836ca8d73c7eeb152e0376cac13352%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25622: InlineAdmin raises 'GenericRel' object has no attribute 'get_related_field'

2015-10-29 Thread Django
#25622: InlineAdmin raises 'GenericRel' object has no attribute 
'get_related_field'
-+-
 Reporter:  johnraz  |Owner:  charettes
 Type:  Bug  |   Status:  new
Component:  contrib.admin|  Version:  1.8
 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
-+-

Comment (by johnraz):

 Splendid !
 It works for me.

--
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/065.83264aa051080ad65161967695c7bb48%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25622: InlineAdmin raises 'GenericRel' object has no attribute 'get_related_field'

2015-10-29 Thread Django
#25622: InlineAdmin raises 'GenericRel' object has no attribute 
'get_related_field'
-+-
 Reporter:  johnraz  |Owner:  charettes
 Type:  Bug  |   Status:  new
Component:  contrib.admin|  Version:  1.8
 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 timgraham):

 * 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 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/065.bfe6fd39e3ef07d2d0e40a2c25d24d4c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25622: InlineAdmin raises 'GenericRel' object has no attribute 'get_related_field'

2015-10-28 Thread Django
#25622: InlineAdmin raises 'GenericRel' object has no attribute 
'get_related_field'
---+-
 Reporter:  johnraz|Owner:  charettes
 Type:  Bug|   Status:  new
Component:  contrib.admin  |  Version:  1.8
 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 charettes):

 * has_patch:  0 => 1
 * stage:  Unreviewed => Accepted


Comment:

 Managed to reproduced with simplified models, thanks. Here's a
 [https://github.com/django/django/pull/5496 PR] you can test.

 I guess we should backport this since it's a bug in a new feature.

--
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/065.d580474638cef1bc51c0d8628294598c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25622: InlineAdmin raises 'GenericRel' object has no attribute 'get_related_field'

2015-10-28 Thread Django
#25622: InlineAdmin raises 'GenericRel' object has no attribute 
'get_related_field'
---+--
 Reporter:  johnraz|Owner:  charettes
 Type:  Bug|   Status:  new
Component:  contrib.admin  |  Version:  1.8
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by charettes):

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


Comment:

 Will look into this soon.

--
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/065.21586de012048d5787c22a95cb1818eb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25622: InlineAdmin raises 'GenericRel' object has no attribute 'get_related_field'

2015-10-28 Thread Django
#25622: InlineAdmin raises 'GenericRel' object has no attribute 
'get_related_field'
---+--
 Reporter:  johnraz|Owner:  charettes
 Type:  Bug|   Status:  closed
Component:  contrib.admin  |  Version:  1.8
 Severity:  Normal |   Resolution:  worksforme
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by johnraz):

 Yes you are absolutely right.
 I do have a `GenericRelation` setup like this (in addition to the previous
 example):

 {{{
 # models.py

 class AbstractModelX(models.Model):
 model_a_gen_rel = GenericRelation(SortedDocument)
 class Meta:
 abstract=True

 class ModelD(AbstractModelX):
 pass

 class ModelE(AbstractModelX):
 pass
 }}}

--
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/065.5a645a664a72670d1b634d3cb8f697b5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25622: InlineAdmin raises 'GenericRel' object has no attribute 'get_related_field'

2015-10-28 Thread Django
#25622: InlineAdmin raises 'GenericRel' object has no attribute 
'get_related_field'
---+--
 Reporter:  johnraz|Owner:  charettes
 Type:  Bug|   Status:  closed
Component:  contrib.admin  |  Version:  1.8
 Severity:  Normal |   Resolution:  worksforme
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by charettes):

 Do you have a `django.contrib.contenttypes.fields.GenericRelation` defined
 somewhere?

--
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/065.b5c9f02f4d16539006da81a6631fde93%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25622: InlineAdmin raises 'GenericRel' object has no attribute 'get_related_field'

2015-10-28 Thread Django
#25622: InlineAdmin raises 'GenericRel' object has no attribute 
'get_related_field'
---+--
 Reporter:  johnraz|Owner:  charettes
 Type:  Bug|   Status:  closed
Component:  contrib.admin  |  Version:  1.8
 Severity:  Normal |   Resolution:  worksforme
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by charettes):

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


Comment:

 Hi johnraz,

 This looks like a legitimate traceback but I cannot reproduce with your
 provided setup against `1.8.x` and `master`.

 Can you confirm [https://github.com/charettes/django-
 ticketing/tree/master/ticket_25622 I didn't miss something]?

--
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/065.7373a006418eb2416fd9174cb287%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25622: InlineAdmin raises 'GenericRel' object has no attribute 'get_related_field'

2015-10-28 Thread Django
#25622: InlineAdmin raises 'GenericRel' object has no attribute 
'get_related_field'
---+--
 Reporter:  johnraz|Owner:  charettes
 Type:  Bug|   Status:  assigned
Component:  contrib.admin  |  Version:  1.8
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by charettes):

 * status:  new => assigned
 * needs_better_patch:   => 0
 * owner:  nobody => charettes
 * 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 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/065.68b0afe9dd36ea34d20b701b52c33949%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #25622: InlineAdmin raises 'GenericRel' object has no attribute 'get_related_field'

2015-10-28 Thread Django
#25622: InlineAdmin raises 'GenericRel' object has no attribute 
'get_related_field'
---+
 Reporter:  johnraz|  Owner:  nobody
 Type:  Bug| Status:  new
Component:  contrib.admin  |Version:  1.8
 Severity:  Normal |   Keywords:
 Triage Stage:  Unreviewed |  Has patch:  0
Easy pickings:  0  |  UI/UX:  0
---+
 I have the following setup (simplified for the sake of clarity)

 {{{
 # models.py
 class ModelA(models.Model):
 content_type = models.ForeignKey(ContentType)
 object_id = models.PositiveIntegerField()
 content_object = GenericForeignKey('content_type', 'object_id')
 uuid = models.UUIDField(default=uuid.uuid4, unique=True,
 db_index=True)

 class ModelB(models.Model):
 model_a_fk = models.ForeignKey('ModelA', to_field='uuid')
 model_c_fk = models.ForeignKey('ModelC')

 class ModelC(models.Model):
 ... # nothing fancy
 }}}


 {{{
 #admin.py
 class ModelAAdmin(admin.ModelAdmin):
  #nothing fancy

 class InlineModelB(admin.TabularInline):
  model=ModelB
  raw_id_fields=('model_a_fk', 'model_c_fk')

 class ModelBAdmin(admin.ModelAdmin):
  raw_id_fields=('model_a_fk', 'model_c_fk')

 class ModelCAdmin(admin.ModelAdmin):
  inlines=(InlineModelB,)
 }}}

 Now, when going to the `ModelCAdmin` view, triggering the search pop-up
 for `ModelB.model_a_fk` field, I will get the following traceback:


 {{{
   File "/usr/local/lib/python2.7/dist-
 packages/django/core/handlers/base.py", line 132, in get_response
 response = wrapped_callback(request, *callback_args,
 **callback_kwargs)
   File "/usr/local/lib/python2.7/dist-
 packages/django/contrib/admin/options.py", line 616, in wrapper
 return self.admin_site.admin_view(view)(*args, **kwargs)
   File "/usr/local/lib/python2.7/dist-
 packages/django/utils/decorators.py", line 110, in _wrapped_view
 response = view_func(request, *args, **kwargs)
   File "/usr/local/lib/python2.7/dist-
 packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
 response = view_func(request, *args, **kwargs)
   File "/usr/local/lib/python2.7/dist-
 packages/django/contrib/admin/sites.py", line 233, in inner
 return view(request, *args, **kwargs)
   File "/usr/local/lib/python2.7/dist-
 packages/django/utils/decorators.py", line 34, in _wrapper
 return bound_func(*args, **kwargs)
   File "/usr/local/lib/python2.7/dist-
 packages/django/utils/decorators.py", line 110, in _wrapped_view
 response = view_func(request, *args, **kwargs)
   File "/usr/local/lib/python2.7/dist-
 packages/django/utils/decorators.py", line 30, in bound_func
 return func.__get__(self, type(self))(*args2, **kwargs2)
   File "/usr/local/lib/python2.7/dist-
 packages/django/contrib/admin/options.py", line 1548, in changelist_view
 self.list_max_show_all, self.list_editable, self)
   File "/usr/local/lib/python2.7/dist-
 packages/django/contrib/admin/views/main.py", line 67, in __init__
 if to_field and not model_admin.to_field_allowed(request, to_field):
   File "/usr/local/lib/python2.7/dist-
 packages/django/contrib/admin/options.py", line 489, in to_field_allowed
 related_object.field.rel.get_related_field() == field):
 AttributeError: 'GenericRel' object has no attribute 'get_related_field'
 }}}

 Triggering the search pop-up for `ModelB.model_c_fk` works just fine.

 It looks like https://code.djangoproject.com/ticket/23616 but in a
 different place.

--
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/050.745f28ac9e77d378e4863b1e3cf12ac9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.