Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

[META] How to post code with indentation ?

By
Maurice Agée
on 9/21/15, 4:56 AM 514 views

NOTE: interested in code formatting in answer posts too.

4

Axel Mendoza

--Axel Mendoza--
10238
| 7 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

Axel Mendoza
On 9/21/15, 5:03 AM


You need to click on the code option like in the image

If you've mixed content in your post (code/text), then you can select a code part in the text first and then apply code formatting using the above option.


I saw for the answer but it is not possible for the comments ! Alex your answer is not correct for my point of view and 3 points aren't just.

Maurice Agée
on 9/24/15, 4:25 PM

You are right, comments doesn't allow you to ident code, My answer is for the way to do it in answers, if someone know how to do it in comments, it's welcome to post it here

Axel Mendoza
on 9/24/15, 4:33 PM

you mean like that?

Temur
on 9/25/15, 5:58 AM

Answer of of @Alex were marked as accepted by me, as it corresponds very well to the question posted. additionally it was upvoted +3 by community deservedly. @Maurice in your question there is no any indication that the way of code formatting were requested for comments. In order to get more specific answer, you should indicate that you're interested in comment case... otherwise answer of @Alex is just perfect.

Temur
on 9/25/15, 6:15 AM

for the comment case, see my answer.

Temur
on 9/25/15, 6:33 AM

.....

Maurice Agée
on 9/25/15, 8:00 AM

.....

Maurice Agée
on 9/25/15, 8:00 AM

My question does not specify the place where we should write but the forum provides several possibilities. So I understand that incomplete answer is worth 3 points and the open question and who has never been raised worth zero. Anyway, thank you for the answer to my question and responsiveness to my comment.

Maurice Agée
on 9/25/15, 8:11 AM

Yes, I understand your point of view and you have not to be agree with me, but my point is that we had too much to guess, as question does not specifies what the problem exactly was. I could not guess that you mean comments in your question as well. Anyway, additional details in the question never hurts... The above answer is as perfect as the question, we can't drop everything on this answer, that's what I wanted to say with previous comment. That's a really minor detail, we have not to discuss it further on this thread I think. the main thing is that question is answered now. From me +1 both of you. I add a note to the question, feel free to edit it if you like.

Temur
on 9/25/15, 9:34 AM

i can't edit because karma, just comment ! I agree with your after your explanations : I added a point to your response. New question: what's [meta] ?

Maurice Agée
on 9/25/15, 10:26 AM

I do not know for sure how and why, but [meta] is usually added to the posts that are not directly related to odoo functionality, but related to this forum site, etc... you can search this forum using [meta] search term and you can see examples...

Temur
on 9/26/15, 6:58 AM
2

Temur

--Temur--
2896
| 6 5 7
Tbilisi, Georgia
--Temur--
Programmer
Temur
On 9/25/15, 6:24 AM

What concerns to comments, you can use HTML stuff there, in order to format your answer, like this:

<p>Following code is <b>indented</b> in the comment:</p>

<pre>
class Adam:

    def foo(self):
        print " === Foo === " return self

    def bar(self):
        print " === Bar ===" return self def bye(self): print " = Bye! ="
</pre>
Use Case:
<pre>
Adam().foo().bar().foo().bar().bye()
</pre>

So, you can do code formatting in comments using PRE HTML tag...

See the comment below posted with above code:


Following code is indented in the comment:

class Adam:
    
    def foo(self):
        print " === Foo === "
        return self
    
    def bar(self):
        print " === Bar ==="
        return self
    
    def bye(self):
        print " =   Bye!  ="
Use Case:
Adam().foo().bar().foo().bar().bye()
Temur
on 9/25/15, 6:52 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 9/21/15, 4:56 AM
Seen: 514 times
Last updated: 9/25/15, 9:36 AM