Exemplo n.º 1
0
class Game(models.Model):
    logged_in = models.BooleanField(default=False)
    game_id = models.TextField(max_length=30)
    size = models.IntegerField(default=10)

    #Explore
    height = models.IntegerField(default=22)
    width = models.IntegerField(default=22)
    row = models.IntegerField(default=0)
    col = models.IntegerField(default=0)
    initial_pressure = models.IntegerField(default=60)
    grid = JSONField()
    pressure = JSONField(default=None)
    cost = models.IntegerField(default=0)
    budget = models.IntegerField(default=0)

    #Sub Optimal
    height_sub = models.IntegerField(default=22)
    width_sub = models.IntegerField(default=22)
    row_sub = models.IntegerField(default=0)
    col_sub = models.IntegerField(default=0)
    initial_pressure_sub = models.IntegerField(default=60)
    grid_sub = JSONField(default=None)
    pressure_sub = JSONField(default=None)
    cost_sub = models.IntegerField(default=0)
    budget_sub = models.IntegerField(default=0)

    objects = CopyManager()
Exemplo n.º 2
0
class Position(models.Model):
    PrimaryRecID = CFBIntegerField()
    PositionNo = CFBIntegerField(primary_key=True)
    AgencyNo = models.ForeignKey(Agency, on_delete=models.CASCADE)
    SubAgencyNo = CFBZeroForeignKeyField(SubAgency,
                                         null=True,
                                         on_delete=models.CASCADE)
    Title = models.CharField(max_length=150, blank=True)
    AuthorityNo = CFBIntegerField(null=True)
    ByPosition = models.BooleanField()
    ByPositionNo = CFBIntegerField(null=True)
    ByPositionDesc = models.CharField(max_length=50, blank=True)
    MayDesignate = models.BooleanField()
    IsTempTitle = models.BooleanField()
    Designee_AuthNo = CFBIntegerField(null=True)
    temp_crossid = CFBIntegerField(null=True)
    SenateConf = models.BooleanField()
    NeedsConf = models.CharField(max_length=50, blank=True)
    Statutcite = models.CharField(max_length=50, blank=True)
    Reporting_Cite = models.CharField(max_length=50, blank=True)
    Establishment_Cite = models.CharField(max_length=50, blank=True)
    CountyID = CFBIntegerField(null=True)
    CandidateDistrict = models.CharField(max_length=5, blank=True)
    NumberSlots = CFBIntegerField(null=True)
    UnlimitedSlots = models.BooleanField()
    bySeat = models.BooleanField()
    Date_Entered = CFBDateTimeField()
    Last_Updated = CFBDateTimeField()
    msrepl_tran_version = models.CharField(max_length=40, blank=True)

    position_type = models.ForeignKey(PositionType,
                                      null=True,
                                      on_delete=models.SET_NULL)
    objects = CopyManager()
Exemplo n.º 3
0
class Dbsnp(models.Model):
    """Information of the DBSNP database."""

    #: Genome build
    release = models.CharField(max_length=32)
    #: Variant coordinates - chromosome
    chromosome = models.CharField(max_length=32)
    #: Variant coordinates - 1-based start position
    start = models.IntegerField()
    #: Variant coordinates - end position
    end = models.IntegerField()
    #: Variant coordinates - UCSC Bin
    bin = models.IntegerField()
    #: Variant coordinates - reference
    reference = models.CharField(max_length=512)
    #: Variant coordinates - alternative
    alternative = models.CharField(max_length=512)
    #: DbSNPs RsID
    rsid = models.CharField(max_length=16)

    #: Allow bulk import
    objects = CopyManager()

    class Meta:
        # The uniqueness constraint will automatically add an index, no need to create a second.
        unique_together = ("release", "chromosome", "start", "reference",
                           "alternative")
Exemplo n.º 4
0
class MgiHomMouseHumanSequence(models.Model):
    """Model for mouse to human mapping. One record (row) can be either mouse or human.
    Mapping of a gene is accomplished via ``HomoloGene ID`` column, which contains the same ID in the homologous entries
    of mouse and human, respectively.
    """

    #: HomoloGene ID
    homologene_id = models.IntegerField(null=False)
    #: Common Organism Name ('human' or 'mouse, laboratory')
    common_organism_name = models.CharField(max_length=32, null=False)
    #: NCBI Taxon ID (9606 for human, 10090 for mouse)
    ncbi_taxon_id = models.CharField(max_length=16, null=False)
    #: Gene Symbol (seems to differ in capitalization between mouse gene and human homolog)
    symbol = models.CharField(max_length=32, null=False)
    #: Entrez Gene ID (differs between mouse gene and human homolog)
    entrez_id = models.CharField(max_length=16, null=False)
    #: Mouse MGI ID (only set in mouse record)
    mgi_id = models.CharField(max_length=16, null=True)
    #: HGNC ID (only set in human record)
    hgnc_id = models.CharField(max_length=16, null=True)
    #: OMIM Gene ID (only set in human record)
    omim_id = models.CharField(max_length=32, null=True)
    #: Genetic Location
    location = models.CharField(max_length=64, null=True)
    #: Genomic Coordinates
    coordinates = models.CharField(max_length=128, null=True)
    #: Nucleotide RefSeq IDs
    nucleotide_refseq_ids = ArrayField(models.CharField(max_length=16))
    #: Protein RefSeq IDs
    protein_refseq_ids = ArrayField(models.CharField(max_length=16))
    #: SwissProt IDs
    swissprot_ids = ArrayField(models.CharField(max_length=16))

    #: Allow bulk import info database.
    objects = CopyManager()
Exemplo n.º 5
0
class ExacConstraints(models.Model):
    """Exac Constraints table."""

    #: EnsEMBL transcript ID
    ensembl_transcript_id = models.CharField(max_length=16)
    #: HGNC symbol
    symbol = models.CharField(max_length=32)
    chromosome = models.CharField(max_length=32)
    n_exons = models.IntegerField()
    cds_start = models.IntegerField()
    cds_end = models.IntegerField()
    bp = models.IntegerField()
    mu_syn = models.FloatField()
    mu_mis = models.FloatField()
    mu_lof = models.FloatField()
    n_syn = models.IntegerField()
    n_mis = models.IntegerField()
    n_lof = models.IntegerField()
    exp_syn = models.FloatField()
    exp_mis = models.FloatField()
    exp_lof = models.FloatField()
    syn_z = models.FloatField()
    mis_z = models.FloatField()
    lof_z = models.FloatField()
    pLI = models.FloatField()
    pRec = models.FloatField()
    pNull = models.FloatField()

    #: Allow bulk import info database.
    objects = CopyManager()

    class Meta:
        indexes = [models.Index(fields=["ensembl_transcript_id"])]
Exemplo n.º 6
0
class User(models.Model):
    objects = CopyManager()
    user_hash = models.CharField(max_length=200)

    age = models.PositiveIntegerField(default = 0)
    gender = models.CharField(max_length=7)
    q1 = models.CharField(max_length=3)
    q2 = models.CharField(max_length=3)

    activity = models.BooleanField(default=True)
    time_stamps = ArrayField(
        models.CharField(max_length=45),
        blank=True,
        null=True,
        default=list
    )

    good_choices = models.PositiveIntegerField(default = 0)
    bad_choices = models.PositiveIntegerField(default = 0)

    choices = ArrayField(
        models.CharField(max_length=40),
        blank=True,
        null=True,
        default=list
        )



    def __str__(self):
        return(self.id_m)
Exemplo n.º 7
0
class visitors(models.Model):

    name = models.CharField(max_length=80, verbose_name="Name")
    location = models.CharField(max_length=80, verbose_name="Name")
    country = models.CharField(max_length=80, verbose_name="Name")
    email = models.CharField(max_length=80, verbose_name="Name")
    objects = CopyManager()
Exemplo n.º 8
0
class ReadCode(models.Model):
    ext_read_code = models.CharField(max_length=255)
    created_at = models.DateTimeField()
    updated_at = models.DateTimeField()
    file_path = models.CharField(max_length=255)
    concept_id = models.ForeignKey(SnomedConcept,
                                   to_field='external_id',
                                   on_delete=models.CASCADE,
                                   db_column="concept_id",
                                   null=True,
                                   related_name='readcode')
    objects = CopyManager()

    def __str__(self):
        return "{} - {}".format(self.id, self.ext_read_code)

    def is_descendant_of_snomed_concept(self,
                                        snomed_concept: SnomedConcept) -> bool:
        return self in snomed_concept.descendant_readcodes()

    def related_snomed_concepts_and_descendants(self) -> Set[SnomedConcept]:
        """
        Return snomed concepts with a FK to this readcode and all of their
        descendants.
        """
        snomed_concepts = set()
        snomed_concepts.update(
            self.concept_id.descendants(ret_descendants=set()))
        return snomed_concepts
Exemplo n.º 9
0
class Delivery(models.Model):
    match_id = models.ForeignKey(Match, on_delete=models.CASCADE)
    inning = models.IntegerField(null=False)
    batting_team = models.CharField(max_length=60, null=False)
    bowling_team = models.CharField(max_length=60, null=False)
    over = models.IntegerField(null=True)
    ball = models.IntegerField(null=True)
    batsman = models.CharField(max_length=60, null=False)
    non_striker = models.CharField(max_length=60, null=True)
    bowler = models.CharField(max_length=60, null=False)
    is_super_over = models.IntegerField(null=True)
    wide_runs = models.IntegerField(null=True)
    bye_runs = models.IntegerField(null=True)
    legbye_runs = models.IntegerField(null=True)
    noball_runs = models.IntegerField(null=True)
    penalty_runs = models.IntegerField(null=True)
    batsman_runs = models.IntegerField(null=True)
    extra_runs = models.IntegerField(null=True)
    total_runs = models.IntegerField(null=True)
    player_dismissed = models.CharField(max_length=60, null=True)
    dismissal_kind = models.CharField(max_length=60, null=True)
    fielder = models.CharField(max_length=60, null=True)
    objects = CopyManager()

    def __str__(self):
        return f'{self.match_id}, {self.batting_team} vs {self.bowling_team}, {self.over},{self.ball}'
Exemplo n.º 10
0
class ExtraAnno(models.Model):
    """Extra annotation."""
    class Meta:
        # The uniqueness constraint will automatically add an index, no need to create a second.
        unique_together = ("release", "chromosome", "start", "reference",
                           "alternative")

    #: Genome build
    release = models.CharField(max_length=32)
    #: Variant coordinates - chromosome
    chromosome = models.CharField(max_length=32)
    #: Variant coordinates - 1-based start position
    start = models.IntegerField()
    #: Variant coordinates - end position
    end = models.IntegerField()
    #: UCSC bin
    bin = models.IntegerField()
    #: Variant coordinates - reference
    reference = models.CharField(max_length=512)
    #: Variant coordinates - alternative
    alternative = models.CharField(max_length=512)
    #: Annotation data.
    anno_data = JSONField(default={})

    #: Allows bulk import
    objects = CopyManager()
Exemplo n.º 11
0
class ExacCnv(models.Model):
    """CNVs from the ExAC project.

    Note that this table stores individual CNVs that are mapped to the population that the carriers are samples
    from.  While the data is stored as BED files in the ExAC downloads, the coordinates used in the database are
    one-based.
    """

    #: Genome build
    release = models.CharField(max_length=32)
    #: Variant coordinates - chromosome
    chromosome = models.CharField(max_length=32)
    #: Variant coordinates - start position
    start = models.IntegerField()
    #: Variant coordinates - end position
    end = models.IntegerField()

    #: Interval bin from ``start`` to ``end``, automatically set in ``save()``.
    bin = models.IntegerField(default=0)

    #: SV type (always ``"CNV"``)
    sv_type = models.CharField(max_length=32)
    #: Population of individual
    population = models.CharField(max_length=3, choices=EXAC_POP_CHOICES)
    #: Phred score of the variant
    phred_score = models.IntegerField()

    #: Allow bulk import
    objects = CopyManager()

    class Meta:
        indexes = [models.Index(fields=["release", "chromosome", "bin"])]
Exemplo n.º 12
0
class Match(models.Model):
    class Meta:
        unique_together = ['season', 'team1', 'team2', 'date']

    season = models.PositiveIntegerField(null=True)
    city = models.CharField(max_length=200, null=True)
    date = models.DateField(auto_now=False, auto_now_add=False, null=True)
    team1 = models.CharField(max_length=100, null=True)
    team2 = models.CharField(max_length=100, null=True)
    toss_winner = models.CharField(max_length=50, null=True)
    toss_decision = models.CharField(max_length=50, null=True)
    result = models.CharField(max_length=50, null=True)
    dl_applied = models.PositiveIntegerField(null=True)
    winner = models.CharField(max_length=50, null=True)
    win_by_runs = models.PositiveIntegerField(null=True)
    win_by_wickets = models.PositiveIntegerField(null=True)
    player_of_match = models.CharField(max_length=50, null=True)
    venue = models.CharField(max_length=50, null=True)
    umpire1 = models.CharField(max_length=50, null=True)
    umpire2 = models.CharField(max_length=50, null=True)
    umpire3 = models.CharField(max_length=50, null=True)
    objects = CopyManager()

    def __str__(self):
        return f'{self.season} => {self.winner}'
Exemplo n.º 13
0
class GeneralData(models.Model):
    """ Model to save COVID data completely """
    province_state = models.CharField(max_length=200,
                                      null=True,
                                      blank=True,
                                      verbose_name='Province/State')
    country_region = models.CharField(max_length=200,
                                      verbose_name='Country/Region')
    last_update = models.DateTimeField(verbose_name='Last Update')
    confirmed = models.FloatField(null=True, blank=True)
    deaths = models.FloatField(null=True, blank=True)
    recovered = models.FloatField(null=True, blank=True)
    suspected = models.FloatField(null=True, blank=True)
    confn_susp = models.FloatField(null=True,
                                   blank=True,
                                   verbose_name='Confirmed/Suspected')
    latitude = models.FloatField(null=True, blank=True)
    longitude = models.FloatField(null=True, blank=True)
    report_day = models.DateField(null=True, blank=True)
    data_file_id = models.IntegerField(null=True, blank=True)

    objects = CopyManager()

    def __str__(self):
        return '{0} - {1}'.format(self.country_region, self.province_state)
Exemplo n.º 14
0
class Deliveries(models.Model):
    class Meta:
        db_table = "deliveries"

    match_id = models.ForeignKey(Matches,
                                 related_name='deliveries',
                                 on_delete=models.CASCADE)
    inning = models.IntegerField()
    batting_team = models.CharField(max_length=50)
    bowling_team = models.CharField(max_length=50)
    over = models.IntegerField()
    ball = models.IntegerField()
    batsman = models.CharField(max_length=50)
    non_striker = models.CharField(max_length=50, null=True)
    bowler = models.CharField(max_length=50)
    is_super_over = models.IntegerField()
    wide_runs = models.IntegerField()
    bye_runs = models.IntegerField()
    legbye_runs = models.IntegerField()
    noball_runs = models.IntegerField()
    penalty_runs = models.IntegerField()
    batsman_runs = models.IntegerField()
    extra_runs = models.IntegerField()
    total_runs = models.IntegerField()
    player_dismissed = models.CharField(max_length=50, null=True)
    dismissal_kind = models.CharField(max_length=50, null=True)
    fielder = models.CharField(max_length=50, null=True)

    objects = CopyManager()
Exemplo n.º 15
0
class HgmdPublicLocus(models.Model):
    """Representation of an interval on the genome that has a HGMD_PUBLIC annotation.

    The positions are 0-based as this comes from a BED file.
    """

    #: The genome release, e.g., ``"GRCh37"``.
    release = models.CharField(max_length=32)
    #: The chromosomal, e.g., ``"1"``.
    chromosome = models.CharField(max_length=32)
    #: The start position, 0-based.
    start = models.IntegerField()
    #: The end position, 0-based.
    end = models.IntegerField()
    #: The UCSC bin.
    bin = models.IntegerField()
    #: The ``variation_name`` column from ENSEMBL variation table.
    variation_name = models.CharField(max_length=32)

    #: Enable bulk-import.
    objects = CopyManager()

    class Meta:
        indexes = [
            models.Index(fields=["release", "chromosome", "start", "end"])
        ]

    def __str__(self):
        """String representation, e.g., used in Django admin."""
        values = (self.release, self.chromosome, self.start, self.end,
                  self.variation_name)
        return "HgmdPublicLocus({})".format(", ".join(map(repr, values)))
Exemplo n.º 16
0
class KnowngeneAA(models.Model):
    """Information of KnownGeneExonAA track from UCSC genome browser."""

    #: Genome build
    release = models.CharField(max_length=32)
    #: Variant coordinates - chromosome
    chromosome = models.CharField(max_length=16)
    #: Variant coordinates - start
    start = models.IntegerField()
    #: Variant coordinates - end
    end = models.IntegerField()
    #: UCSC bin
    bin = models.IntegerField()
    #: Transcript ID in UCSC format
    transcript_id = models.CharField(max_length=16)
    #: Transcript ID in UCSC format \wo version
    transcript_id_novers = models.CharField(max_length=16, null=True)
    #: Multiple AA alignment of 100 species (multiz)
    alignment = models.CharField(max_length=100)

    #: Allows bulk import
    objects = CopyManager()

    class Meta:
        unique_together = ("release", "chromosome", "start", "end",
                           "transcript_id")

        indexes = [
            models.Index(fields=["release", "chromosome", "start", "end"]),
            models.Index(fields=["transcript_id_novers"]),
        ]
Exemplo n.º 17
0
class Employees(models.Model):

    Department_CHOICES = [
        ('employee', 'employee'),
        ('FINANCE', 'FINANCE'),
        ('HR', 'HR'),
        ('MARKETING', 'MARKETING'),
        ('OPERATIONS', 'OPERATIONS'),
        ('R%D', 'R%D'),
    ]

    first_name = models.CharField(max_length=60)
    last_name = models.CharField(max_length=60)
    employee_id = models.CharField(max_length=10)
    department = models.CharField(choices=Department_CHOICES, max_length=25)
    contract = models.CharField(max_length=60, null=True)
    updated = models.DateTimeField(auto_now=True)
    phone_number = models.PositiveIntegerField(unique=True)
    email_address = models.EmailField(max_length=60)
    objects = CopyManager()

    def __str__(self):
        return self.first_name

    def get_absolute_url(self):
        return reverse('employees:detail', kwargs={'pk': self.pk})
Exemplo n.º 18
0
class Delivery(models.Model):
    class Meta:
        unique_together = ['match', 'batting_team', 'bowling_team']

    match = models.ForeignKey(Match, on_delete=models.CASCADE)
    inning = models.PositiveIntegerField()
    batting_team = models.CharField(max_length=100)
    bowling_team = models.CharField(max_length=100)
    over = models.PositiveIntegerField()
    ball = models.PositiveIntegerField()
    batsman = models.CharField(max_length=100, null=True)
    non_striker = models.CharField(max_length=100, null=True)
    bowler = models.CharField(max_length=100, null=True)
    is_super_over = models.PositiveIntegerField()
    wide_runs = models.PositiveIntegerField()
    bye_runs = models.PositiveIntegerField()
    legbye_runs = models.PositiveIntegerField()
    noball_runs = models.PositiveIntegerField()
    penalty_runs = models.PositiveIntegerField()
    batsman_runs = models.PositiveIntegerField()
    extra_runs = models.PositiveIntegerField()
    total_runs = models.PositiveIntegerField()
    player_dismissed = models.CharField(max_length=50, null=True)
    dismissal_kind = models.CharField(max_length=50, null=True)
    fielder = models.CharField(max_length=50, null=True)
    objects = CopyManager()
Exemplo n.º 19
0
class SnomedDescendant(models.Model):
    descendant_external_id = models.ForeignKey(
        SnomedConcept,
        to_field='external_id',
        on_delete=models.CASCADE,
        db_column="descendant_external_id",
        null=True,
        related_name='descendant_external_id')
    external_id = models.ForeignKey(SnomedConcept,
                                    to_field='external_id',
                                    on_delete=models.CASCADE,
                                    db_column="external_id",
                                    null=True,
                                    related_name='external_ids')
    objects = CopyManager()

    def __str__(self):
        return "{} - {} - {}".format(
            self.id, self.descendant_external_id.fsn_description,
            self.external_id)

    class Meta:
        indexes = [
            models.Index(fields=['external_id']),
        ]
Exemplo n.º 20
0
class ULBdata(models.Model):
    CHOICES = [(i, i) for i in range(2)]
    Time = models.FloatField()
    V1 = models.FloatField()
    V2 = models.FloatField()
    V3 = models.FloatField()
    V4 = models.FloatField()
    V5 = models.FloatField()
    V6 = models.FloatField()
    V7 = models.FloatField()
    V8 = models.FloatField()
    V9 = models.FloatField()
    V10 = models.FloatField()
    V11 = models.FloatField()
    V12 = models.FloatField()
    V13 = models.FloatField()
    V14 = models.FloatField()
    V15 = models.FloatField()
    V16 = models.FloatField()
    V17 = models.FloatField()
    V18 = models.FloatField()
    V19 = models.FloatField()
    V20 = models.FloatField()
    V21 = models.FloatField()
    V22 = models.FloatField()
    V23 = models.FloatField()
    V24 = models.FloatField()
    V25 = models.FloatField()
    V26 = models.FloatField()
    V27 = models.FloatField()
    V28 = models.FloatField()
    Amount = models.FloatField()
    Class = models.IntegerField(choices=CHOICES)
    objects = CopyManager()
Exemplo n.º 21
0
class ImageNameCrawlerTask(models.Model):
    keyword = models.CharField(max_length=32, primary_key=True)
    last_sent = models.DateTimeField(default=None, blank=True, null=True)
    complete = models.BooleanField(default=False)
    image_count = models.IntegerField(null=True)
    error_response = models.TextField(blank=True, null=True)

    objects = CopyManager()

    def update_last_sent(self):
        self.refresh_from_db()
        self.last_sent = timezone.now()
        self.save()

    def __str__(self):
        return self.keyword

    def to_dict(self):
        return {
            'keyword': self.keyword,
            'last_sent': self.last_sent,
            'complete': self.complete,
            'image_count': self.image_count,
            'error_response': self.error_response
        }

    def to_task_dict(self):
        return {'keyword': self.keyword}
Exemplo n.º 22
0
class ChangedFile(models.Model):
    changedfile_id = models.AutoField(primary_key=True)
    repo_id = models.IntegerField(blank=True, null=True)
    commit_sha = models.CharField(max_length=128)
    filename = models.TextField(blank=True, null=True)
    status = models.CharField(max_length=64, blank=True, null=True)
    additions_count = models.IntegerField(blank=True, null=True)
    deletions_count = models.IntegerField(blank=True, null=True)
    changes_count = models.IntegerField(blank=True, null=True)
    patch = models.TextField(blank=True, null=True)

    objects = CopyManager()

    def __unicode__(self):
        return self.changedfile_id

    def get_id(self):
        return self.changedfile_id

    def __str__(self):
        return self.__unicode__()

    def to_dict(self):
        return {
            'changedfile_id': self.changedfile_id,
            'commit_sha': self.commit_sha,
            'filename': self.filename,
            'status': self.status,
            'additions_count': self.additions_count,
            'deletions_count': self.deletions_count,
            'changes_count': self.changes_count,
            'patch': self.patch
        }
Exemplo n.º 23
0
class Party(models.Model):
    """
        A party consists of one or more guests.
        """
    name = models.CharField(max_length=50, primary_key=True)
    email = models.EmailField(
        verbose_name='email address',
        max_length=255,
    )
    save_the_date_sent = models.DateTimeField(null=True, default=None)
    is_invited = models.BooleanField(null=True, blank=True, default=False)
    is_attending = models.NullBooleanField(null=True, blank=True, default=None)
    category = models.CharField(max_length=20, null=True, blank=True)
    invitation_id = models.UUIDField(default=uuid.uuid4,
                                     editable=False,
                                     unique=True)
    invitation_sent = models.DateTimeField(null=True, blank=True, default=None)
    invitation_opened = models.DateTimeField(null=True,
                                             blank=True,
                                             default=None)
    rehearsal_dinner = models.BooleanField(null=True,
                                           blank=True,
                                           default=False)
    comments = models.TextField(null=True, blank=True)
    objects = CopyManager()

    def __str__(self):
        return self.name
Exemplo n.º 24
0
class Order(models.Model):
    Id = models.IntegerField(primary_key=True)
    created_at = models.DateTimeField()
    order_name = models.CharField(max_length=100)
    user_id = models.ForeignKey('Customer', on_delete=models.CASCADE)
    amount = models.FloatField()
    objects = CopyManager()
Exemplo n.º 25
0
class Customer(models.Model):
    user_id = models.CharField(max_length=100, primary_key=True)
    login = models.CharField(max_length=100)
    password = models.CharField(max_length=100)
    name = models.CharField(max_length=100)
    company_id = models.OneToOneField("Company", on_delete=models.CASCADE)
    credit_cards = ArrayField(models.CharField(max_length=100), blank=True)
    objects = CopyManager()
Exemplo n.º 26
0
class PersonImport(models.Model):
    name = models.CharField(max_length=500)
    number = models.IntegerField(null=True)
    date = models.DateField(null=True)
    objects = CopyManager()

    class meta:
        db_table = "polls_person_import"
Exemplo n.º 27
0
class Rarity(models.Model):
    type_rarity = models.CharField(unique=True,
                                   max_length=15,
                                   blank=True,
                                   null=True)
    cost_create = models.IntegerField()
    cost_destruct = models.IntegerField()
    objects = CopyManager()
Exemplo n.º 28
0
class Tag(models.Model):
    id = models.AutoField(primary_key=True)
    image_name = models.CharField(max_length=512, blank=False, null=False)
    tag_name = models.CharField(max_length=512, blank=True, null=True)
    full_size = models.BigIntegerField(blank=True, null=True)
    last_updated = models.DateTimeField(blank=True, null=True)
    last_updater_username = models.CharField(max_length=64,
                                             blank=True,
                                             null=True)
    last_updater_id = models.CharField(max_length=128, blank=True, null=True)
    creator_id = models.CharField(max_length=128, blank=True, null=True)
    tag_id = models.CharField(max_length=128, blank=True, null=True)
    architecture = models.CharField(max_length=64, blank=True, null=True)
    features = models.CharField(max_length=512, blank=True, null=True)
    variant = models.CharField(max_length=512, blank=True, null=True)
    digest_sha = models.CharField(max_length=128, blank=True, null=True)
    os = models.CharField(max_length=64, blank=True, null=True)
    os_features = models.CharField(max_length=512, blank=True, null=True)
    os_version = models.CharField(max_length=512, blank=True, null=True)
    image_size = models.BigIntegerField(blank=True, null=True)
    repository_id = models.CharField(max_length=128, blank=True, null=True)
    image_id = models.CharField(max_length=128, blank=True, null=True)
    v2 = models.BooleanField(blank=True, null=True)

    objects = CopyManager()

    def __unicode__(self):
        return self.image_name

    def __str__(self):
        return self.__unicode__()

    def get_id(self):
        return self.id

    def to_dict(self):
        return {
            'id': self.id,
            'image_name': self.image_name,
            'tag_name': self.tag_name,
            'full_size': self.full_size,
            'last_updated': self.last_updated,
            'last_updater_username': self.last_updater_username,
            'last_updater_id': self.last_updater_id,
            'creator_id': self.creator_id,
            'tag_id': self.tag_id,
            'architecture': self.architecture,
            'features': self.features,
            'variant': self.variant,
            'digest_sha': self.digest_sha,
            'os': self.os,
            'os_features': self.os_features,
            'os_version': self.os_version,
            'image_size': self.image_size,
            'repository_id': self.repository_id,
            'image_id': self.image_id,
            'v2': self.v2
        }
Exemplo n.º 29
0
class Clinvar(models.Model):
    """Model for the clinvar information

    For more information on the fields, check out:
    https://www.ncbi.nlm.nih.gov/clinvar/docs/help/
    """

    #: Genome build
    release = models.CharField(max_length=32)
    #: Variant coordinates - chromosome
    chromosome = models.CharField(max_length=32)
    #: Variant coordinates - 1-based start position
    start = models.IntegerField()
    #: Variant coordinates - end position
    end = models.IntegerField()
    #: Variant coordinates - UCSC bin
    bin = models.IntegerField()
    #: Variant coordinates - reference
    reference = models.CharField(max_length=512)
    #: Variant coordinates - alternative
    alternative = models.CharField(max_length=512)
    #: Type of variation
    variation_type = models.CharField(max_length=16)
    #: The symbols.
    symbols = ArrayField(base_field=models.CharField(max_length=32), size=None)
    #: The HGNC IDs.
    hgnc_ids = ArrayField(base_field=models.CharField(max_length=32),
                          size=None)
    #: The variant accession
    vcv = models.CharField(max_length=32)
    #: The point_rating
    point_rating = models.IntegerField()
    #: The pathogenicity.
    pathogenicity = models.CharField(max_length=128)
    #: The review_status.
    review_status = models.CharField(max_length=128)
    #: The pathogenicity summary.
    pathogenicity_summary = models.CharField(max_length=128)
    #: The structured Details information.
    details = JSONField()

    #: Allows bulk import
    objects = CopyManager()

    @property
    def clinvar_sets(self):
        if not hasattr(self, "_clinvar_sets"):
            self._clinvar_sets = tuple(
                [ClinVarSet.from_json(elem) for elem in self.details])
        return self._clinvar_sets

    class Meta:
        indexes = [
            models.Index(fields=[
                "release", "chromosome", "start", "reference", "alternative"
            ])
        ]
Exemplo n.º 30
0
class PythonSnippet(models.Model):
    original_id = models.IntegerField(blank=False, null=False, unique=True)
    post_id = models.IntegerField(blank=False, null=False)
    pred_post_block_version_id = models.IntegerField(blank=True, null=True)
    root_post_block_version_id = models.IntegerField(blank=False, null=False)
    length = models.IntegerField(blank=False, null=False)
    line_count = models.IntegerField(blank=False, null=False)
    tags = models.CharField(max_length=2048, blank=False, null=False)
    content = models.TextField(blank=False, null=False)
    last_process_sent_p2 = models.DateTimeField(default=None, blank=True, null=True)
    last_process_sent_p3 = models.DateTimeField(default=None, blank=True, null=True)
    python2_result = models.TextField(blank=True, null=True)
    python3_result = models.TextField(blank=True, null=True)
    execution_time_p2 = models.FloatField(blank=True, null=True)
    execution_time_p3 = models.FloatField(blank=True, null=True)
    status_code_p2 = models.IntegerField(blank=True, null=True)
    status_code_p3 = models.IntegerField(blank=True, null=True)
    last_update = models.DateTimeField(auto_now=True)

    objects = CopyManager()

    def update_last_process_p2(self):
        self.refresh_from_db()
        self.last_process_sent_p2 = timezone.now()
        self.save()

    def update_last_process_p3(self):
        self.refresh_from_db()
        self.last_process_sent_p3 = timezone.now()
        self.save()

    def __unicode__(self):
        return '{} - {}'.format(self.id, self.original_id)

    def __str__(self):
        return self.__unicode__()

    def to_dict(self):
        return {
            'pk': self.id,
            'original_id': self.original_id,
            'post_id': self.post_id,
            'pred_post_block_version_id': self.pred_post_block_version_id,
            'root_post_block_version_id': self.root_post_block_version_id,
            'length': self.length,
            'line_count': self.line_count,
            'tags': self.tags,
            'content': self.content,
            'last_process_sent_p2': self.last_process_sent_p2,
            'last_process_sent_p3': self.last_process_sent_p3,
            'python2_result': self.python2_result,
            'python3_result': self.python3_result,
            'execution_time_p2': self.execution_time_p2,
            'execution_time_p3': self.execution_time_p3,
            'status_code_p2': self.status_code_p2,
            'status_code_p3': self.status_code_p3,
        }