Пример #1
0
from .project import Project
import six

log = logging.getLogger(__name__)

# Collection definitions
ArtifactReferenceDoc = collection(
    str('artifact_reference'),
    main_doc_session,
    Field('_id', str),
    Field(
        'artifact_reference',
        dict(cls=S.Binary(),
             project_id=S.ObjectId(),
             app_config_id=S.ObjectId(),
             artifact_id=S.Anything(if_missing=None))),
    Field('references', [str], index=True),
    Index('artifact_reference.project_id'),  # used in ReindexCommand
)

ShortlinkDoc = collection(
    str('shortlink'),
    main_doc_session,
    Field('_id', S.ObjectId()),
    # index needed for from_artifact() and index_tasks.py:del_artifacts
    Field('ref_id', str, index=True),
    Field('project_id', S.ObjectId()),
    Field('app_config_id', S.ObjectId()),
    Field('link', str),
    Field('url', str),
    # used by from_links()  More helpful to have project_id first, for other
Пример #2
0
 def __init__(self, state_class):
     self.state_class = state_class
     super(DateStatesProperty,
           self).__init__(schema.Anything(required=True))
Пример #3
0
 def __init__(self):
     super(ImageProperty, self).__init__(schema.Anything(if_missing=[]))
Пример #4
0
 def __init__(self, referenced_class):
     self.referenced_class = referenced_class
     super(HoldingsWithQuantityProperty,
           self).__init__(schema.Anything(required=True))