Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

entry.__dict__['title'] doesn't exist when using django-modeltranslation #186

Closed
Lacrymology opened this issue Dec 13, 2012 · 3 comments
Closed

Comments

@Lacrymology
Copy link

I bring this here because modeltranslation is the official-ish way of getting multilanguage entries with zinnia. This line: https://github.com/Fantomas42/django-blog-zinnia/blob/master/zinnia/comparison.py#L39 fails when modeltranslation is on. It raises KeyError: 'title'.

Changing this line to

dataset[item] = ' '.join([unicode(getattr(item, field) for field in self.fields])

is both cleaner, and it works.

@Lacrymology
Copy link
Author

it was a change on django-modeltranslation, introduced by commit deschler/django-modeltranslation@df02c81

I still believe this reference to __dict__ is "in the wrong" here

@Fantomas42
Copy link
Owner

Hi Tomas,

you have a really good sight !
Thanks for the improvement.

However I have a question, does the comparison tag returns weird results or not with modeltranslation ?

Regards

@Lacrymology
Copy link
Author

I have a goodish intuition, the good sight is really git-bisect's =) I didn't even identify the change that brought up the issue.

I don't really know how to test this, but if you tell me, I'll do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants