from odoo import models, fields


class KnowledgePageHighlight(models.Model):
    _name = 'knowledge.page.highlight'
    _description = 'Knowledge Page Highlight'

    name = fields.Char(string='Name', required=True, translate=True)
    code = fields.Char(string='Code', required=True, help="Unique code to identify the highlight.")
    color = fields.Integer(string='Color Index')
    active = fields.Boolean(default=True)

    _sql_constraints = [
        ('unique_name', 'unique(name)', 'Tags name must me unique'),
        ('unique_code', 'unique(code)', 'Tags code must me unique'),
    ]
