Skip to content

Commit

Permalink
switch fields (#98)
Browse files Browse the repository at this point in the history
* switch fields

* switch fields

* switch fields

* upgrade django

* upgrade django

* upgrade django

* upgrade django

* upgrade django

* upgrade django

* upgrade django
  • Loading branch information
aclowes authored Aug 17, 2022
1 parent 9189eb3 commit b773088
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 13 deletions.
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ version: 2
jobs:
build:
docker:
- image: circleci/python:3.5-jessie-node-browsers
- image: circleci/postgres:9.6
- image: cimg/python:3.8-browsers
- image: cimg/postgres:11.13
environment:
POSTGRES_USER: circleci
POSTGRES_HOST_AUTH_METHOD: trust
steps:
- checkout
- restore_cache:
keys:
- v2-{{ checksum "frontend/yarn.lock" }}-{{ checksum "setup.py" }}
- v2-{{ checksum "frontend/yarn.lock" }}
- v2
- v3-{{ checksum "frontend/yarn.lock" }}-{{ checksum "setup.py" }}
- v3-{{ checksum "frontend/yarn.lock" }}
- v3
- run: python -m venv pyenv && source pyenv/bin/activate && pip install -e .[test]
- run: cd frontend && yarn install
- save_cache:
key: v2-{{ checksum "frontend/yarn.lock" }}-{{ checksum "setup.py" }}
key: v3-{{ checksum "frontend/yarn.lock" }}-{{ checksum "setup.py" }}
paths:
- frontend/node_modules
- pyenv
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
# https://packaging.python.org/en/latest/requirements.html
install_requires=[
'psycopg2-binary>=2.7',
'django>=2.2',
'djangorestframework>=3.4',
'Django>=3.1',
'djangorestframework>=3.10',
'whitenoise>=3.0',
'gunicorn>=19',
'pyyaml>=5.1',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Generated by Django 4.1 on 2022-08-17 01:14

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('yawn', '0002_tasks_without_workflows'),
]

operations = [
migrations.AlterField(
model_name='execution',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='queue',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='run',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='run',
name='parameters',
field=models.JSONField(default=dict),
),
migrations.AlterField(
model_name='task',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='template',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='worker',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='workflow',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='workflow',
name='parameters',
field=models.JSONField(default=dict),
),
migrations.AlterField(
model_name='workflowname',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
]
4 changes: 2 additions & 2 deletions yawn/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
}
}

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
Expand Down Expand Up @@ -108,8 +110,6 @@

USE_I18N = True

USE_L10N = True

USE_TZ = True

# Static files (CSS, JavaScript, Images)
Expand Down
5 changes: 2 additions & 3 deletions yawn/workflow/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from django.db import models
from django.contrib.postgres import fields
from django.db.models import functions

from yawn.utilities import cron, database
Expand Down Expand Up @@ -40,7 +39,7 @@ class Meta:
next_run = models.DateTimeField(null=True)

# parameters
parameters = fields.JSONField(default=dict)
parameters = models.JSONField(default=dict)

def save(self, **kwargs):
if self.schedule_active:
Expand Down Expand Up @@ -100,7 +99,7 @@ class Run(models.Model):
submitted_time = models.DateTimeField()
scheduled_time = models.DateTimeField(null=True)
status = models.TextField(default=RUNNING, choices=STATUS_CHOICES)
parameters = fields.JSONField(default=dict)
parameters = models.JSONField(default=dict)

def update_status(self):
from yawn.task.models import Task
Expand Down

0 comments on commit b773088

Please sign in to comment.