rabin 8 gadi atpakaļ
vecāks
revīzija
e029979f3c
1 mainītis faili ar 9 papildinājumiem un 0 dzēšanām
  1. 9 0
      core.py

+ 9 - 0
core.py

@@ -158,6 +158,15 @@ class Demeter(object):
 		fromtimestamp = getattr(datetime, 'fromtimestamp')
 		return str(fromtimestamp(value).strftime(string))
 
+	@staticmethod
+	def isJson(value):
+		result = False
+		try:
+			result = json.loads(value)
+		except ValueError:
+			return result
+		return result
+
 	@staticmethod
 	def error(string):
 		print string