Add memo, should_bill fields to Usage table
This commit is contained in:
parent
1457714642
commit
2cbb872248
|
@ -172,10 +172,12 @@ class Usage(models.Model):
|
||||||
|
|
||||||
device = models.CharField(max_length=64)
|
device = models.CharField(max_length=64)
|
||||||
start_time = models.DateTimeField(auto_now_add=True)
|
start_time = models.DateTimeField(auto_now_add=True)
|
||||||
last_update = models.DateTimeField(auto_now=True)
|
updated_at = models.DateTimeField(auto_now=True)
|
||||||
num_seconds = models.IntegerField()
|
num_seconds = models.IntegerField()
|
||||||
|
memo = models.TextField(blank=True)
|
||||||
|
should_bill = models.BooleanField(default=True)
|
||||||
|
|
||||||
history = HistoricalRecords(excluded_fields=['num_seconds'])
|
history = HistoricalRecords(excluded_fields=['num_seconds', 'updated_at'])
|
||||||
|
|
||||||
class HistoryIndex(models.Model):
|
class HistoryIndex(models.Model):
|
||||||
content_type = models.ForeignKey(ContentType, null=True, on_delete=models.SET_NULL)
|
content_type = models.ForeignKey(ContentType, null=True, on_delete=models.SET_NULL)
|
||||||
|
|
|
@ -663,6 +663,7 @@ class StatsViewSet(viewsets.ViewSet, List):
|
||||||
username=username,
|
username=username,
|
||||||
device=device,
|
device=device,
|
||||||
num_seconds=0,
|
num_seconds=0,
|
||||||
|
memo='',
|
||||||
)
|
)
|
||||||
logging.info('New %s session created for: %s', device, username or '[no username]')
|
logging.info('New %s session created for: %s', device, username or '[no username]')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user