# Path: flowcelltool/users/models.py
# class User(AbstractUser):
# 
#     # First Name and Last Name do not cover name patterns
#     # around the globe.
#     name = models.CharField(_('Name of User'), blank=True, max_length=255)
# 
#     def __str__(self):
#         return self.username
# 
#     def get_absolute_url(self):
#         return reverse('profile:view')
# 
# Path: flowcelltool/threads/models.py
# class Message(UuidStampedMixin, TimeStampedModel):
#     """A message that is written by a user"""
# 
#     # Messages related to a "thread" items on
#     content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
#     object_id = models.PositiveIntegerField()
#     thread_object = GenericForeignKey('content_type', 'object_id')
# 
#     author = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
# 
#     title = models.CharField(
#         blank=True, null=True, max_length=200,
#         help_text='Optional title for the message')
#     body = models.TextField(blank=True, null=True, help_text='Your message')
# 
#     mime_type = models.CharField(max_length=50, default='text/plain',
#                                  choices=FORMAT_CHOICES)
# 
#     # Permissions -------------------------------------------------------------
# 
#     # The boilerplate below ("DRY permissions") hooks up the DRY REST permission system into our
#     # django-rules based system.
# 
#     @staticmethod
#     def has_None_permission(request):
#         # TODO: why do we need this? Only for the automatically generated UI?
#         return False
# 
#     @staticmethod
#     def has_read_permission(request):
#         return True
# 
#     @staticmethod
#     def has_write_permission(request):
#         return True
# 
#     @staticmethod
#     def has_list_permission(request):
#         return request.user.has_perm('threads.list_message')
# 
#     @staticmethod
#     def has_create_permission(request):
#         return request.user.has_perm('threads.add_message')
# 
#     def has_object_retrieve_permission(self, request):
#         return request.user.has_perm('threads.view_message', self)
# 
#     def has_object_update_permission(self, request):
#         return request.user.has_perm('threads.change_message', self)
# 
#     def has_object_destroy_permission(self, request):
#         return request.user.has_perm('threads.delete_message', self)
# 
#     # Boilerplate str/repr ----------------------------------------------------
# 
#     def __str__(self):
#         return 'Message({}, {}, {})'.format(self.title, self.author.username,
#                                             self.body)


import uuid
from django.db import models
from django.urls import reverse
from django.core.exceptions import ValidationError
from django.contrib.postgres.fields import ArrayField, JSONField
from django.contrib.contenttypes.fields import GenericRelation
from flowcelltool.users.models import User
from django.core.validators import MinValueValidator, MaxValueValidator
from model_utils.models import TimeStampedModel
from ..threads.models import Message
from markdown_deux.templatetags.markdown_deux_tags import markdown_allowed
    run_number = models.PositiveIntegerField()

    #: The slot of the machine
    slot = models.CharField(max_length=1)

    #: The vendor ID of the flow cell name
    vendor_id = models.CharField(max_length=40)

    #: The label of the flow cell
    label = models.CharField(blank=True, null=True, max_length=100)

    #: Short description length
    description = models.TextField(
        blank=True,
        null=True,
        help_text=(
            'Short description of the flow cell ' +
            markdown_allowed()))

    #: Number of lanes on the flow cell
    num_lanes = models.IntegerField(
        default=8,
        help_text='Number of lanes on flowcell 8 for HiSeq, 4 for NextSeq')

    #: Name of the sequencing machine operator
    operator = models.CharField(
        max_length=100, verbose_name='Sequencer Operator')

    #: The user responsible for demultiplexing
    demux_operator = models.ForeignKey(

# Path: flowcelltool/users/models.py
# class User(AbstractUser):
# 
#     # First Name and Last Name do not cover name patterns
#     # around the globe.
#     name = models.CharField(_('Name of User'), blank=True, max_length=255)
# 
#     def __str__(self):
#         return self.username
# 
#     def get_absolute_url(self):
#         return reverse('profile:view')
# 
# Path: flowcelltool/threads/models.py
# class Message(UuidStampedMixin, TimeStampedModel):
#     """A message that is written by a user"""
# 
#     # Messages related to a "thread" items on
#     content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
#     object_id = models.PositiveIntegerField()
#     thread_object = GenericForeignKey('content_type', 'object_id')
# 
#     author = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
# 
#     title = models.CharField(
#         blank=True, null=True, max_length=200,
#         help_text='Optional title for the message')
#     body = models.TextField(blank=True, null=True, help_text='Your message')
# 
#     mime_type = models.CharField(max_length=50, default='text/plain',
#                                  choices=FORMAT_CHOICES)
# 
#     # Permissions -------------------------------------------------------------
# 
#     # The boilerplate below ("DRY permissions") hooks up the DRY REST permission system into our
#     # django-rules based system.
# 
#     @staticmethod
#     def has_None_permission(request):
#         # TODO: why do we need this? Only for the automatically generated UI?
#         return False
# 
#     @staticmethod
#     def has_read_permission(request):
#         return True
# 
#     @staticmethod
#     def has_write_permission(request):
#         return True
# 
#     @staticmethod
#     def has_list_permission(request):
#         return request.user.has_perm('threads.list_message')
# 
#     @staticmethod
#     def has_create_permission(request):
#         return request.user.has_perm('threads.add_message')
# 
#     def has_object_retrieve_permission(self, request):
#         return request.user.has_perm('threads.view_message', self)
# 
#     def has_object_update_permission(self, request):
#         return request.user.has_perm('threads.change_message', self)
# 
#     def has_object_destroy_permission(self, request):
#         return request.user.has_perm('threads.delete_message', self)
# 
#     # Boilerplate str/repr ----------------------------------------------------
# 
#     def __str__(self):
#         return 'Message({}, {}, {})'.format(self.title, self.author.username,
#                                             self.body)


# Path: flowcelltool/flowcells/models.py
import uuid
from django.db import models
from django.urls import reverse
from django.core.exceptions import ValidationError
from django.contrib.postgres.fields import ArrayField, JSONField
from django.contrib.contenttypes.fields import GenericRelation
from flowcelltool.users.models import User
from django.core.validators import MinValueValidator, MaxValueValidator
from model_utils.models import TimeStampedModel
from ..threads.models import Message
from markdown_deux.templatetags.markdown_deux_tags import markdown_allowed

    run_number = models.PositiveIntegerField()

    #: The slot of the machine
    slot = models.CharField(max_length=1)

    #: The vendor ID of the flow cell name
    vendor_id = models.CharField(max_length=40)

    #: The label of the flow cell
    label = models.CharField(blank=True, null=True, max_length=100)

    #: Short description length
    description = models.TextField(
        blank=True,
        null=True,
        help_text=(
            'Short description of the flow cell ' +
            markdown_allowed()))

    #: Number of lanes on the flow cell
    num_lanes = models.IntegerField(
        default=8,
        help_text='Number of lanes on flowcell 8 for HiSeq, 4 for NextSeq')

    #: Name of the sequencing machine operator
    operator = models.CharField(
        max_length=100, verbose_name='Sequencer Operator')

    #: The user responsible for demultiplexing
    demux_operator = models.ForeignKey(

        User, verbose_name='Demultiplexing Operator',