Allow even more null fields

This commit is contained in:
c0de 2017-06-01 21:32:27 -05:00
parent 37761d9b82
commit 16f0a963be
2 changed files with 40 additions and 4 deletions

View File

@ -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),
),
]

View File

@ -26,9 +26,9 @@ class api_apps(models.Model):
apikey = models.CharField(max_length=256, unique=True, blank=False) apikey = models.CharField(max_length=256, unique=True, blank=False)
name = models.CharField(max_length=512, unique=True, blank=False) name = models.CharField(max_length=512, unique=True, blank=False)
description = models.CharField(max_length=2048) description = models.CharField(max_length=2048)
website = models.URLField(max_length=3000) website = models.URLField(max_length=3000, blank=True)
callback_uri = models.URLField(max_length=3000) callback_uri = models.URLField(max_length=3000, blank=True)
settings = JSONField() settings = JSONField(blank=True)
def __str__(self): def __str__(self):
return '%s (%s) - %s' % (self.name, self.owner.name, self.apikey) 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_sent = models.DateTimeField(blank=False)
time_rcvd = models.DateTimeField(blank=False) time_rcvd = models.DateTimeField(blank=False)
latency = models.FloatField(blank=False) latency = models.FloatField(blank=False)
data = JSONField() data = JSONField(blank=True)
def __str__(self): def __str__(self):
return '%s (%s ms)' % (self.api.name, self.latency) return '%s (%s ms)' % (self.api.name, self.latency)