On 23 déc, 11:29, Daniel Roseman <[email protected]> wrote:
>
> You have two attributes on your model called 'data'.  One is the field, and
> one is a method.

Nope, there's only one : the method. You *can not* have two attributes
by the same name in a class - since attributes are stored in dict
(actually a DictProxy for classes but that's not the point) and you
obviously can't have the same key twice in a dict.


> Normally, when you reference a method in a template, Django
> calls it automatically and uses the return value.

And that's what happening here. The problem is that the data method
returns itself.

> However, it's possible
> that because you have one name for two attributes, you've confused the
> rendering engine. Try getting rid of the method altogether - it seems
> irrelevant, since it just returns the value of the field

Not quite - cf above. And the OP added this accessor so it could
tagged it with "allow_tags" (cf contrib.admin doc).

> - or at least
> renaming it.

That's indeed the solution.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
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/django-users?hl=en.

Reply via email to