Add models for Place and Event

This commit is contained in:
Théophile Bastian 2018-01-24 22:39:20 +01:00
parent 6531415d63
commit 37581fb96a

View file

@ -41,6 +41,29 @@ class Website(models.Model):
return self.name
class Place(models.Model):
''' A real-life place '''
name = models.CharField(max_length=256)
address = models.CharField(max_length=512)
lat = models.FloatField('Latitude', blank=True)
lon = models.FloatField('Longitude', blank=True)
def __str__(self):
return self.name
class Event(models.Model):
''' A real-life event (protests, meeting, ...) '''
name = models.CharField(max_length=256)
date = models.DateTimeField()
place = models.ForeignKey(Place, on_delete=models.CASCADE)
def __str__(self):
return self.name
class BrowserFingerprint(models.Model):
''' A browser fingerprint, containing things like a user agent '''