コード例 #1
0
class SourceRightsStatement(odin.Resource):
    rights_basis = odin.StringField()
    start_date = odin.DateField(null=True)
    end_date = odin.DateField(null=True)
    rights_granted = odin.ArrayOf(SourceRightsStatementAct)
    external_documents = odin.ArrayField(null=True)
    linked_agents = odin.ArrayField(null=True)
    basis_note = odin.StringField(null=True)
    copyright_status = odin.StringField(null=True)
    determination_date = odin.DateField(null=True)
    terms = odin.StringField(null=True)
    statute_citation = odin.StringField(null=True)
    other_basis = odin.StringField(null=True)
    jurisdiction = odin.StringField(null=True)
コード例 #2
0
class SourceMetadata(odin.Resource):
    date_end = odin.DateTimeField()
    date_start = odin.DateTimeField()
    internal_sender_description = odin.StringField()
    language = odin.ArrayField()
    payload_oxum = odin.StringField()
    record_creators = odin.ArrayOf(SourceCreator)
    source_organization = odin.StringField()
    title = odin.StringField()
コード例 #3
0
class SourceNote(odin.Resource):
    """Human-readable note.

    SourceNotes contain one or more SourceSubnotes.
    """
    jsonmodel_type = odin.StringField()
    type = odin.StringField(null=True)
    label = odin.StringField(null=True)
    subnotes = odin.ArrayOf(SourceSubnote, null=True)
    content = odin.StringField(null=True)
    items = odin.ArrayField(null=True)
    publish = odin.BooleanField()
コード例 #4
0
ファイル: resources.py プロジェクト: python-odin/odinweb
class Listing(odin.Resource):
    """
    Response for listing results. THis includes offset and count support for
    paging etc.

    """
    class Meta:
        namespace = None

    results = odin.ArrayField(help_text="List of resources.")
    limit = odin.IntegerField(null=True,
                              help_text="Limit or page size of the result set")
    offset = odin.IntegerField(default=0,
                               help_text="Offset within the result set.")
    total_count = odin.IntegerField(
        null=True, help_text="The total number of items in the result set.")
コード例 #5
0
class Listing(odin.Resource):
    """
    Response for listing results. This includes offset, count support for
    paging etc.

    """
    class Meta:
        namespace = None

    # Wrapper to provide code completion
    def __init__(self, results, limit, offset=0, total_count=None):
        super(Listing, self).__init__(results, limit, offset, total_count)

    results = odin.ArrayField(help_text="The list of resources.")
    limit = odin.IntegerField(
        help_text="The resource limit in the result set.")
    offset = odin.IntegerField(default=0,
                               help_text="The offset within the result set.")
    total_count = odin.IntegerField(
        null=True, help_text="The total number of items in the result set.")
コード例 #6
0
class SourceAgentBase(odin.Resource):
    """A base class for agents.

    Subclassed by SourceAgentFamily, SourceAgentPerson and
    SourceAgentCorporateEntity.
    """
    class Meta:
        abstract = True

    AGENT_TYPES = (('agent_corporate_entity', 'Organization'),
                   ('agent_family', 'Family'), ('agent_person', 'Person'))

    agent_record_identifiers = odin.ArrayOf(SourceAgentRecordIdentifier,
                                            null=True)
    dates_of_existence = odin.ArrayField(null=True)
    group = odin.DictAs(SourceGroup)
    jsonmodel_type = odin.StringField(choices=AGENT_TYPES)
    notes = odin.ArrayOf(SourceNote)
    publish = odin.BooleanField()
    title = odin.StringField()
    uri = odin.StringField()
コード例 #7
0
class Object(BaseResource):
    """An aggregation of archival records.

    Objects may be contained within Collections, but do not contain other
    Objects or Collections. Object is a first-class entity in the RAC data model.
    """
    type = odin.StringField(default="object")
    category = odin.StringField(default="collection")
    dates = odin.ArrayOf(Date)
    languages = odin.ArrayOf(Language)
    extents = odin.ArrayOf(Extent)
    notes = odin.ArrayOf(Note)
    people = odin.ArrayOf(AgentReference)
    organizations = odin.ArrayOf(AgentReference)
    families = odin.ArrayOf(AgentReference)
    terms = odin.ArrayOf(TermReference)
    ancestors = odin.ArrayOf(RecordReference, null=True)
    parent = odin.StringField()
    position = odin.IntegerField()
    formats = odin.ArrayField()
    online = odin.BooleanField(default=False)
コード例 #8
0
class ArchivesSpaceComponentBase(odin.Resource):
    """Base class for components, which describe groups of archival records."""
    class Meta:
        abstract = True

    COMPONENT_TYPES = (
        ('archival_object', 'Archival Object'),
        ('accession', 'Accession'),
    )

    dates = odin.ArrayOf(ArchivesSpaceDate)
    extents = odin.ArrayOf(ArchivesSpaceExtent)
    external_ids = odin.ArrayOf(ArchivesSpaceExternalId)
    instances = odin.ArrayField(null=True)
    jsonmodel_type = odin.StringField(choices=COMPONENT_TYPES)
    lang_materials = odin.ArrayOf(ArchivesSpaceLangMaterial, null=True)
    linked_agents = odin.ArrayOf(ArchivesSpaceLinkedAgent)
    notes = odin.ArrayOf(ArchivesSpaceNote)
    publish = odin.BooleanField(default=False)
    repository = odin.DictField(default={"ref": "/repositories/{}".format(settings.ARCHIVESSPACE['repo_id'])})
    rights_statements = odin.ArrayOf(ArchivesSpaceRightsStatement)
    title = odin.StringField(null=True)
    uri = odin.StringField()
コード例 #9
0
class Collection(BaseResource):
    """An aggregation of archival records.

    Collections contain other aggregations of records (either Objects or
    Collections), and may themselves be contained within another Collection.
    Collection is a first-class entity in the RAC data model.
    """
    type = odin.StringField(default="collection")
    category = odin.StringField(default="collection")
    level = odin.StringField()
    dates = odin.ArrayOf(Date)
    creators = odin.ArrayOf(AgentReference)
    languages = odin.ArrayOf(Language)
    extents = odin.ArrayOf(Extent)
    notes = odin.ArrayOf(Note)
    people = odin.ArrayOf(AgentReference)
    organizations = odin.ArrayOf(AgentReference)
    families = odin.ArrayOf(AgentReference)
    terms = odin.ArrayOf(TermReference)
    ancestors = odin.ArrayOf(RecordReference, null=True)
    parent = odin.StringField(null=True)
    position = odin.IntegerField()
    formats = odin.ArrayField()
    online = odin.BooleanField(default=False)
コード例 #10
0
class SourceGroup(odin.Resource):
    """Information about the highest-level collection containing the data object."""
    creators = odin.ArrayOf(SourceLinkedAgent, null=True)
    dates = odin.ArrayField(null=True)
    identifier = odin.StringField()
    title = odin.StringField()
コード例 #11
0
class SourceSubnote(odin.Resource):
    """Contains note content."""
    jsonmodel_type = odin.StringField()
    content = odin.StringField(null=True)
    items = odin.ArrayField(null=True)