# Path: _helpers.py
# ONLINE_LAST_MINUTES = 5
# def force_int(value,default=1):
#     def block_code(self,text,lang):
# def fill_with_user(items):
# def fill_with_node(items):
# def fill_object(items,objects,*args,**kwargs):
# def _add_attr(item,objects_dict,arg,kwargs):
# def mark_online(user_id):
# def get_online_users():
# class BleepRenderer(HtmlRenderer,SmartyPants):
# class MaxinObject(object):


from datetime import datetime
from werkzeug import generate_password_hash,check_password_hash
from _helpers import db
from flask.ext.login import UserMixin
# coding:utf-8

#from run import db

class Node(db.Model):
    __tablename__ = "nodes"
    id = db.Column(db.Integer,primary_key = True)
    title = db.Column(db.String(120),unique=True)
    description = db.Column(db.String)
    topics = db.relationship("Topic",backref="node",lazy="joined")
    
    @property
    def post_count(self):
        return Post.query.filter(Topic.node_id == self.id).filter(Post.topic_id == Topic.node_id).count()


# Path: _helpers.py
# ONLINE_LAST_MINUTES = 5
# def force_int(value,default=1):
#     def block_code(self,text,lang):
# def fill_with_user(items):
# def fill_with_node(items):
# def fill_object(items,objects,*args,**kwargs):
# def _add_attr(item,objects_dict,arg,kwargs):
# def mark_online(user_id):
# def get_online_users():
# class BleepRenderer(HtmlRenderer,SmartyPants):
# class MaxinObject(object):


# Path: lolipop/models.py
from datetime import datetime
from werkzeug import generate_password_hash,check_password_hash
from _helpers import db
from flask.ext.login import UserMixin

# coding:utf-8

#from run import db

class Node(db.Model):
    __tablename__ = "nodes"
    id = db.Column(db.Integer,primary_key = True)
    title = db.Column(db.String(120),unique=True)
    description = db.Column(db.String)
    topics = db.relationship("Topic",backref="node",lazy="joined")
    
    @property
    def post_count(self):
        return Post.query.filter(Topic.node_id == self.id).filter(Post.topic_id == Topic.node_id).count()


    @property