index.community/scraper/models.py

21 lines
686 B
Python
Raw Normal View History

2018-08-26 00:32:55 +00:00
from django.db import models
class Instance(models.Model):
2018-08-26 01:17:10 +00:00
name = models.CharField(max_length=200, primary_key=True)
peers = models.ManyToManyField('self', symmetrical=False)
2018-08-26 00:32:55 +00:00
class InstanceStats(models.Model):
timestamp = models.DateTimeField(auto_now_add=True)
instance = models.ForeignKey(
2018-08-26 01:17:10 +00:00
Instance,
2018-08-26 00:32:55 +00:00
on_delete=models.CASCADE,
2018-08-26 22:12:24 +00:00
related_name='stats',
2018-08-26 00:32:55 +00:00
)
2018-08-26 01:17:10 +00:00
num_peers = models.IntegerField(blank=True, null=True)
num_statuses = models.IntegerField(blank=True, null=True)
num_users = models.IntegerField(blank=True, null=True)
version = models.CharField(max_length=1000, blank=True)
2018-08-26 00:32:55 +00:00
status = models.CharField(max_length=100)