Add model for a webpage and website
This commit is contained in:
parent
114c8a3d3e
commit
6531415d63
1 changed files with 28 additions and 0 deletions
|
@ -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 '''
|
||||
|
||||
|
|
Loading…
Reference in a new issue