-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dc885c7
commit c099dfc
Showing
10 changed files
with
160 additions
and
74 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import ckanext.files.config as files_conf | ||
|
||
|
||
def files_get_unused_threshold() -> int: | ||
def files_get_unused_threshold(): | ||
# type: () -> int | ||
return files_conf.get_unused_threshold() |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,32 @@ | ||
from __future__ import annotations | ||
import six | ||
|
||
import datetime | ||
|
||
|
||
from sqlalchemy import Column, UnicodeText, DateTime | ||
from sqlalchemy.orm import Query | ||
from sqlalchemy.dialects.postgresql import JSONB | ||
|
||
import ckan.plugins.toolkit as tk | ||
import ckan.model as model | ||
from ckan.model.types import make_uuid | ||
from ckan.lib.dictization import table_dictize | ||
from .base import Base | ||
|
||
if six.PY3: | ||
from typing import Any | ||
|
||
class File(Base): | ||
|
||
class File(Base): # type: ignore | ||
__tablename__ = "files_file" | ||
id = Column(UnicodeText, primary_key=True, default=make_uuid) | ||
name = Column(UnicodeText, nullable=False) | ||
path = Column(UnicodeText, nullable=False) | ||
kind = Column(UnicodeText, nullable=False) | ||
uploaded_at = Column( | ||
DateTime, nullable=False, default=datetime.datetime.utcnow | ||
) | ||
last_access = Column( | ||
DateTime, nullable=False, default=datetime.datetime.utcnow | ||
) | ||
uploaded_at = Column(DateTime, nullable=False, default=datetime.datetime.utcnow) | ||
last_access = Column(DateTime, nullable=False, default=datetime.datetime.utcnow) | ||
extras = Column(JSONB) | ||
|
||
def dictize(self, context): | ||
# type: (Any) -> dict[str, Any] | ||
result = table_dictize(self, context) | ||
result["url"] = tk.h.url_for("files.get_file", file_id=self.id, qualified=True) | ||
return result |
Oops, something went wrong.