# Copyright (c) 2015, InfluxFramework LLC
# License: MIT. See LICENSE

# License: MIT. See LICENSE

import influxframework
from influxframework.model.document import Document


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

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


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


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