django-nativemojo 0.1.15__py3-none-any.whl → 0.1.17__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.
- {django_nativemojo-0.1.15.dist-info → django_nativemojo-0.1.17.dist-info}/METADATA +3 -2
- django_nativemojo-0.1.17.dist-info/RECORD +302 -0
- mojo/__init__.py +1 -1
- mojo/apps/account/management/commands/serializer_admin.py +121 -1
- mojo/apps/account/migrations/0006_add_device_tracking_models.py +72 -0
- mojo/apps/account/migrations/0007_delete_userdevicelocation.py +16 -0
- mojo/apps/account/migrations/0008_userdevicelocation.py +33 -0
- mojo/apps/account/migrations/0009_geolocatedip_subnet.py +18 -0
- mojo/apps/account/migrations/0010_group_avatar.py +20 -0
- mojo/apps/account/migrations/0011_user_org_registereddevice_pushconfig_and_more.py +118 -0
- mojo/apps/account/migrations/0012_remove_pushconfig_apns_key_file_and_more.py +21 -0
- mojo/apps/account/migrations/0013_pushconfig_test_mode_alter_pushconfig_apns_enabled_and_more.py +28 -0
- mojo/apps/account/migrations/0014_notificationdelivery_data_payload_and_more.py +48 -0
- mojo/apps/account/models/__init__.py +2 -0
- mojo/apps/account/models/device.py +279 -0
- mojo/apps/account/models/group.py +294 -8
- mojo/apps/account/models/member.py +14 -1
- mojo/apps/account/models/push/__init__.py +4 -0
- mojo/apps/account/models/push/config.py +112 -0
- mojo/apps/account/models/push/delivery.py +93 -0
- mojo/apps/account/models/push/device.py +66 -0
- mojo/apps/account/models/push/template.py +99 -0
- mojo/apps/account/models/user.py +190 -17
- mojo/apps/account/rest/__init__.py +2 -0
- mojo/apps/account/rest/device.py +39 -0
- mojo/apps/account/rest/group.py +8 -0
- mojo/apps/account/rest/push.py +187 -0
- mojo/apps/account/rest/user.py +95 -5
- mojo/apps/account/services/__init__.py +1 -0
- mojo/apps/account/services/push.py +363 -0
- mojo/apps/aws/migrations/0001_initial.py +206 -0
- mojo/apps/aws/migrations/0002_emaildomain_can_recv_emaildomain_can_send_and_more.py +28 -0
- mojo/apps/aws/migrations/0003_mailbox_is_domain_default_mailbox_is_system_default_and_more.py +31 -0
- mojo/apps/aws/migrations/0004_s3bucket.py +39 -0
- mojo/apps/aws/migrations/0005_alter_emaildomain_region_delete_s3bucket.py +21 -0
- mojo/apps/aws/models/__init__.py +19 -0
- mojo/apps/aws/models/email_attachment.py +99 -0
- mojo/apps/aws/models/email_domain.py +218 -0
- mojo/apps/aws/models/email_template.py +132 -0
- mojo/apps/aws/models/incoming_email.py +197 -0
- mojo/apps/aws/models/mailbox.py +288 -0
- mojo/apps/aws/models/sent_message.py +175 -0
- mojo/apps/aws/rest/__init__.py +6 -0
- mojo/apps/aws/rest/email.py +33 -0
- mojo/apps/aws/rest/email_ops.py +183 -0
- mojo/apps/aws/rest/messages.py +32 -0
- mojo/apps/aws/rest/send.py +101 -0
- mojo/apps/aws/rest/sns.py +403 -0
- mojo/apps/aws/rest/templates.py +19 -0
- mojo/apps/aws/services/__init__.py +32 -0
- mojo/apps/aws/services/email.py +390 -0
- mojo/apps/aws/services/email_ops.py +548 -0
- mojo/apps/docit/__init__.py +6 -0
- mojo/apps/docit/markdown_plugins/syntax_highlight.py +25 -0
- mojo/apps/docit/markdown_plugins/toc.py +12 -0
- mojo/apps/docit/migrations/0001_initial.py +113 -0
- mojo/apps/docit/migrations/0002_alter_book_modified_by_alter_page_modified_by.py +26 -0
- mojo/apps/docit/migrations/0003_alter_book_group.py +20 -0
- mojo/apps/docit/models/__init__.py +17 -0
- mojo/apps/docit/models/asset.py +231 -0
- mojo/apps/docit/models/book.py +227 -0
- mojo/apps/docit/models/page.py +319 -0
- mojo/apps/docit/models/page_revision.py +203 -0
- mojo/apps/docit/rest/__init__.py +10 -0
- mojo/apps/docit/rest/asset.py +17 -0
- mojo/apps/docit/rest/book.py +22 -0
- mojo/apps/docit/rest/page.py +22 -0
- mojo/apps/docit/rest/page_revision.py +17 -0
- mojo/apps/docit/services/__init__.py +11 -0
- mojo/apps/docit/services/docit.py +315 -0
- mojo/apps/docit/services/markdown.py +44 -0
- mojo/apps/fileman/backends/s3.py +209 -0
- mojo/apps/fileman/models/file.py +45 -9
- mojo/apps/fileman/models/manager.py +269 -3
- mojo/apps/incident/migrations/0007_event_uid.py +18 -0
- mojo/apps/incident/migrations/0008_ticket_ticketnote.py +55 -0
- mojo/apps/incident/migrations/0009_incident_status.py +18 -0
- mojo/apps/incident/migrations/0010_event_country_code.py +18 -0
- mojo/apps/incident/migrations/0011_incident_country_code.py +18 -0
- mojo/apps/incident/migrations/0012_alter_incident_status.py +18 -0
- mojo/apps/incident/models/__init__.py +1 -0
- mojo/apps/incident/models/event.py +35 -0
- mojo/apps/incident/models/incident.py +2 -0
- mojo/apps/incident/models/ticket.py +62 -0
- mojo/apps/incident/reporter.py +21 -3
- mojo/apps/incident/rest/__init__.py +1 -0
- mojo/apps/incident/rest/ticket.py +43 -0
- mojo/apps/jobs/__init__.py +489 -0
- mojo/apps/jobs/adapters.py +24 -0
- mojo/apps/jobs/cli.py +616 -0
- mojo/apps/jobs/daemon.py +370 -0
- mojo/apps/jobs/examples/sample_jobs.py +376 -0
- mojo/apps/jobs/examples/webhook_examples.py +203 -0
- mojo/apps/jobs/handlers/__init__.py +5 -0
- mojo/apps/jobs/handlers/webhook.py +317 -0
- mojo/apps/jobs/job_engine.py +734 -0
- mojo/apps/jobs/keys.py +203 -0
- mojo/apps/jobs/local_queue.py +363 -0
- mojo/apps/jobs/management/__init__.py +3 -0
- mojo/apps/jobs/management/commands/__init__.py +3 -0
- mojo/apps/jobs/manager.py +1327 -0
- mojo/apps/jobs/migrations/0001_initial.py +97 -0
- mojo/apps/jobs/migrations/0002_alter_job_max_retries_joblog.py +39 -0
- mojo/apps/jobs/models/__init__.py +6 -0
- mojo/apps/jobs/models/job.py +441 -0
- mojo/apps/jobs/rest/__init__.py +2 -0
- mojo/apps/jobs/rest/control.py +466 -0
- mojo/apps/jobs/rest/jobs.py +421 -0
- mojo/apps/jobs/scheduler.py +571 -0
- mojo/apps/jobs/services/__init__.py +6 -0
- mojo/apps/jobs/services/job_actions.py +465 -0
- mojo/apps/jobs/settings.py +209 -0
- mojo/apps/logit/models/log.py +3 -0
- mojo/apps/metrics/__init__.py +8 -1
- mojo/apps/metrics/redis_metrics.py +198 -0
- mojo/apps/metrics/rest/__init__.py +3 -0
- mojo/apps/metrics/rest/categories.py +266 -0
- mojo/apps/metrics/rest/helpers.py +48 -0
- mojo/apps/metrics/rest/permissions.py +99 -0
- mojo/apps/metrics/rest/values.py +277 -0
- mojo/apps/metrics/utils.py +17 -0
- mojo/decorators/http.py +40 -1
- mojo/helpers/aws/__init__.py +11 -7
- mojo/helpers/aws/inbound_email.py +309 -0
- mojo/helpers/aws/kms.py +413 -0
- mojo/helpers/aws/ses_domain.py +959 -0
- mojo/helpers/crypto/__init__.py +1 -1
- mojo/helpers/crypto/utils.py +15 -0
- mojo/helpers/location/__init__.py +2 -0
- mojo/helpers/location/countries.py +262 -0
- mojo/helpers/location/geolocation.py +196 -0
- mojo/helpers/logit.py +37 -0
- mojo/helpers/redis/__init__.py +2 -0
- mojo/helpers/redis/adapter.py +606 -0
- mojo/helpers/redis/client.py +48 -0
- mojo/helpers/redis/pool.py +225 -0
- mojo/helpers/request.py +8 -0
- mojo/helpers/response.py +8 -0
- mojo/middleware/auth.py +1 -1
- mojo/middleware/cors.py +40 -0
- mojo/middleware/logging.py +131 -12
- mojo/middleware/mojo.py +5 -0
- mojo/models/rest.py +271 -57
- mojo/models/secrets.py +86 -0
- mojo/serializers/__init__.py +16 -10
- mojo/serializers/core/__init__.py +90 -0
- mojo/serializers/core/cache/__init__.py +121 -0
- mojo/serializers/core/cache/backends.py +518 -0
- mojo/serializers/core/cache/base.py +102 -0
- mojo/serializers/core/cache/disabled.py +181 -0
- mojo/serializers/core/cache/memory.py +287 -0
- mojo/serializers/core/cache/redis.py +533 -0
- mojo/serializers/core/cache/utils.py +454 -0
- mojo/serializers/{manager.py → core/manager.py} +53 -4
- mojo/serializers/core/serializer.py +475 -0
- mojo/serializers/{advanced/formats → formats}/csv.py +116 -139
- mojo/serializers/suggested_improvements.md +388 -0
- testit/client.py +1 -1
- testit/helpers.py +14 -0
- testit/runner.py +23 -6
- django_nativemojo-0.1.15.dist-info/RECORD +0 -234
- mojo/apps/notify/README.md +0 -91
- mojo/apps/notify/README_NOTIFICATIONS.md +0 -566
- mojo/apps/notify/admin.py +0 -52
- mojo/apps/notify/handlers/example_handlers.py +0 -516
- mojo/apps/notify/handlers/ses/__init__.py +0 -25
- mojo/apps/notify/handlers/ses/complaint.py +0 -25
- mojo/apps/notify/handlers/ses/message.py +0 -86
- mojo/apps/notify/management/commands/__init__.py +0 -1
- mojo/apps/notify/management/commands/process_notifications.py +0 -370
- mojo/apps/notify/mod +0 -0
- mojo/apps/notify/models/__init__.py +0 -12
- mojo/apps/notify/models/account.py +0 -128
- mojo/apps/notify/models/attachment.py +0 -24
- mojo/apps/notify/models/bounce.py +0 -68
- mojo/apps/notify/models/complaint.py +0 -40
- mojo/apps/notify/models/inbox.py +0 -113
- mojo/apps/notify/models/inbox_message.py +0 -173
- mojo/apps/notify/models/outbox.py +0 -129
- mojo/apps/notify/models/outbox_message.py +0 -288
- mojo/apps/notify/models/template.py +0 -30
- mojo/apps/notify/providers/aws.py +0 -73
- mojo/apps/notify/rest/ses.py +0 -0
- mojo/apps/notify/utils/__init__.py +0 -2
- mojo/apps/notify/utils/notifications.py +0 -404
- mojo/apps/notify/utils/parsing.py +0 -202
- mojo/apps/notify/utils/render.py +0 -144
- mojo/apps/tasks/README.md +0 -118
- mojo/apps/tasks/__init__.py +0 -44
- mojo/apps/tasks/manager.py +0 -644
- mojo/apps/tasks/rest/__init__.py +0 -2
- mojo/apps/tasks/rest/hooks.py +0 -0
- mojo/apps/tasks/rest/tasks.py +0 -76
- mojo/apps/tasks/runner.py +0 -439
- mojo/apps/tasks/task.py +0 -99
- mojo/apps/tasks/tq_handlers.py +0 -132
- mojo/helpers/crypto/__pycache__/hash.cpython-310.pyc +0 -0
- mojo/helpers/crypto/__pycache__/sign.cpython-310.pyc +0 -0
- mojo/helpers/crypto/__pycache__/utils.cpython-310.pyc +0 -0
- mojo/helpers/redis.py +0 -10
- mojo/models/meta.py +0 -262
- mojo/serializers/advanced/README.md +0 -363
- mojo/serializers/advanced/__init__.py +0 -247
- mojo/serializers/advanced/formats/__init__.py +0 -28
- mojo/serializers/advanced/formats/excel.py +0 -516
- mojo/serializers/advanced/formats/json.py +0 -239
- mojo/serializers/advanced/formats/response.py +0 -485
- mojo/serializers/advanced/serializer.py +0 -568
- mojo/serializers/optimized.py +0 -618
- {django_nativemojo-0.1.15.dist-info → django_nativemojo-0.1.17.dist-info}/LICENSE +0 -0
- {django_nativemojo-0.1.15.dist-info → django_nativemojo-0.1.17.dist-info}/NOTICE +0 -0
- {django_nativemojo-0.1.15.dist-info → django_nativemojo-0.1.17.dist-info}/WHEEL +0 -0
- /mojo/apps/{notify → aws/migrations}/__init__.py +0 -0
- /mojo/apps/{notify/handlers → docit/markdown_plugins}/__init__.py +0 -0
- /mojo/apps/{notify/management → docit/migrations}/__init__.py +0 -0
- /mojo/apps/{notify/providers → jobs/examples}/__init__.py +0 -0
- /mojo/apps/{notify/rest → jobs/migrations}/__init__.py +0 -0
- /mojo/{serializers → rest}/openapi.py +0 -0
- /mojo/serializers/{settings_example.py → examples/settings.py} +0 -0
- /mojo/{apps/notify/handlers/ses/bounce.py → serializers/formats/__init__.py} +0 -0
- /mojo/serializers/{advanced/formats → formats}/localizers.py +0 -0
@@ -0,0 +1,90 @@
|
|
1
|
+
"""
|
2
|
+
Django-MOJO Core Serializers
|
3
|
+
|
4
|
+
High-performance serialization system with intelligent caching and RestMeta.GRAPHS support.
|
5
|
+
This is the optimized serializer implementation with pluggable cache backends.
|
6
|
+
|
7
|
+
Main Components:
|
8
|
+
- OptimizedGraphSerializer: Ultra-fast serializer with smart caching
|
9
|
+
- SerializerManager: Unified interface for all serializer backends
|
10
|
+
- Cache backends: Memory and Redis-based caching systems
|
11
|
+
|
12
|
+
Usage:
|
13
|
+
from mojo.serializers.core import OptimizedGraphSerializer, SerializerManager
|
14
|
+
|
15
|
+
# Direct usage
|
16
|
+
serializer = OptimizedGraphSerializer(instance, graph="detail")
|
17
|
+
data = serializer.serialize()
|
18
|
+
|
19
|
+
# Via manager
|
20
|
+
manager = SerializerManager()
|
21
|
+
serializer = manager.get_serializer(instance, graph="list")
|
22
|
+
"""
|
23
|
+
|
24
|
+
# Import core components
|
25
|
+
from .serializer import OptimizedGraphSerializer
|
26
|
+
from .manager import (
|
27
|
+
SerializerManager,
|
28
|
+
get_serializer_manager,
|
29
|
+
register_serializer,
|
30
|
+
set_default_serializer,
|
31
|
+
serialize,
|
32
|
+
to_json,
|
33
|
+
to_response,
|
34
|
+
get_performance_stats,
|
35
|
+
clear_serializer_caches,
|
36
|
+
benchmark_serializers,
|
37
|
+
list_serializers,
|
38
|
+
HAS_UJSON,
|
39
|
+
UJSON_VERSION
|
40
|
+
)
|
41
|
+
|
42
|
+
# Import cache system
|
43
|
+
from .cache import (
|
44
|
+
get_cache_backend,
|
45
|
+
get_cache_key,
|
46
|
+
get_model_cache_ttl,
|
47
|
+
get_cache_stats,
|
48
|
+
clear_all_caches,
|
49
|
+
HAS_UJSON,
|
50
|
+
UJSON_VERSION
|
51
|
+
)
|
52
|
+
|
53
|
+
# Core serializer exports
|
54
|
+
__all__ = [
|
55
|
+
# Main serializer
|
56
|
+
'OptimizedGraphSerializer',
|
57
|
+
|
58
|
+
# Manager
|
59
|
+
'SerializerManager',
|
60
|
+
'get_serializer_manager',
|
61
|
+
|
62
|
+
# Registration functions
|
63
|
+
'register_serializer',
|
64
|
+
'set_default_serializer',
|
65
|
+
|
66
|
+
# Convenience functions
|
67
|
+
'serialize',
|
68
|
+
'to_json',
|
69
|
+
'to_response',
|
70
|
+
|
71
|
+
# Performance monitoring
|
72
|
+
'get_performance_stats',
|
73
|
+
'clear_serializer_caches',
|
74
|
+
'benchmark_serializers',
|
75
|
+
'list_serializers',
|
76
|
+
|
77
|
+
# Cache system
|
78
|
+
'get_cache_backend',
|
79
|
+
'get_cache_key',
|
80
|
+
'get_model_cache_ttl',
|
81
|
+
'get_cache_stats',
|
82
|
+
'clear_all_caches',
|
83
|
+
|
84
|
+
# Performance info
|
85
|
+
'HAS_UJSON',
|
86
|
+
'UJSON_VERSION',
|
87
|
+
]
|
88
|
+
|
89
|
+
# Version info
|
90
|
+
__version__ = "1.0.0"
|
@@ -0,0 +1,121 @@
|
|
1
|
+
"""
|
2
|
+
Django-MOJO Cache System for Serializers
|
3
|
+
|
4
|
+
Provides pluggable cache backends for high-performance serialization with intelligent
|
5
|
+
TTL management based on RestMeta.GRAPHS configuration.
|
6
|
+
|
7
|
+
Supported Backends:
|
8
|
+
- MemoryCacheBackend: In-process LRU cache with TTL support
|
9
|
+
- RedisCacheBackend: Distributed Redis-based caching (future)
|
10
|
+
- DisabledCacheBackend: No-op cache for development/testing
|
11
|
+
|
12
|
+
Key Features:
|
13
|
+
- RestMeta.cache_ttl configuration per model/graph
|
14
|
+
- LRU eviction with configurable size limits
|
15
|
+
- JSON serialization for Redis compatibility
|
16
|
+
- Thread-safe operations
|
17
|
+
- Safe defaults (cache_ttl=0 means no caching)
|
18
|
+
|
19
|
+
Usage:
|
20
|
+
from mojo.serializers.core.cache import get_cache_backend
|
21
|
+
|
22
|
+
cache = get_cache_backend()
|
23
|
+
|
24
|
+
# Get cached item (returns None if not found/expired)
|
25
|
+
data = cache.get("Event_123_default")
|
26
|
+
|
27
|
+
# Set with TTL from RestMeta configuration
|
28
|
+
cache.set("Event_123_default", serialized_data, ttl=300)
|
29
|
+
|
30
|
+
Configuration:
|
31
|
+
MOJO_SERIALIZER_CACHE = {
|
32
|
+
'backend': 'memory', # 'memory', 'redis', 'disabled'
|
33
|
+
'memory': {
|
34
|
+
'max_size': 5000,
|
35
|
+
'enable_stats': True
|
36
|
+
},
|
37
|
+
'redis': { # Future implementation
|
38
|
+
'host': 'localhost',
|
39
|
+
'port': 6379,
|
40
|
+
'key_prefix': 'mojo:serializer:'
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
RestMeta Configuration:
|
45
|
+
class MyModel(MojoModel):
|
46
|
+
class RestMeta:
|
47
|
+
GRAPHS = {
|
48
|
+
"default": {
|
49
|
+
"fields": ["id", "name"],
|
50
|
+
"cache_ttl": 300 # 5 minutes
|
51
|
+
},
|
52
|
+
"realtime": {
|
53
|
+
"fields": ["id", "status"],
|
54
|
+
"cache_ttl": 0 # No caching (default)
|
55
|
+
}
|
56
|
+
}
|
57
|
+
"""
|
58
|
+
|
59
|
+
from .base import CacheBackend
|
60
|
+
from .memory import MemoryCacheBackend
|
61
|
+
from .redis import RedisCacheBackend
|
62
|
+
from .disabled import DisabledCacheBackend
|
63
|
+
from .backends import (
|
64
|
+
get_cache_backend,
|
65
|
+
create_cache_backend,
|
66
|
+
reset_cache_backend,
|
67
|
+
get_available_backends,
|
68
|
+
test_backend_connectivity,
|
69
|
+
get_cache_health,
|
70
|
+
validate_cache_config
|
71
|
+
)
|
72
|
+
|
73
|
+
from .utils import (
|
74
|
+
get_cache_key,
|
75
|
+
get_model_cache_ttl,
|
76
|
+
get_cache_stats,
|
77
|
+
clear_all_caches
|
78
|
+
)
|
79
|
+
|
80
|
+
# Check ujson availability for performance optimization
|
81
|
+
try:
|
82
|
+
import ujson
|
83
|
+
HAS_UJSON = True
|
84
|
+
UJSON_VERSION = getattr(ujson, '__version__', 'unknown')
|
85
|
+
except ImportError:
|
86
|
+
ujson = None
|
87
|
+
HAS_UJSON = False
|
88
|
+
UJSON_VERSION = None
|
89
|
+
|
90
|
+
# Main exports
|
91
|
+
__all__ = [
|
92
|
+
# Backend classes
|
93
|
+
'CacheBackend',
|
94
|
+
'MemoryCacheBackend',
|
95
|
+
'RedisCacheBackend',
|
96
|
+
'DisabledCacheBackend',
|
97
|
+
|
98
|
+
# Factory functions
|
99
|
+
'get_cache_backend',
|
100
|
+
'create_cache_backend',
|
101
|
+
'reset_cache_backend',
|
102
|
+
|
103
|
+
# Backend management
|
104
|
+
'get_available_backends',
|
105
|
+
'test_backend_connectivity',
|
106
|
+
'get_cache_health',
|
107
|
+
'validate_cache_config',
|
108
|
+
|
109
|
+
# Utilities
|
110
|
+
'get_cache_key',
|
111
|
+
'get_model_cache_ttl',
|
112
|
+
'get_cache_stats',
|
113
|
+
'clear_all_caches',
|
114
|
+
|
115
|
+
# Performance info
|
116
|
+
'HAS_UJSON',
|
117
|
+
'UJSON_VERSION',
|
118
|
+
]
|
119
|
+
|
120
|
+
# Version info
|
121
|
+
__version__ = "1.0.0"
|