From 8978d43fd1986ca9177005e58e5100fa5d8fc0b0 Mon Sep 17 00:00:00 2001 From: eric Date: Wed, 12 Feb 2020 22:39:27 -0500 Subject: [PATCH] use py3 metaclass syntax --- questionnaire/models.py | 9 +++------ questionnaire/page/models.py | 3 +-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/questionnaire/models.py b/questionnaire/models.py index db90b37..186794e 100644 --- a/questionnaire/models.py +++ b/questionnaire/models.py @@ -159,8 +159,7 @@ class DBStylesheet(models.Model): __str__ = __unicode__ -class QuestionSet(models.Model): - __metaclass__ = TransMeta +class QuestionSet(models.Model, metaclass=TransMeta): "Which questions to display on a question page" questionnaire = models.ForeignKey(Questionnaire, on_delete=models.CASCADE) @@ -356,8 +355,7 @@ class RunInfoHistory(models.Model): verbose_name_plural = 'Run Info History' -class Question(models.Model): - __metaclass__ = TransMeta +class Question(models.Model, metaclass=TransMeta): questionset = models.ForeignKey(QuestionSet, on_delete=models.CASCADE) number = models.CharField(max_length=8, help_text= @@ -484,8 +482,7 @@ class Question(models.Model): ["number", "questionset"], ] -class Choice(models.Model): - __metaclass__ = TransMeta +class Choice(models.Model, metaclass=TransMeta): question = models.ForeignKey(Question, on_delete=models.CASCADE) sortid = models.IntegerField() diff --git a/questionnaire/page/models.py b/questionnaire/page/models.py index 725e5c9..ef0b18d 100644 --- a/questionnaire/page/models.py +++ b/questionnaire/page/models.py @@ -2,8 +2,7 @@ from django.db import models from django.urls import reverse from transmeta import TransMeta -class Page(models.Model): - __metaclass__ = TransMeta +class Page(models.Model, metaclass=TransMeta): slug = models.SlugField(unique=True, primary_key=True) title = models.CharField(u"Title", max_length=256)