django-ctct 0.0.1.dev5__tar.gz → 0.0.1.dev7__tar.gz

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.
Files changed (28) hide show
  1. {django_ctct-0.0.1.dev5 → django_ctct-0.0.1.dev7}/PKG-INFO +41 -46
  2. {django_ctct-0.0.1.dev5 → django_ctct-0.0.1.dev7}/README.md +31 -26
  3. django_ctct-0.0.1.dev7/django_ctct/admin.py +809 -0
  4. django_ctct-0.0.1.dev7/django_ctct/apps.py +33 -0
  5. django_ctct-0.0.1.dev7/django_ctct/conf.py +90 -0
  6. django_ctct-0.0.1.dev7/django_ctct/management/commands/__init__.py +0 -0
  7. {django_ctct-0.0.1.dev5 → django_ctct-0.0.1.dev7}/django_ctct/management/commands/import_ctct.py +77 -97
  8. {django_ctct-0.0.1.dev5 → django_ctct-0.0.1.dev7}/django_ctct/managers.py +340 -309
  9. {django_ctct-0.0.1.dev5 → django_ctct-0.0.1.dev7}/django_ctct/migrations/0001_initial.py +5 -4
  10. django_ctct-0.0.1.dev7/django_ctct/migrations/__init__.py +0 -0
  11. django_ctct-0.0.1.dev7/django_ctct/models.py +1338 -0
  12. django_ctct-0.0.1.dev7/django_ctct/py.typed +0 -0
  13. django_ctct-0.0.1.dev7/django_ctct/todo.md +84 -0
  14. {django_ctct-0.0.1.dev5 → django_ctct-0.0.1.dev7}/django_ctct/urls.py +2 -2
  15. {django_ctct-0.0.1.dev5 → django_ctct-0.0.1.dev7}/django_ctct/utils.py +20 -10
  16. django_ctct-0.0.1.dev7/django_ctct/views.py +37 -0
  17. django_ctct-0.0.1.dev7/pyproject.toml +107 -0
  18. django_ctct-0.0.1.dev7/pyproject.toml.orig +102 -0
  19. django_ctct-0.0.1.dev5/LICENSE +0 -21
  20. django_ctct-0.0.1.dev5/django_ctct/admin.py +0 -706
  21. django_ctct-0.0.1.dev5/django_ctct/apps.py +0 -35
  22. django_ctct-0.0.1.dev5/django_ctct/models.py +0 -1333
  23. django_ctct-0.0.1.dev5/django_ctct/signals.py +0 -93
  24. django_ctct-0.0.1.dev5/django_ctct/vendor.py +0 -108
  25. django_ctct-0.0.1.dev5/django_ctct/views.py +0 -24
  26. django_ctct-0.0.1.dev5/pyproject.toml +0 -57
  27. {django_ctct-0.0.1.dev5 → django_ctct-0.0.1.dev7}/django_ctct/__init__.py +0 -0
  28. {django_ctct-0.0.1.dev5/django_ctct/migrations → django_ctct-0.0.1.dev7/django_ctct/management}/__init__.py +0 -0
@@ -1,25 +1,16 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.3
2
2
  Name: django-ctct
3
- Version: 0.0.1.dev5
3
+ Version: 0.0.1.dev7
4
4
  Summary: A Django interface for the Constant Contact API
5
- License: MIT
6
- License-File: LICENSE
7
5
  Author: Geoffrey Eisenbarth
8
- Author-email: geoffrey.eisenbarth@gmail.com
9
- Requires-Python: >=3.10
10
- Classifier: License :: OSI Approved :: MIT License
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.10
13
- Classifier: Programming Language :: Python :: 3.11
14
- Classifier: Programming Language :: Python :: 3.12
15
- Classifier: Programming Language :: Python :: 3.13
16
- Classifier: Programming Language :: Python :: 3.14
17
- Requires-Dist: django (>=3.2.0,<6.0.0)
18
- Requires-Dist: mypy (>=1.19.0,<2.0.0)
19
- Requires-Dist: pyjwt[crypto] (>=2.10.1,<3.0.0)
20
- Requires-Dist: ratelimit (>=2.2.1,<3.0.0)
21
- Requires-Dist: requests (>=2.32.3,<3.0.0)
22
- Requires-Dist: tqdm (>=4.67.1,<5.0.0)
6
+ Author-email: Geoffrey Eisenbarth <geoffrey.eisenbarth@gmail.com>
7
+ License: MIT
8
+ Requires-Dist: django>=6.0
9
+ Requires-Dist: requests>=2.32.3,<3.0.0
10
+ Requires-Dist: ratelimit>=2.2.1,<3.0.0
11
+ Requires-Dist: tqdm>=4.67.1,<5.0.0
12
+ Requires-Dist: pyjwt[crypto]>=2.10.1,<3.0.0
13
+ Requires-Python: >=3.12
23
14
  Description-Content-Type: text/markdown
24
15
 
25
16
  # Constant Contact Integration for Django
@@ -48,7 +39,7 @@ In your Django project's settings.py file, add `'django_ctct'` to the `'INSTALLE
48
39
  ```python
49
40
  INSTALLED_APPS = [
50
41
  # ... django apps
51
- 'django_ctct',
42
+ "django_ctct",
52
43
  # ... other apps
53
44
  ]
54
45
  ```
@@ -62,8 +53,8 @@ from django.contrib import admin
62
53
  from django.urls import path, include
63
54
 
64
55
  urlpatterns = [
65
- path('admin/', admin.site.urls),
66
- path('django-ctct/', include('django_ctct.urls')),
56
+ path("admin/", admin.site.urls),
57
+ path("django-ctct/", include("django_ctct.urls")),
67
58
  # ... other URL patterns
68
59
  ]
69
60
  ```
@@ -84,28 +75,30 @@ CTCT_REDIRECT_URI = "REDIRECT_URI_FROM_CTCT"
84
75
  CTCT_FROM_NAME = "YOUR_EMAIL_NAME"
85
76
  CTCT_FROM_EMAIL = "YOUR_EMAIL_ADDRESS"
86
77
 
87
- # Optional settings
78
+ # Optional settings, callables will receive the EmailCampaign object as an argument
88
79
  CTCT_REPLY_TO_EMAIL = "YOUR_REPLY_TO_ADDRESS"
89
80
  CTCT_PHYSICAL_ADDRESS = {
90
- 'address_line1': '1060 W Addison St',
91
- 'address_line2': '',
92
- 'address_optional': '',
93
- 'city': 'Chicago',
94
- 'country_code': 'US',
95
- 'country_name': 'United States',
96
- 'organization_name': 'Wrigley Field',
97
- 'postal_code': '60613',
98
- 'state_code': 'IL',
81
+ "address_line1": "1060 W Addison St",
82
+ "address_line2": "",
83
+ "address_optional": "",
84
+ "city": "Chicago",
85
+ "country_code": "US",
86
+ "country_name": "United States",
87
+ "organization_name": "Wrigley Field",
88
+ "postal_code": "60613",
89
+ "state_code": "IL",
99
90
  }
100
91
  CTCT_PREVIEW_RECIPIENTS = (
101
- ('First Recipient', 'first@recipient.com'),
102
- ('Second Recipient', 'second@recipient.com'),
92
+ ("First Recipient", "first@recipient.com"),
93
+ ("Second Recipient", "second@recipient.com"),
103
94
  )
95
+ CTCT_PREVIEW_RECIPIENTS_CALLABLE = "myproject.myapp.ctct.get_preview_recipients"
104
96
  CTCT_PREVIEW_MESSAGE = "This is an EmailCampaign preview."
97
+ CTCT_PREVIEW_MESSAGE_CALLABLE = "myproject.myapp.ctct.get_preview_message"
105
98
 
106
99
  # Optional functionality settings and their default settings
107
- CTCT_USE_ADMIN = False # Add django-ctct models to admin
108
- CTCT_SYNC_ADMIN = False # Django admin CRUD operations will sync with ctct account
100
+ CTCT_USE_ADMIN = False # Add django-ctct models to admin
101
+ CTCT_SYNC_ADMIN = False # Django admin CRUD operations will sync with ctct account
109
102
  ```
110
103
 
111
104
  **Important:** Store your API credentials securely. Avoid committing them directly to your version control repository.
@@ -123,7 +116,7 @@ CTCT_SYNC_ADMIN = False # Django admin CRUD operations will sync with ctct
123
116
  > ./manage.py migrate
124
117
  ```
125
118
 
126
- 4) **Create Authenticatin Token:**
119
+ 4) **Create Authentication Token:**
127
120
 
128
121
  After the app has been installed and configured, you must generate your first auth token:
129
122
 
@@ -156,16 +149,22 @@ To install dev dependencies:
156
149
  ```bash
157
150
  > git clone git@github.com:geoffrey-eisenbarth/django-ctct.git
158
151
  > cd django-ctct
159
- > python -m pip install --upgrade pip
160
- > pip intall poetry
161
- > poetry install --with dev
152
+ > curl -LsSf https://astral.sh/uv/install.sh | sh
153
+ > uv sync --group dev
162
154
  ```
163
155
 
164
156
  To run tests:
165
157
 
166
158
  ```bash
167
- > poetry run coverage run tests/project/manage.py test
168
- > poetry run coverage report
159
+ > uv run coverage run tests/project/manage.py test
160
+ > uv run coverage report
161
+ ```
162
+
163
+ To lint and format:
164
+
165
+ ```bash
166
+ > uv run ruff check .
167
+ > uv run ruff format .
169
168
  ```
170
169
 
171
170
 
@@ -173,9 +172,6 @@ To run tests:
173
172
 
174
173
  Once version 0.0.1 is released on PyPI, we hope to implement the following new features (in no particular order):
175
174
 
176
- * Support for API syncing using signals (`post_save`, `pre_delete`, `m2m_changed`, etc).
177
- This will be controlled by the `CTCT_SYNC_SIGNALS` setting.
178
- **Update** This probably won't work as desired since the primary object will be saved before related objects are.
179
175
  * Background task support using `django-tasks` (which hopefully will merge into Django). This will be controlled by the `CTCT_ENQUEUE_DEFAULT` setting.
180
176
  * Add `models.CheckConstraint` and `models.UniqueConstraint` constraints that are currently commented out.
181
177
 
@@ -191,4 +187,3 @@ This package is currently distributed under the MIT license.
191
187
  ## Support
192
188
 
193
189
  If you have any issues or questions, please feel free to reach out to me on GitHub: https://github.com/geoffrey-eisenbarth/django-ctct/issues
194
-
@@ -24,7 +24,7 @@ In your Django project's settings.py file, add `'django_ctct'` to the `'INSTALLE
24
24
  ```python
25
25
  INSTALLED_APPS = [
26
26
  # ... django apps
27
- 'django_ctct',
27
+ "django_ctct",
28
28
  # ... other apps
29
29
  ]
30
30
  ```
@@ -38,8 +38,8 @@ from django.contrib import admin
38
38
  from django.urls import path, include
39
39
 
40
40
  urlpatterns = [
41
- path('admin/', admin.site.urls),
42
- path('django-ctct/', include('django_ctct.urls')),
41
+ path("admin/", admin.site.urls),
42
+ path("django-ctct/", include("django_ctct.urls")),
43
43
  # ... other URL patterns
44
44
  ]
45
45
  ```
@@ -60,28 +60,30 @@ CTCT_REDIRECT_URI = "REDIRECT_URI_FROM_CTCT"
60
60
  CTCT_FROM_NAME = "YOUR_EMAIL_NAME"
61
61
  CTCT_FROM_EMAIL = "YOUR_EMAIL_ADDRESS"
62
62
 
63
- # Optional settings
63
+ # Optional settings, callables will receive the EmailCampaign object as an argument
64
64
  CTCT_REPLY_TO_EMAIL = "YOUR_REPLY_TO_ADDRESS"
65
65
  CTCT_PHYSICAL_ADDRESS = {
66
- 'address_line1': '1060 W Addison St',
67
- 'address_line2': '',
68
- 'address_optional': '',
69
- 'city': 'Chicago',
70
- 'country_code': 'US',
71
- 'country_name': 'United States',
72
- 'organization_name': 'Wrigley Field',
73
- 'postal_code': '60613',
74
- 'state_code': 'IL',
66
+ "address_line1": "1060 W Addison St",
67
+ "address_line2": "",
68
+ "address_optional": "",
69
+ "city": "Chicago",
70
+ "country_code": "US",
71
+ "country_name": "United States",
72
+ "organization_name": "Wrigley Field",
73
+ "postal_code": "60613",
74
+ "state_code": "IL",
75
75
  }
76
76
  CTCT_PREVIEW_RECIPIENTS = (
77
- ('First Recipient', 'first@recipient.com'),
78
- ('Second Recipient', 'second@recipient.com'),
77
+ ("First Recipient", "first@recipient.com"),
78
+ ("Second Recipient", "second@recipient.com"),
79
79
  )
80
+ CTCT_PREVIEW_RECIPIENTS_CALLABLE = "myproject.myapp.ctct.get_preview_recipients"
80
81
  CTCT_PREVIEW_MESSAGE = "This is an EmailCampaign preview."
82
+ CTCT_PREVIEW_MESSAGE_CALLABLE = "myproject.myapp.ctct.get_preview_message"
81
83
 
82
84
  # Optional functionality settings and their default settings
83
- CTCT_USE_ADMIN = False # Add django-ctct models to admin
84
- CTCT_SYNC_ADMIN = False # Django admin CRUD operations will sync with ctct account
85
+ CTCT_USE_ADMIN = False # Add django-ctct models to admin
86
+ CTCT_SYNC_ADMIN = False # Django admin CRUD operations will sync with ctct account
85
87
  ```
86
88
 
87
89
  **Important:** Store your API credentials securely. Avoid committing them directly to your version control repository.
@@ -99,7 +101,7 @@ CTCT_SYNC_ADMIN = False # Django admin CRUD operations will sync with ctct
99
101
  > ./manage.py migrate
100
102
  ```
101
103
 
102
- 4) **Create Authenticatin Token:**
104
+ 4) **Create Authentication Token:**
103
105
 
104
106
  After the app has been installed and configured, you must generate your first auth token:
105
107
 
@@ -132,16 +134,22 @@ To install dev dependencies:
132
134
  ```bash
133
135
  > git clone git@github.com:geoffrey-eisenbarth/django-ctct.git
134
136
  > cd django-ctct
135
- > python -m pip install --upgrade pip
136
- > pip intall poetry
137
- > poetry install --with dev
137
+ > curl -LsSf https://astral.sh/uv/install.sh | sh
138
+ > uv sync --group dev
138
139
  ```
139
140
 
140
141
  To run tests:
141
142
 
142
143
  ```bash
143
- > poetry run coverage run tests/project/manage.py test
144
- > poetry run coverage report
144
+ > uv run coverage run tests/project/manage.py test
145
+ > uv run coverage report
146
+ ```
147
+
148
+ To lint and format:
149
+
150
+ ```bash
151
+ > uv run ruff check .
152
+ > uv run ruff format .
145
153
  ```
146
154
 
147
155
 
@@ -149,9 +157,6 @@ To run tests:
149
157
 
150
158
  Once version 0.0.1 is released on PyPI, we hope to implement the following new features (in no particular order):
151
159
 
152
- * Support for API syncing using signals (`post_save`, `pre_delete`, `m2m_changed`, etc).
153
- This will be controlled by the `CTCT_SYNC_SIGNALS` setting.
154
- **Update** This probably won't work as desired since the primary object will be saved before related objects are.
155
160
  * Background task support using `django-tasks` (which hopefully will merge into Django). This will be controlled by the `CTCT_ENQUEUE_DEFAULT` setting.
156
161
  * Add `models.CheckConstraint` and `models.UniqueConstraint` constraints that are currently commented out.
157
162