Re: [Django] #12568: SubFieldBase descriptor object should be accessible

10 views
Skip to first unread message

Django

unread,
Sep 17, 2013, 4:41:33 PM9/17/13
to django-...@googlegroups.com
#12568: SubFieldBase descriptor object should be accessible
-------------------------------------+-------------------------------------
Reporter: specialunderwear | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 1.2-alpha
Severity: Normal | Resolution:
Keywords: SubFieldBase | Triage Stage: Accepted
subclassing | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 1 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by supervacuo):

Any chance this can make it into an official release? I'm happy to polish
up however needed, or take this to `django-developers` if it really needs
discussion.

Rebased patch against git master attached above, as a start.

This bug causes an `AttributeError` when trying to use sphinx-autodoc on
custom fields which have `__metaclass__ = SubFieldBase`, due to the
underlying "must be accessed from instance" `AttributeError`. The
equivalent ticket for fixing `inspect()` for Django's built-in fields was
#8248, fixed in [9634] (~5 years ago).

--
Ticket URL: <https://code.djangoproject.com/ticket/12568#comment:9>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 17, 2013, 4:51:54 PM9/17/13
to django-...@googlegroups.com
#12568: SubFieldBase descriptor object should be accessible
-------------------------------------+-------------------------------------
Reporter: specialunderwear | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 1.2-alpha
Severity: Normal | Resolution:
Keywords: SubFieldBase | Triage Stage: Accepted
subclassing | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 1 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by anonymous):

Nice!

--
Ticket URL: <https://code.djangoproject.com/ticket/12568#comment:10>

Django

unread,
Sep 17, 2013, 4:57:49 PM9/17/13
to django-...@googlegroups.com
#12568: SubFieldBase descriptor object should be accessible
-------------------------------------+-------------------------------------
Reporter: specialunderwear | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 1.2-alpha
Severity: Normal | Resolution:
Keywords: SubFieldBase | Triage Stage: Accepted
subclassing | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 1 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by akaariai):

Any objections for adding this, seems like a good addition to me?

--
Ticket URL: <https://code.djangoproject.com/ticket/12568#comment:11>

Django

unread,
Sep 18, 2013, 3:04:33 AM9/18/13
to django-...@googlegroups.com
#12568: SubFieldBase descriptor object should be accessible
-------------------------------------+-------------------------------------
Reporter: specialunderwear | Owner: nobody
Type: Bug | Status: closed
Component: Forms | Version: 1.2-alpha
Severity: Normal | Resolution: fixed

Keywords: SubFieldBase | Triage Stage: Accepted
subclassing | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 1 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by Anssi Kääriäinen <akaariai@…>):

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


Comment:

In [changeset:"50633e7353694ff54f14b04469be3792f286182f"]:
{{{
#!CommitTicketReference repository=""
revision="50633e7353694ff54f14b04469be3792f286182f"
Fixed #12568 -- no error when accessing custom field's descriptor

The SubfieldBase's descriptor caused an AttributeError when accessed
from the class. Introspection didn't like that.

Patch by Trac alias supervacuo.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/12568#comment:12>

Reply all
Reply to author
Forward
0 new messages