litestar-org / advanced-alchemy

A carefully crafted, thoroughly tested, optimized companion library for SQLAlchemy
http://docs.advanced-alchemy.litestar.dev/
MIT License
243 stars 30 forks source link

feat: add `TZ` validator to `AuditModel` #247

Closed cofin closed 2 months ago

cofin commented 2 months ago

Fixes #244

Description

-

Closes

cofin commented 2 months ago

@peterschutt I think the validator is a good idea. Is this sufficient to cover your use case?

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
80.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

github-actions[bot] commented 2 months ago

Documentation preview will be available shortly at https://litestar-org.github.io/advanced-alchemy-docs-preview/247

peterschutt commented 2 months ago

@peterschutt I think the validator is a good idea. Is this sufficient to cover your use case?

Yeah, the issue was that there was no way to force sqladmin to send through an aware timestamp, so having the base model assume naive == UTC covers it.

Cheers