Last active
December 4, 2015 02:44
-
-
Save zhangchunlin/d850834b0abf2663c746 to your computer and use it in GitHub Desktop.
linci.artifact models
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
#coding=utf-8 | |
from uliweb.orm import * | |
import logging | |
log = logging.getLogger('linci.artifact') | |
class LinciArtifact(Model): | |
#artifact id = "%s-%s"%(asite,aindex) | |
#artifact site | |
asite = Field(str) | |
#artifact index | |
aindex = Field(int) | |
#artifact type | |
type = Field(int) | |
#project | |
project = Field(str) | |
#artifact status | |
status = Field(int, choices=get_var('LINCI/ARTIFACT_STATUS')) | |
released = Field(bool, default= False) | |
removed = Field(bool, default= False) | |
#create date | |
cdate = Field(datetime.datetime, auto_now_add=True) | |
#ext properties | |
extprops = Field(JSON, default={}) | |
class LinciArtifactProperty(Model): | |
artifact = Reference("linciartifact", nullable=False, collection_name='props') | |
key = Field(str, index=True) | |
value = Field(str) | |
class LinciArtifactFile(Model): | |
artifact = Reference("linciartifact", nullable=False, collection_name='files') | |
#relative path | |
path = Field(str) | |
#size in bytes | |
size = Field(int) | |
md5 = Field(str) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[LINCI] | |
ARTIFACT_STATUS = [ | |
(1, 'updating'), | |
(2, 'fixed'), | |
(3, 'released'), | |
] | |
ARTIFACT_STATUS_UPDATING = 1 | |
ARTIFACT_STATUS_FIXED = 2 | |
ARTIFACT_STATUS_RELEASED = 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment