oxutils 0.1.0__py3-none-any.whl → 0.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
oxutils/__init__.py CHANGED
@@ -10,7 +10,7 @@ This package provides:
10
10
  - Custom exceptions
11
11
  """
12
12
 
13
- __version__ = "0.1.0"
13
+ __version__ = "0.1.1"
14
14
 
15
15
  from oxutils.settings import oxi_settings
16
16
  from oxutils.conf import UTILS_APPS, AUDIT_MIDDLEWARE
oxutils/audit/__init__.py CHANGED
@@ -0,0 +1,20 @@
1
+ """
2
+ Oxutils Audit Module
3
+
4
+ Provides audit log export functionality with S3 storage.
5
+ """
6
+
7
+ # Models are imported lazily to avoid AppRegistryNotReady errors
8
+ # Use: from oxutils.audit.models import LogExportState, LogExportHistory
9
+
10
+ __all__ = [
11
+ 'LogExportState',
12
+ 'LogExportHistory',
13
+ ]
14
+
15
+ def __getattr__(name):
16
+ """Lazy import of models to avoid AppRegistryNotReady errors."""
17
+ if name in __all__:
18
+ from oxutils.audit.models import LogExportState, LogExportHistory
19
+ return locals()[name]
20
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
oxutils/audit/apps.py CHANGED
@@ -3,10 +3,10 @@ from django.utils.translation import gettext_lazy as _
3
3
 
4
4
 
5
5
 
6
- class OxutilsConfig(AppConfig):
6
+ class OxutilsAuditConfig(AppConfig):
7
7
  default_auto_field = 'django.db.models.BigAutoField'
8
- name = 'oxutils_export'
9
- verbose_name = _("Oxutils Export")
8
+ name = 'oxutils.audit'
9
+ verbose_name = _("Oxutils Audit")
10
10
 
11
11
  def ready(self):
12
12
  return super().ready()
@@ -0,0 +1,41 @@
1
+ # Generated by Django 5.2.8 on 2025-12-03 21:53
2
+
3
+ import django.db.models.deletion
4
+ import oxutils.enums.audit
5
+ import oxutils.s3.storages
6
+ from django.db import migrations, models
7
+
8
+
9
+ class Migration(migrations.Migration):
10
+
11
+ initial = True
12
+
13
+ dependencies = [
14
+ ]
15
+
16
+ operations = [
17
+ migrations.CreateModel(
18
+ name='LogExportState',
19
+ fields=[
20
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
21
+ ('created_at', models.DateTimeField(auto_now_add=True, help_text='Date and time when this record was created')),
22
+ ('updated_at', models.DateTimeField(auto_now=True, help_text='Date and time when this record was last updated')),
23
+ ('last_export_date', models.DateTimeField(null=True)),
24
+ ('status', models.CharField(choices=[(oxutils.enums.audit.ExportStatus['FAILED'], 'Failed'), (oxutils.enums.audit.ExportStatus['PENDING'], 'Pending'), (oxutils.enums.audit.ExportStatus['SUCCESS'], 'Success')], default=oxutils.enums.audit.ExportStatus['PENDING'])),
25
+ ('data', models.FileField(storage=oxutils.s3.storages.LogStorage(), upload_to='')),
26
+ ('size', models.BigIntegerField()),
27
+ ],
28
+ options={
29
+ 'abstract': False,
30
+ },
31
+ ),
32
+ migrations.CreateModel(
33
+ name='LogExportHistory',
34
+ fields=[
35
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
36
+ ('status', models.CharField(choices=[(oxutils.enums.audit.ExportStatus['FAILED'], 'Failed'), (oxutils.enums.audit.ExportStatus['PENDING'], 'Pending'), (oxutils.enums.audit.ExportStatus['SUCCESS'], 'Success')], default=oxutils.enums.audit.ExportStatus['PENDING'])),
37
+ ('created_at', models.DateTimeField(auto_now_add=True, help_text='Date and time when this record was created')),
38
+ ('state', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='log_histories', to='audit.logexportstate')),
39
+ ],
40
+ ),
41
+ ]
File without changes
oxutils/conf.py CHANGED
@@ -3,6 +3,7 @@ UTILS_APPS = (
3
3
  'auditlog',
4
4
  'cid.apps.CidAppConfig',
5
5
  'django_celery_results',
6
+ 'oxutils.audit',
6
7
  )
7
8
 
8
9
  AUDIT_MIDDLEWARE = (
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oxutils
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Production-ready utilities for Django applications in the Oxiliere ecosystem
5
5
  Keywords: django,utilities,jwt,s3,audit,logging,celery,structlog
6
6
  Author: Edimedia Mutoke
@@ -153,6 +153,18 @@ uv sync
153
153
  uv run pytest # 126 tests
154
154
  ```
155
155
 
156
+ ### Creating Migrations
157
+
158
+ To generate Django migrations for the audit module:
159
+
160
+ ```bash
161
+ make migrations
162
+ # or
163
+ uv run make_migrations.py
164
+ ```
165
+
166
+ See [MIGRATIONS.md](MIGRATIONS.md) for detailed documentation.
167
+
156
168
  ## Advanced Examples
157
169
 
158
170
  ### JWT with Django Ninja
@@ -189,7 +201,7 @@ print(f"Exported to {export.data.url}")
189
201
 
190
202
  ## License
191
203
 
192
- MIT License - see [LICENSE](LICENSE)
204
+ Apache 2.0 License - see [LICENSE](LICENSE)
193
205
 
194
206
  ## Support
195
207
 
@@ -1,15 +1,17 @@
1
- oxutils/__init__.py,sha256=P25yalCx6B4hRjjbABZP9zpGc6WLaErSr62EtbkKXMw,536
1
+ oxutils/__init__.py,sha256=3P1RgwJOYUc9uXjd_PhSprxHiOLf_qZrSxX2nuxBRWU,536
2
2
  oxutils/apps.py,sha256=8pO8eXUZeKYn8fPo0rkoytmHACwDNuTNhdRcpkPTxGM,347
3
- oxutils/audit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- oxutils/audit/apps.py,sha256=oT6yoZiFsrg__xSTwr1YXPh0rBhgxcXkuWLIx_fv5rA,301
3
+ oxutils/audit/__init__.py,sha256=uonc00G73Xm7RwRHVWD-wBn8lJYNCq3iBgnRGMWAEWs,583
4
+ oxutils/audit/apps.py,sha256=xvnmB5Z6nLV7ejzhSeQbesTkwRoFygoPFob8H5QTHgU,304
5
5
  oxutils/audit/export.py,sha256=MVf2RhLzXatBaGK7bIEvSY1VTwEojrPEKwYMvH1stwE,7992
6
6
  oxutils/audit/masks.py,sha256=BRCz2m8dbaLgqn5umxpWCwn9mT6Z_ww_WIedl36AmPM,2345
7
+ oxutils/audit/migrations/0001_initial.py,sha256=xDOxV6NqkU8yuEDPvqG2AKANKrOJsOIAEJn5IbuLLFU,2151
8
+ oxutils/audit/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
9
  oxutils/audit/models.py,sha256=NWzZjwgRGB212PeSb0E_aSxSComrTSR0knt2aBCiWhg,2100
8
10
  oxutils/audit/settings.py,sha256=E4AoTpbvL1svDogux-OTjAdccD5LzyJ1G-lBeCZTbDU,353
9
11
  oxutils/celery/__init__.py,sha256=29jo4DfdvOoThX-jfL0ZiDjsy3-Z_fNhwHVJaLO5rsk,29
10
12
  oxutils/celery/base.py,sha256=qLlBU2XvT2zj8qszy8togqH7hM_wUYyWWA3JAQPPJx0,3378
11
13
  oxutils/celery/settings.py,sha256=njhHBErpcFczV2e23NCPX_Jxs015jr4dIig4Is_wbgE,33
12
- oxutils/conf.py,sha256=Www0b7XdmsRK_wcKFmp9sHMLKApSA4JVgM-dVvdB0UM,275
14
+ oxutils/conf.py,sha256=JT0Zj4Wmn9HCEDpk7eOIY47YLBGP793tstsm34cLb1A,296
13
15
  oxutils/enums/__init__.py,sha256=gFhZG8ER6ArGZO5agWhdfs7NiD2h9FzrzfQRHq18dD0,40
14
16
  oxutils/enums/audit.py,sha256=ju2Z9CrtdyPziRQ7oOe4Ygw85t9sW3jynO_1DkgZoAM,126
15
17
  oxutils/enums/invoices.py,sha256=E33QGQeutZUqvlovJY0VGDxWUb0i_kdfhEiir1ARKuQ,201
@@ -38,6 +40,6 @@ oxutils/s3/settings.py,sha256=NIlVhaOzWdsepOgCpxdTTJRHfM0tM5EcAoy4kaFC1R8,1190
38
40
  oxutils/s3/storages.py,sha256=vW8BlxLwkqMgVJPf9z2rkjmlrL_RArlN3YA6y4BJ7Zw,5414
39
41
  oxutils/settings.py,sha256=iOVRgkurkv6UtlEvY0dkO71oxxgPAIdyXgHhf3RJaTU,9673
40
42
  oxutils/types.py,sha256=DIz8YK8xMpLc7FYbf88yEElyLsYN_-rbvaZXvENQkOQ,234
41
- oxutils-0.1.0.dist-info/WHEEL,sha256=4n27za1eEkOnA7dNjN6C5-O2rUiw6iapszm14Uj-Qmk,79
42
- oxutils-0.1.0.dist-info/METADATA,sha256=q6Jww1jWZILdwarNnXtg0SkqKcvvuqYVCCyZaIs9CII,5725
43
- oxutils-0.1.0.dist-info/RECORD,,
43
+ oxutils-0.1.1.dist-info/WHEEL,sha256=4n27za1eEkOnA7dNjN6C5-O2rUiw6iapszm14Uj-Qmk,79
44
+ oxutils-0.1.1.dist-info/METADATA,sha256=H5gVh_JOIWKKesVrHu8o6orUe2stxJhmeDm31wRrUa0,5934
45
+ oxutils-0.1.1.dist-info/RECORD,,