Resolve all django deprecation warnings

This commit is contained in:
Griatch 2018-09-27 21:20:54 +02:00
parent 91b97fc05f
commit be5f289a8a
8 changed files with 29 additions and 30 deletions

View file

@ -5,10 +5,6 @@ from django.db.models.manager import Manager
class SharedMemoryManager(Manager):
# CL: this ensures our manager is used when accessing instances via
# ForeignKey etc. (see docs)
use_for_related_fields = True
# TODO: improve on this implementation
# We need a way to handle reverse lookups so that this model can
# still use the singleton cache, but the active model isn't required

View file

@ -17,14 +17,14 @@ class RegularCategory(models.Model):
class Article(SharedMemoryModel):
name = models.CharField(max_length=32)
category = models.ForeignKey(Category)
category2 = models.ForeignKey(RegularCategory)
category = models.ForeignKey(Category, on_delete=models.CASCADE)
category2 = models.ForeignKey(RegularCategory, on_delete=models.CASCADE)
class RegularArticle(models.Model):
name = models.CharField(max_length=32)
category = models.ForeignKey(Category)
category2 = models.ForeignKey(RegularCategory)
category = models.ForeignKey(Category, on_delete=models.CASCADE)
category2 = models.ForeignKey(RegularCategory, on_delete=models.CASCADE)
class SharedMemorysTest(TestCase):