I have the following Django model that extends the Post model from django basic blog:
from django.basic.blog.models import Post
from l10n.utils import lookup_translation
class ExtendedPost(Post):
class Meta:
proxy = True
def translated_title(self, language_code=None):
return lookup_translation(self, 'title', language_code)
I'm trying to use django basic blog's view by just overriding their template and making use of the new ExtendedPost behaviour in there:
{{ post.extendedpost.translated_title }}
But obviously this doesn't work because you can't just access a subclass like that. How DO you do this type of thing?