mirror of
https://github.com/gamaio/gama_api.git
synced 2024-12-22 10:32:41 +00:00
Allow even more null fields
This commit is contained in:
parent
37761d9b82
commit
16f0a963be
36
core/migrations/0005_auto_20170602_0231.py
Normal file
36
core/migrations/0005_auto_20170602_0231.py
Normal 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),
|
||||||
|
),
|
||||||
|
]
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user