From 9139b4ffdd1a9c1dc65dcf8f871cec533f603070 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Sat, 15 Oct 2022 23:36:04 +0100 Subject: [PATCH] Add callback migrations --- ..._callback_data_callback_market_and_more.py | 77 +++++++++++++++++++ core/views/hooks.py | 2 +- 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 core/migrations/0005_remove_callback_data_callback_market_and_more.py diff --git a/core/migrations/0005_remove_callback_data_callback_market_and_more.py b/core/migrations/0005_remove_callback_data_callback_market_and_more.py new file mode 100644 index 0000000..1b8391a --- /dev/null +++ b/core/migrations/0005_remove_callback_data_callback_market_and_more.py @@ -0,0 +1,77 @@ +# Generated by Django 4.1.2 on 2022-10-15 22:35 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0004_callback'), + ] + + operations = [ + migrations.RemoveField( + model_name='callback', + name='data', + ), + migrations.AddField( + model_name='callback', + name='market', + field=models.CharField(blank=True, max_length=255, null=True), + ), + migrations.AddField( + model_name='callback', + name='market_contract', + field=models.CharField(blank=True, max_length=255, null=True), + ), + migrations.AddField( + model_name='callback', + name='market_currency', + field=models.CharField(blank=True, max_length=255, null=True), + ), + migrations.AddField( + model_name='callback', + name='market_exchange', + field=models.CharField(blank=True, max_length=255, null=True), + ), + migrations.AddField( + model_name='callback', + name='market_item', + field=models.CharField(blank=True, max_length=255, null=True), + ), + migrations.AddField( + model_name='callback', + name='message', + field=models.CharField(blank=True, max_length=1024, null=True), + ), + migrations.AddField( + model_name='callback', + name='period', + field=models.CharField(blank=True, max_length=255, null=True), + ), + migrations.AddField( + model_name='callback', + name='timestamp_sent', + field=models.DateTimeField(blank=True, null=True), + ), + migrations.AddField( + model_name='callback', + name='timestamp_trade', + field=models.DateTimeField(blank=True, null=True), + ), + migrations.AddField( + model_name='callback', + name='title', + field=models.CharField(blank=True, max_length=1024, null=True), + ), + migrations.AlterField( + model_name='hook', + name='hook', + field=models.CharField(max_length=255, unique=True), + ), + migrations.AlterField( + model_name='hook', + name='name', + field=models.CharField(blank=True, max_length=1024, null=True, unique=True), + ), + ] diff --git a/core/views/hooks.py b/core/views/hooks.py index a2d2ea0..a78ed05 100644 --- a/core/views/hooks.py +++ b/core/views/hooks.py @@ -8,11 +8,11 @@ from django.views import View from rest_framework.parsers import FormParser, JSONParser from rest_framework.views import APIView from serde import ValidationError -from core.util import logs from core.forms import HookForm from core.lib.serde import drakdoo from core.models import Callback, Hook +from core.util import logs log = logs.get_logger(__name__)