from django.db import models
from netbox.models import PrimaryModel  


class TagidCustomField(models.Model):
    tag_id = models.OneToOneField(
        to = 'extras.CustomField',
        on_delete= models.CASCADE,
         related_name="tagid_config"
    )
    
    prefix = models.CharField(max_length=64, blank=True, default='')
    suffix = models.CharField(max_length=64, blank=True, default='')
    length = models.IntegerField(default=6)
    printer_name = models.CharField(max_length=64, blank=True, default='')
    cups_host = models.CharField(max_length=64, blank=True, default='')
    printer_opt = models.CharField(max_length=64, blank=True, default='')
    printer_count = models.IntegerField(default=1)

    def __str__(self):
        return f"TagID cfg for CF {self.tag_id_id}"