Skip to content

Commit 055a9c3

Browse files
authored
Merge pull request #2712 from peterbe/requestlog-model
requestlog model
2 parents 2bb213d + 836455d commit 055a9c3

File tree

4 files changed

+75
-40
lines changed

4 files changed

+75
-40
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Generated by Django 5.2.1 on 2025-06-13 10:42
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('base', '0016_alter_analyticsevent_options_and_more'),
10+
]
11+
12+
operations = [
13+
migrations.CreateModel(
14+
name='RequestLog',
15+
fields=[
16+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
17+
('url', models.URLField(max_length=500)),
18+
('status_code', models.IntegerField()),
19+
('created', models.DateTimeField(auto_now_add=True, db_index=True)),
20+
('request', models.JSONField(default=dict)),
21+
('response', models.JSONField(default=dict)),
22+
('meta', models.JSONField(default=dict)),
23+
],
24+
),
25+
]

peterbecom/base/models.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,3 +246,12 @@ def create_event(type: str, uuid: str, url: str, meta: dict, data: dict):
246246
meta=meta,
247247
data=data,
248248
)
249+
250+
251+
class RequestLog(models.Model):
252+
url = models.URLField(max_length=500)
253+
status_code = models.IntegerField()
254+
created = models.DateTimeField(auto_now_add=True, db_index=True)
255+
request = models.JSONField(default=dict)
256+
response = models.JSONField(default=dict)
257+
meta = models.JSONField(default=dict)

pyproject.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ line-length = 88
99

1010
[tool.ruff.lint]
1111
# Add the `line-too-long` rule to the enforced rule set.
12-
extend-ignore = ["E501"]
13-
extend-select = ["E", "F", "W", "I"]
12+
#extend-ignore = ["E501"]
13+
#extend-select = ["E", "F", "W", "I"]
1414

1515
[tool.uv]
1616
dev-dependencies = []
@@ -30,7 +30,7 @@ dependencies = [
3030
"delegator-py==0.1.1",
3131
"dj-database-url==2.3.0",
3232
"django-redis==5.4.0",
33-
"django==5.2.1",
33+
"django==5.2.3",
3434
"elasticsearch-dsl==8.17.1",
3535
"elasticsearch==8.17.2",
3636
"feedparser==6.0.11",
@@ -53,17 +53,17 @@ dependencies = [
5353
"ptyprocess==0.7.0",
5454
"py-avataaars==1.1.2",
5555
"pyquery==2.0.1",
56-
"pytest-cov==6.1.1",
56+
"pytest-cov==6.2.1",
5757
"pytest-django==4.11.1",
5858
"pytest-watch>=4.2.0",
5959
"python-dateutil==2.9.0.post0",
6060
"python-decouple==3.8",
6161
"pytz==2025.2",
6262
"redis==5.2.1",
6363
"requests-mock==1.12.1",
64-
"requests==2.32.3",
64+
"requests==2.32.4",
6565
"rollbar==1.3.0",
66-
"ruff==0.11.12",
66+
"ruff==0.11.13",
6767
"sorl-thumbnail==12.11.0",
6868
"sql-metadata==2.17.0",
6969
"tomli==2.2.1",

uv.lock

Lines changed: 35 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)