There are several ways you can add and extra attribute to a class. If its an attribute which can be calculated only once and used as a read-only from then onwards, I suggest using the property decorator.
For example:
@property
def foo(self):
bar = do_some_calculation()
return bar
But this will not be feasible for cases where you want to check the count of a certain type of object, because it will be changing over time.
Manager functions should be used to return a set of objects. If you want to return a boolean value indicating the whether a post has more than 4 comments, you can add a function to the model:
def more_than_4_replies(self):
return self.objects.count() > 4
And you can also use aggregation to annotate the object set you pass into template and use an enhanced if tag like smart-if or pyif.