Skip to content

Commit 4a40794

Browse files
committed
requestlog model
1 parent 2bb213d commit 4a40794

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
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: 2 additions & 2 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 = []

0 commit comments

Comments
 (0)