blob: 2b72774e18787336cd60a34664db5b7b5ceee5ba [file] [log] [blame]
Dirk Vogtf130c752016-08-23 14:45:01 +02001 # -*- coding: utf-8 -*-
2from django.db import models
3import datetime
4
5def crashreport_file_name(instance, filename):
6 return '/'.join(['saved_crashreports', instance.uuid, str(datetime.date.today().year), str(datetime.date.today().month), str(datetime.date.today().day), filename])
7
8
9class Crashreport(models.Model):
10 uuid = models.CharField(max_length=200)
Dirk Vogt1433f7c2016-09-20 15:30:56 +020011 report_type = models.CharField(max_length=200)
12 app_version = models.IntegerField()
Dirk Vogtf130c752016-08-23 14:45:01 +020013 uptime = models.CharField(max_length=200)
14 build_fingerprint = models.CharField(max_length=200)
15 boot_reason = models.CharField(max_length=200)
16 power_on_reason = models.CharField(max_length=200)
17 power_off_reason = models.CharField(max_length=200)
18 aux_data = models.CharField(max_length=200)
19 date = models.DateTimeField()
20 crashreport_file = models.FileField(upload_to=crashreport_file_name,null=True, blank=True)