Example #1
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()
Example #2
0
class Date(odin.Resource):
    """Records the dates associated with an aggregation of archival records."""
    begin = odin.DateTimeField()
    end = odin.DateTimeField()
    expression = odin.StringField()
    type = odin.StringField(choices=configs.DATE_TYPE_CHOICES)
    label = odin.StringField(choices=configs.DATE_LABEL_CHOICES)
    source = odin.StringField(null=True,
                              default='archivesspace',
                              choices=configs.SOURCE_CHOICES)
Example #3
0
class SourceAccession(odin.Resource):
    title = odin.StringField()
    url = odin.StringField()
    extent_size = odin.IntegerField()
    extent_files = odin.IntegerField()
    start_date = odin.DateTimeField()
    end_date = odin.DateTimeField()
    organization = odin.StringField()
    rights_statements = odin.ArrayOf(SourceRightsStatement)
    creators = odin.ArrayOf(SourceCreator)
    resource = odin.StringField()
    accession_date = odin.StringField()
    access_restrictions = odin.StringField()
    use_restrictions = odin.StringField()
    acquisition_type = odin.StringField()
    description = odin.StringField()
    appraisal_note = odin.StringField(null=True)
    accession_number = odin.StringField(null=True)
    language = odin.StringField()
    linked_agents = odin.ArrayOf(SourceLinkedCreator, null=True)
    level = odin.StringField(null=True)
Example #4
0
class OldBook(LibraryBook):
    name = odin.StringField(key=True)
    num_pages = odin.IntegerField()
    price = odin.FloatField()
    genre = odin.StringField(key=True,
                             choices=(
                                 ('sci-fi', 'Science Fiction'),
                                 ('fantasy', 'Fantasy'),
                                 ('biography', 'Biography'),
                                 ('others', 'Others'),
                                 ('computers-and-tech',
                                  'Computers & technology'),
                             ))
    published = odin.DateTimeField()
    author = odin.ObjectAs(Author)
    publisher = odin.ObjectAs(Publisher)
Example #5
0
class Book(LibraryBook):
    class Meta:
        key_field_name = 'isbn'

    title = odin.StringField()
    isbn = odin.StringField()
    num_pages = odin.IntegerField()
    rrp = odin.FloatField(default=20.4, use_default_if_not_provided=True)
    fiction = odin.BooleanField(is_attribute=True)
    genre = odin.StringField(choices=(
        ('sci-fi', 'Science Fiction'),
        ('fantasy', 'Fantasy'),
        ('biography', 'Biography'),
        ('others', 'Others'),
        ('computers-and-tech', 'Computers & technology'),
    ))
    published = odin.TypedArrayField(odin.DateTimeField())
    authors = odin.ArrayOf(Author, use_container=True)
    publisher = odin.DictAs(Publisher, null=True)

    def __eq__(self, other):
        if other:
            return vars(self) == vars(other)
        return False