Ask Your Question
0

new type of post..

asked 2013-05-27 01:46:56 -0500

pcompassion gravatar image

updated 2013-05-27 01:59:35 -0500

Hello

What do you think would be the best way to create a new type of 'Post'?
(other than question/answer/comment/tag_wiki/..)

Specifically, I'd like to add translate type.
It will have two texts/htmls/authors/edit_dates and etc, one for each language.
For example, english text -> korean text translate,
we would need one author field for english another for korean.

Please advise me how to add such a post type.

edit retag flag offensive close merge delete

Comments

pcompassion gravatar imagepcompassion ( 2013-07-14 23:49:15 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-05-27 21:54:53 -0500

Evgeny gravatar image

updated 2013-05-27 21:58:42 -0500

To answer your question - it is possible to create other post types by using a different value for the Post.post_type but there may be a bit of pain as there are some checks in the code similar to:

if post.post_type == ...:
elif ...
else:
    raise NotImplementedError()

So you will have to change some of that code or think of how to fix it so that adding another post type does not create as much resistance.

We would actually like to develop the UI for the translation of posts into different languages, but thinking of keeping questions and answers in different languages largely decoupled - in the same style that wikipedia does, but provide links between the translated pairs of questions. It will be very difficult to keep all the structure of questions, answers and the comments in sync between the various translations.

Unlike wikipedia though we do support multiple languages working on the same instance.

edit flag offensive delete link more

Comments

Thanks for the input. My translation_type would be something different from what you describe at the moment. Mine would show two versions in different languages side by side in one page.

pcompassion gravatar imagepcompassion ( 2013-05-28 00:22:56 -0500 )edit

Ok, then you might need to make some changes in askbot code base - perhaps those changes might be integrated into the askbot app as is - so that it would be easier to create new post types in the future. Seems like you'll need to maintain either a fork or some sort of extensions to achieve your goal.

Evgeny gravatar imageEvgeny ( 2013-05-28 00:29:07 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-05-27 01:46:56 -0500

Seen: 107 times

Last updated: May 27 '13