--
Ticket URL: <https://code.djangoproject.com/ticket/29382>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Old description:
> Some objects have __call__ defined but have sub-attributes.
> In my case the wtforms Label object.
> I cannot access Label.text because Label is callable and the resulting
> str object has not the attribute text.
> Please evaluate first the object fully and then check if __call__ is
> available. Elsewise the behaviour is inconsistent and confusing.
New description:
Some objects have \__call\__ defined but have sub-attributes.
In my case the wtforms Label object.
I cannot access Label.text because Label is callable and the resulting str
object has not the attribute text.
Please evaluate first the object fully and then check if \__call\__ is
available. Elsewise the behaviour is inconsistent and confusing.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/29382#comment:1>
Old description:
> Some objects have \__call\__ defined but have sub-attributes.
> In my case the wtforms Label object.
> I cannot access Label.text because Label is callable and the resulting
> str object has not the attribute text.
> Please evaluate first the object fully and then check if \__call\__ is
> available. Elsewise the behaviour is inconsistent and confusing.
New description:
Some objects have __ call __ defined but have sub-attributes.
In my case the wtforms Label object.
I cannot access Label.text because Label is callable and the resulting str
object has not the attribute text.
Please evaluate first the object fully and then check if __ call __ is
available. Elsewise the behaviour is inconsistent and confusing.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/29382#comment:2>
Old description:
> Some objects have __ call __ defined but have sub-attributes.
> In my case the wtforms Label object.
> I cannot access Label.text because Label is callable and the resulting
> str object has not the attribute text.
> Please evaluate first the object fully and then check if __ call __ is
> available. Elsewise the behaviour is inconsistent and confusing.
New description:
Some objects are callable but have sub-attributes.
In my case the wtforms Label object.
I cannot access Label.text because Label is callable and the resulting str
object has not the attribute text.
Please evaluate first the object fully and then check if object is
callable. Elsewise the behaviour is inconsistent and confusing.
Sorry for the changes
--
--
Ticket URL: <https://code.djangoproject.com/ticket/29382#comment:3>
Comment (by Tim Graham):
Is it related to or a duplicate of #29306 and/or #15791. It's not clear to
me exactly how your proposal would work and if it would be backwards
compatible.
--
Ticket URL: <https://code.djangoproject.com/ticket/29382#comment:4>
* status: new => closed
* resolution: => duplicate
Comment:
Closing as duplicate of #29306 and/or #15791.
(`wtforms` should be able to allow marking labels with
`do_not_call_in_templates` to control the behaviour here.)
--
Ticket URL: <https://code.djangoproject.com/ticket/29382#comment:5>