THAT error in python is if you miss a "()" at the end of a function name. 
For example, if str is an object and str.upper() is a method, you will get 
this error if you call str.upper instead of the expected str.upper()

If I get this error, all I do is add the brackets correctly, and of course 
I pass the right parameters. The errir for parameters will be thrown only 
if the brackets are there in the first place...

On Sunday, January 22, 2006 6:32:34 AM UTC+5:30, Mike Kent wrote:
>
> I decided to take a crack at one of the current bugs, where a TextField
> widget named 'title' would display on a form with the text '<built-in
> method title of str object at 0xb7b416a0>' filled in.  Trac is down, so
> I don't know what the Trac bug number this is, but it does have a
> number.
>
> You can see this bug by putting the following in a controller:
>
> myForm = TableForm(widgets=[TextField('title')])
>
> and then passing that to a template via the returned dict, then
> inserting the form in the template.
>
> It became obvious pretty quickly that something in TG was doing the
> equivalent of 'repr(getattr('some string', 'title')), and putting it
> into the value displayed in the field.  In fact, changing 'title' to
> 'upper' resulted in '<built-in method upper of str object at
> 0xb7b416a0>'.  However, changing 'title' to 'foobar' results in an
> empty field, which lead me to believe the code was doing the equivalent
> of 'repr(getattr('some string', 'foobar', ''))' or possibly
> 'repr(getattr('some string', 'foobar', None))'.
>
> After spending some time with the code, I found the following in the
> template for the TableForm widget (line 138 widgets/forms.py):
>
> <td>${widget.insert(getattr(self.widget_value, widget.name, None),
> input_values, widget_error.get(widget.name, None))}</td>
>
> After some study, I've determined that the intent of this code is to
> pass the current value of a widget on the form (in this case, a
> TextField widget) to the insert method of that widget.  Changing the
> first argument of the above insert call to None results in an empty
> field being displayed rather than the '<build-in method...' text, but
> obviously if the TextField widget has a value, it will not be
> displayed.  I can change the first argument to widget.default, and get
> the default value of the widget displayed in the field, but I'm not
> sure this exactly fills the intent of the code.
>
> At this point, I suppose Kevin will need to take a look at this code
> and determine what the actual intent is before a patch can be generated.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/turbogears/-/TdYXdclq5xsJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.

Reply via email to