diff --git a/core/migrations/0005_auto_20170602_0231.py b/core/migrations/0005_auto_20170602_0231.py new file mode 100644 index 0000000..275cdae --- /dev/null +++ b/core/migrations/0005_auto_20170602_0231.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.1 on 2017-06-02 02:31 +from __future__ import unicode_literals + +import django.contrib.postgres.fields.jsonb +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0004_auto_20170602_0146'), + ] + + operations = [ + migrations.AlterField( + model_name='api_apps', + name='callback_uri', + field=models.URLField(blank=True, max_length=3000), + ), + migrations.AlterField( + model_name='api_apps', + name='settings', + field=django.contrib.postgres.fields.jsonb.JSONField(blank=True), + ), + migrations.AlterField( + model_name='api_apps', + name='website', + field=models.URLField(blank=True, max_length=3000), + ), + migrations.AlterField( + model_name='api_heartbeat', + name='data', + field=django.contrib.postgres.fields.jsonb.JSONField(blank=True), + ), + ] diff --git a/core/models.py b/core/models.py index 2fecd9c..882df86 100644 --- a/core/models.py +++ b/core/models.py @@ -26,9 +26,9 @@ class api_apps(models.Model): apikey = models.CharField(max_length=256, unique=True, blank=False) name = models.CharField(max_length=512, unique=True, blank=False) description = models.CharField(max_length=2048) - website = models.URLField(max_length=3000) - callback_uri = models.URLField(max_length=3000) - settings = JSONField() + website = models.URLField(max_length=3000, blank=True) + callback_uri = models.URLField(max_length=3000, blank=True) + settings = JSONField(blank=True) def __str__(self): return '%s (%s) - %s' % (self.name, self.owner.name, self.apikey) @@ -45,7 +45,7 @@ class api_heartbeat(models.Model): time_sent = models.DateTimeField(blank=False) time_rcvd = models.DateTimeField(blank=False) latency = models.FloatField(blank=False) - data = JSONField() + data = JSONField(blank=True) def __str__(self): return '%s (%s ms)' % (self.api.name, self.latency)