From 12c8c652d7ffbe0fad7359500dd03274943e27f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Oudin?= Date: Sat, 24 Feb 2018 18:40:27 +0100 Subject: [PATCH] Serialisation function --- profiles/models.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/profiles/models.py b/profiles/models.py index adb6040..dc8cab2 100644 --- a/profiles/models.py +++ b/profiles/models.py @@ -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 '''