from django.db import models from django.conf import settings class OrganizationTopicUrgency(models.Model): organization = models.ForeignKey( 'pingcap_sso.Organization', on_delete=models.CASCADE) creator = models.ForeignKey( settings.AUTH_USER_MODEL, on_delete=models.CASCADE) topic_id = models.IntegerField() day = models.DateField() first_respond_time = models.DateTimeField(blank=True, null=True) first_respond_staff = models.ForeignKey( settings.AUTH_USER_MODEL, on_delete=models.DO_NOTHING, related_name='first_respond_urgency_topics', blank=True, null=True) most_reply_staff = models.ForeignKey( settings.AUTH_USER_MODEL, on_delete=models.DO_NOTHING, related_name='most_reply_urgency_topics', blank=True, null=True) solved_at = models.DateTimeField(blank=True, null=True) created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) URGENCY_CONSUMED_POINTS = 200 class Meta: db_table = 'pingcap_organization_topic_urgencies' unique_together = ('organization', 'topic_id')