diff options
Diffstat (limited to '')
-rw-r--r-- | archivist/cli.py | 2 | ||||
-rw-r--r-- | archivist/model.py | 4 | ||||
-rw-r--r-- | archivist/prefixes.py | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/archivist/cli.py b/archivist/cli.py index 31646aa..833cb80 100644 --- a/archivist/cli.py +++ b/archivist/cli.py @@ -249,7 +249,7 @@ def add_doc(file, tags, create_tags, ignore_missing_tags): else: tags = fetch_tags(tags, ignore_missing_tags) - Document.create_from_file(file, tags, direction = Document.Direction.IN, file_type = mimetype) + Document.create_from_file(file, tags, direction = Document.Direction.IN, mimetype = mimetype) @doc.command('find') @click.argument('tags', type=TAG, nargs=-1) diff --git a/archivist/model.py b/archivist/model.py index 86c2cf1..6d452b4 100644 --- a/archivist/model.py +++ b/archivist/model.py @@ -73,13 +73,13 @@ class Document(BaseModel): IN = 0 OUT = 1 + content = ForeignKeyField(DocumentContent, related_name = 'document') created = DateField(default=datetime.date.today) inserted = DateTimeField(default=datetime.datetime.now) description = CharField(null=True) original_path = CharField(null=True) - file_type = CharField(null=True) + mimetype = CharField(null=True) direction = EnumField(Direction, null=True) - content = ForeignKeyField(DocumentContent, related_name = 'document') @classmethod @db.atomic() diff --git a/archivist/prefixes.py b/archivist/prefixes.py index 98d46af..c85d833 100644 --- a/archivist/prefixes.py +++ b/archivist/prefixes.py @@ -18,7 +18,7 @@ def _create_prefixes(): FieldPseudoPrefix('direction', 'In- or outgoing', Document.direction) FieldPseudoPrefix('date', 'Date of creation', Document.created) - FieldPseudoPrefix('mime', 'Mime Type', Document.file_type) + FieldPseudoPrefix('mime', 'Mime Type', Document.mimetype) for part in ('day', 'month', 'year'): FieldPartPseudoPrefix(part, part.capitalize() + ' of creation', Document.created, part) |