Serialisation function

This commit is contained in:
Rémi Oudin 2018-02-24 18:40:27 +01:00
parent c58f42476f
commit 12c8c652d7

View file

@ -137,6 +137,15 @@ class BrowserFingerprint(models.Model):
def __str__(self):
return self.description
def serialize_headers(self):
return {
"Description" : str(self.description),
"User-Agent" : str(self.useragent),
"Accept-Encoding" : str(self.accept_encoding),
"Accept" : str(self.accept_default),
"Accept-Language" : str(self.accept_lang),
}
class SearchEngine(models.Model):
''' A search engine, and all the data needed to use it '''