예제 #1
0
        returns None anf an AttributeError has to be catched
        (the method will then return False)
        """
        rv = False
        # Use parent.is_question is OK because we are sure that parent is not None
        # (parent would be None if self.is_question())
        if self.is_comment() and self.parent.is_question():
            rv = True
        return rv 

    @property
    def _askbot_ext_action(self):
        """Encapsulation of action reference"""
        return self.thread.action

Post.add_to_class('ext_noattr', PostExtension())

#--------------------------------------------------------------------------------

#TODO: place can be blank/null at creation time?
#TODO TOTHINK User.add_to_class("place", models.CharField(max_length=512))

#--------------------------------------------------------------------------------

class VoteExtension(AskbotModelExtender):

    @property
    def _askbot_ext_action(self):
        """Encapsulation of action reference"""
        return self.voted_post.action
예제 #2
0
        returns None anf an AttributeError has to be catched
        (the method will then return False)
        """
        rv = False
        # Use parent.is_question is OK because we are sure that parent is not None
        # (parent would be None if self.is_question())
        if self.is_comment() and self.parent.is_question():
            rv = True
        return rv 

    @property
    def _askbot_ext_action(self):
        """Encapsulation of action reference"""
        return self.thread.action

Post.add_to_class('ext_noattr', PostExtension())

Post.add_to_class('title', models.CharField(default='',max_length=256)
)

#--------------------------------------------------------------------------------

#TODO: place can be blank/null at creation time?
#TODO TOTHINK User.add_to_class("place", models.CharField(max_length=512))

#--------------------------------------------------------------------------------

class VoteExtension(AskbotModelExtender):

    @property
    def _askbot_ext_action(self):
예제 #3
0
        (the method will then return False)
        """
        rv = False
        # Use parent.is_question is OK because we are sure that parent is not None
        # (parent would be None if self.is_question())
        if self.is_comment() and self.parent.is_question():
            rv = True
        return rv

    @property
    def _askbot_ext_action(self):
        """Encapsulation of action reference"""
        return self.thread.action


Post.add_to_class('ext_noattr', PostExtension())

Post.add_to_class('title', models.CharField(default='', max_length=256))

#--------------------------------------------------------------------------------

#TODO: place can be blank/null at creation time?
#TODO TOTHINK User.add_to_class("place", models.CharField(max_length=512))

#--------------------------------------------------------------------------------


class VoteExtension(AskbotModelExtender):
    @property
    def _askbot_ext_action(self):
        """Encapsulation of action reference"""
예제 #4
0
        (the method will then return False)
        """
        rv = False
        # Use parent.is_question is OK because we are sure that parent is not None
        # (parent would be None if self.is_question())
        if self.is_comment() and self.parent.is_question():
            rv = True
        return rv

    @property
    def _askbot_ext_action(self):
        """Encapsulation of action reference"""
        return self.thread.action


Post.add_to_class('ext_noattr', PostExtension())

#--------------------------------------------------------------------------------

#TODO: place can be blank/null at creation time?
#TODO TOTHINK User.add_to_class("place", models.CharField(max_length=512))

#--------------------------------------------------------------------------------


class VoteExtension(AskbotModelExtender):
    @property
    def _askbot_ext_action(self):
        """Encapsulation of action reference"""
        return self.voted_post.action