# Copyright (c) 2015, Xhive Global Ltd. and Contributors
# License: MIT. See LICENSE

# License: MIT. See LICENSE

import xhiveframework
from xhiveframework.model.document import Document


class BlogSettings(Document):
	def on_update(self):
		from xhiveframework.website.utils import clear_cache

		clear_cache("blog")
		clear_cache("writers")


def get_like_limit():
	return xhiveframework.db.get_single_value("Blog Settings", "like_limit") or 5


def get_comment_limit():
	return xhiveframework.db.get_single_value("Blog Settings", "comment_limit") or 5
