Re: [Django] #24323: NameError: global name XXXXXAdmin is not defined when using admin register decorator with an __init__ super call

2015-02-26 Thread Django
#24323: NameError: global name XAdmin is not defined when using admin 
register
decorator with an __init__ super call
---+
 Reporter:  eskhool|Owner:  nobody
 Type:  Bug|   Status:  new
Component:  contrib.admin  |  Version:  1.7
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  1
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by eskhool):

 Sounds like an unacceptable solution for now (I can confirm it works). The
 Python3 super may be a reasonable solution in the very long term.

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


Re: [Django] #24323: NameError: global name XXXXXAdmin is not defined when using admin register decorator with an __init__ super call

2015-02-12 Thread Django
#24323: NameError: global name XAdmin is not defined when using admin 
register
decorator with an __init__ super call
---+
 Reporter:  eskhool|Owner:  nobody
 Type:  Bug|   Status:  new
Component:  contrib.admin  |  Version:  1.7
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  1
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by charettes):

 * needs_docs:  0 => 1


Comment:

 Because of the way model admin registration and class decoration works I
 doubt we'll be able to fix this in an elegant way.

 I suggest we document to use `site.register` if you have to reference your
 model admin during its initialization phase or simply use
 `super().__init__` on Python 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 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.926515441be8ad2a541f53cb76fd37e7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24323: NameError: global name XXXXXAdmin is not defined when using admin register decorator with an __init__ super call

2015-02-11 Thread Django
#24323: NameError: global name XAdmin is not defined when using admin 
register
decorator with an __init__ super call
---+
 Reporter:  eskhool|Owner:  nobody
 Type:  Bug|   Status:  new
Component:  contrib.admin  |  Version:  1.7
 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 timgraham):

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


Old description:

> When registering a django admin using the
> {{{
> @admin.register()
> class Admin(admin.ModelAdmin):
> def __init__(args, kwargs):
> super(Admin, self).__init__(args, kwargs)
> }}}
>
> gives an exception:
> {{{
> NameError: global name XAdmin is not defined
> }}}

New description:

 When registering a django admin using the
 {{{
 @admin.register()
 class Admin(admin.ModelAdmin):
 def __init__(self, *args, **kwargs):
 super(Admin, self).__init__(*args, **kwargs)
 }}}

 gives an exception:
 {{{
 NameError: global name XAdmin is not defined
 }}}

--

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