Add models for Place and Event
This commit is contained in:
parent
6531415d63
commit
37581fb96a
1 changed files with 23 additions and 0 deletions
|
@ -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 '''
|
||||
|
||||
|
|
Loading…
Reference in a new issue