# Path: beavy/models/object.py
# class Object(db.Model):
#     """
#     This is the primary base class for all kind of objects
#     we know of inside the system
#     """
#     @unique
#     class Capabilities(Enum):
#         # This type is to be shown in default lists
#         # like 'top', 'latest' etc
#         listed = 'listed'
# 
#         # If the type isn't listed but has `listed_for_activity`
#         # it can show up in lists about activitys, for example
#         # when an object got liked
#         listed_for_activity = 'a_listable'
# 
#         # This can be searched for
#         searchable = 'searchable'
# 
#     __tablename__ = "objects"
#     query_class = ObjectQuery
# 
#     id = db.Column(db.Integer, primary_key=True)
#     discriminator = db.Column('type', db.String(100), nullable=False)
#     created_at = db.Column('created_at', db.DateTime(), nullable=False,
#                            server_default=func.now())
#     payload = db.Column('payload', JSONB, nullable=True)
#     owner_id = db.Column(db.Integer, db.ForeignKey(User.id), nullable=False)
#     belongs_to = db.Column(db.Integer, db.ForeignKey("objects.id"),
#                            nullable=True)
#     # children = db.relationship("Object", backref=db.backref('belongs_to',
#     #                                                         remote_side=id))
# 
#     __mapper_args__ = {'polymorphic_on': discriminator}
# 
#     owner = db.relationship(User, backref=db.backref('objects'))
# 
# Path: beavy/common/rendered_text_mixin.py
# class RenderedTextMixin(object):
#     # to be used on activity or object models
# 
#     raw = PayloadProperty('raw', 'text')
#     chopped = PayloadProperty('chopped', 'text')
#     cooked = PayloadProperty('cooked', 'text')
# 
# Path: beavy/app.py
# BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# STATIC_FOLDER = os.path.join(BASE_DIR, '..', 'assets')
#     _FLBLPRE = "flask_social_blueprint.providers.{}"
# def make_env(app):
# def setup_statics(app):
#     def injnect_manifest():
# def make_celery(app):
#         def __call__(self, *args, **kwargs):
#     def login_failed_redirect(self, profile, provider):
#     def is_accessible(self):
# def _limiter_key():
# def inject_messages():
# def get_locale():
#     def ensure_users():
#     def print_routes():
#     class ContextTask(TaskBase):
# class SocialBlueprint(SocialBp):
# class BeavyAdminIndexView(AdminIndexView):


from beavy.models.object import Object
from flask_security.core import current_user
from sqlalchemy.sql import and_
from beavy.common.rendered_text_mixin import RenderedTextMixin
from beavy.app import db

COMMENT_ID = "comment"


class CommentObject(Object, RenderedTextMixin):
    __mapper_args__ = {
        'polymorphic_identity': COMMENT_ID
    }

    CAPABILITIES = [Object.Capabilities.listed_for_activity]


# Path: beavy/models/object.py
# class Object(db.Model):
#     """
#     This is the primary base class for all kind of objects
#     we know of inside the system
#     """
#     @unique
#     class Capabilities(Enum):
#         # This type is to be shown in default lists
#         # like 'top', 'latest' etc
#         listed = 'listed'
# 
#         # If the type isn't listed but has `listed_for_activity`
#         # it can show up in lists about activitys, for example
#         # when an object got liked
#         listed_for_activity = 'a_listable'
# 
#         # This can be searched for
#         searchable = 'searchable'
# 
#     __tablename__ = "objects"
#     query_class = ObjectQuery
# 
#     id = db.Column(db.Integer, primary_key=True)
#     discriminator = db.Column('type', db.String(100), nullable=False)
#     created_at = db.Column('created_at', db.DateTime(), nullable=False,
#                            server_default=func.now())
#     payload = db.Column('payload', JSONB, nullable=True)
#     owner_id = db.Column(db.Integer, db.ForeignKey(User.id), nullable=False)
#     belongs_to = db.Column(db.Integer, db.ForeignKey("objects.id"),
#                            nullable=True)
#     # children = db.relationship("Object", backref=db.backref('belongs_to',
#     #                                                         remote_side=id))
# 
#     __mapper_args__ = {'polymorphic_on': discriminator}
# 
#     owner = db.relationship(User, backref=db.backref('objects'))
# 
# Path: beavy/common/rendered_text_mixin.py
# class RenderedTextMixin(object):
#     # to be used on activity or object models
# 
#     raw = PayloadProperty('raw', 'text')
#     chopped = PayloadProperty('chopped', 'text')
#     cooked = PayloadProperty('cooked', 'text')
# 
# Path: beavy/app.py
# BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# STATIC_FOLDER = os.path.join(BASE_DIR, '..', 'assets')
#     _FLBLPRE = "flask_social_blueprint.providers.{}"
# def make_env(app):
# def setup_statics(app):
#     def injnect_manifest():
# def make_celery(app):
#         def __call__(self, *args, **kwargs):
#     def login_failed_redirect(self, profile, provider):
#     def is_accessible(self):
# def _limiter_key():
# def inject_messages():
# def get_locale():
#     def ensure_users():
#     def print_routes():
#     class ContextTask(TaskBase):
# class SocialBlueprint(SocialBp):
# class BeavyAdminIndexView(AdminIndexView):


# Path: beavy_modules/comments/models.py
from beavy.models.object import Object
from flask_security.core import current_user
from sqlalchemy.sql import and_
from beavy.common.rendered_text_mixin import RenderedTextMixin
from beavy.app import db


COMMENT_ID = "comment"


class CommentObject(Object, RenderedTextMixin):
    __mapper_args__ = {
        'polymorphic_identity': COMMENT_ID
    }

    CAPABILITIES = [Object.Capabilities.listed_for_activity]


    in_reply_to_id = db.Column(db.Integer, db.ForeignKey("objects.id"),