Commits

Denis Darii committed 6eea937

added SatelliteLog model

  • Participants
  • Parent commits e155d0f

Comments (0)

Files changed (1)

File vostok/models.py

     class Meta():
         verbose_name = _('satellite')
         verbose_name_plural = _('satellites')
+
+
+LOG_TYPE_CHOICES = (
+    (0, 'connected'),
+    (1, 'down'),
+    (2, 'asked for list'),
+    # TO DO: together investigate these choices
+)
+
+
+class SatelliteLog(models.Model):
+    satellite = models.ForeignKey(Satellite, verbose_name=_('satellite'))
+    log_type = models.SmallIntegerField(_('log type'),
+                                choices=LOG_TYPE_CHOICES)
+    created = models.DateTimeField(auto_now_add=True, editable=False)
+
+    def __unicode__(self):
+        return '%s - %s' % (unicode(self.satellite), self.type)
+
+    class Meta():
+        verbose_name = _('satellite log')
+        verbose_name_plural = _('satellite logs')