# Copyright (c) 2022, JINGROW and Contributors
# License: MIT. See LICENSE


class PageStatus(int):
	def is_draft(self):
		return self == PageStatus.DRAFT

	def is_submitted(self):
		return self == PageStatus.SUBMITTED

	def is_cancelled(self):
		return self == PageStatus.CANCELLED

	# following methods have been kept for backwards compatibility

	@staticmethod
	def draft():
		return PageStatus.DRAFT

	@staticmethod
	def submitted():
		return PageStatus.SUBMITTED

	@staticmethod
	def cancelled():
		return PageStatus.CANCELLED


PageStatus.DRAFT = PageStatus(0)
PageStatus.SUBMITTED = PageStatus(1)
PageStatus.CANCELLED = PageStatus(2)
