Add model for a webpage and website

This commit is contained in:
Théophile Bastian 2018-01-24 14:09:33 +01:00
parent 114c8a3d3e
commit 6531415d63

View file

@ -13,6 +13,34 @@ class InvalidData(Exception):
return self.what
class Keyword(models.Model):
''' A keyword/search term '''
text = models.CharField(max_length=256)
def __str__(self):
return self.text
class Webpage(models.Model):
url = models.URLField()
def __str__(self):
return self.url
class Website(models.Model):
''' A website usually visited '''
name = models.CharField(max_length=256)
url = models.URLField()
keywords = models.ManyToManyField(Keyword)
notable_pages = models.ManyToManyField(Webpage)
def __str__(self):
return self.name
class BrowserFingerprint(models.Model):
''' A browser fingerprint, containing things like a user agent '''