17 lines
403 B
Python
17 lines
403 B
Python
from django.db import models
|
|
|
|
class Status (models.Model):
|
|
"""
|
|
Status Model
|
|
Defines the attributes of a status KeyPair
|
|
"""
|
|
key = models.CharField (primary_key = True, max_length = 20)
|
|
value = models.IntegerField (null = False)
|
|
ts = models.DateTimeField (auto_now_add = True)
|
|
|
|
def get_value (self):
|
|
return self.value, self.ts
|
|
|
|
def __repr__(self):
|
|
return self.key + ' is added.'
|