Commit 0dcac1d6 authored by Chris Lamb's avatar Chris Lamb 💬

Use django.utils.timezone in Django 2.x.

parent 7d19e69c
import datetime
import functools
from django.db import models
from django.urls import reverse
from django.utils import timezone
from django.utils.crypto import get_random_string
......@@ -25,7 +25,7 @@ class Submission(models.Model):
'keys.Key', related_name='submissions', on_delete=models.CASCADE
)
created = models.DateTimeField(default=datetime.datetime.utcnow)
created = models.DateTimeField(default=timezone.now)
class Meta:
ordering = ('created',)
......
import datetime
from django.db import models
from django.urls import reverse
from django.utils import timezone
class Buildinfo(models.Model):
......@@ -31,7 +30,7 @@ class Buildinfo(models.Model):
environment = models.TextField()
created = models.DateTimeField(default=datetime.datetime.utcnow)
created = models.DateTimeField(default=timezone.now)
class Meta:
ordering = ('-created',)
......@@ -76,7 +75,7 @@ class Binary(models.Model):
on_delete=models.CASCADE,
)
created = models.DateTimeField(default=datetime.datetime.utcnow)
created = models.DateTimeField(default=timezone.now)
class Meta:
ordering = ('binary__name',)
......@@ -108,7 +107,7 @@ class Checksum(models.Model):
Binary, null=True, related_name='checksum', on_delete=models.CASCADE
)
created = models.DateTimeField(default=datetime.datetime.utcnow)
created = models.DateTimeField(default=timezone.now)
class Meta:
ordering = ('-created',)
......@@ -122,7 +121,7 @@ class Checksum(models.Model):
class Origin(models.Model):
name = models.CharField(max_length=255)
created = models.DateTimeField(default=datetime.datetime.utcnow)
created = models.DateTimeField(default=timezone.now)
class Meta:
ordering = ('name',)
......
import datetime
from django.db import models, transaction
from django.utils import timezone
class Key(models.Model):
......@@ -8,7 +9,7 @@ class Key(models.Model):
name = models.TextField()
created = models.DateTimeField(default=datetime.datetime.utcnow)
created = models.DateTimeField(default=timezone.now)
class Meta:
ordering = ('-created',)
......
......@@ -2,12 +2,13 @@ import datetime
from django.db import models
from django.urls import reverse
from django.utils import timezone
class Source(models.Model):
name = models.CharField(max_length=200, unique=True)
created = models.DateTimeField(default=datetime.datetime.utcnow)
created = models.DateTimeField(default=timezone.now)
class Meta:
ordering = ('name',)
......@@ -37,7 +38,7 @@ class Binary(models.Model):
class Architecture(models.Model):
name = models.CharField(max_length=200, unique=True)
created = models.DateTimeField(default=datetime.datetime.utcnow)
created = models.DateTimeField(default=timezone.now)
class Meta:
ordering = ('name',)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment