Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion invenio_audit_logs/records/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@

"""Base model classes for Audit Logs in Invenio."""


from invenio_db import db
from invenio_records.models import RecordMetadataBase
from sqlalchemy.types import String
from sqlalchemy_utils.types import UUIDType

try:
from uuid import uuid7
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the official start of bringing in python3.14 features?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, more of a forwards compatibility measure.

Though lots of folks are eager to go all the way to 3.14, given some recent performance comparisons 😉

except ImportError:
from uuid_utils.compat import uuid7


class AuditLog(db.Model, RecordMetadataBase):
Expand All @@ -20,6 +25,12 @@ class AuditLog(db.Model, RecordMetadataBase):

encoder = None

id = db.Column(
UUIDType,
primary_key=True,
default=uuid7,
)

action = db.Column(String(255), nullable=False)

resource_type = db.Column(String(255), nullable=False)
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ install_requires =
invenio-records-resources>=8.0.0,<9.0.0
invenio-administration>=4.0.0,<5.0.0
invenio-accounts>=6.0.0,<7.0.0
uuid-utils>=0.11.1; python_version < '3.14'

[options.extras_require]
tests =
Expand Down
Loading