The Demographics CTA is used to ask users to respond to the optional questions. This API and model support the API being dismissed by the user so they are not bothered by it.
25 lines
767 B
Python
25 lines
767 B
Python
from django.contrib.auth import get_user_model
|
|
from django.db import models
|
|
from model_utils.models import TimeStampedModel
|
|
from simple_history.models import HistoricalRecords
|
|
|
|
User = get_user_model()
|
|
|
|
|
|
class UserDemographics(TimeStampedModel):
|
|
"""
|
|
A Users Demographics platform related data in support of the Demographics
|
|
IDA and features
|
|
"""
|
|
user = models.ForeignKey(User, on_delete=models.CASCADE)
|
|
show_call_to_action = models.BooleanField(default=True)
|
|
history = HistoricalRecords(app='demographics')
|
|
|
|
class Meta(object):
|
|
app_label = "demographics"
|
|
verbose_name = "user demographic"
|
|
verbose_name_plural = "user demographic"
|
|
|
|
def __str__(self):
|
|
return 'UserDemographics for {}'.format(self.user)
|