@@ -238,6 +238,14 @@ class Demeter(object):
value = str(eval(exp))
return value
+ @classmethod
+ def curl(self, url):
+ module = __import__('tornado')
+ http = getattr(module, 'httpclient')
+ http_client = http.HTTPClient()
+ response = http_client.fetch(url)
+ return response
+
@classmethod
def error(self, string):
if self.request:
@@ -162,6 +162,8 @@ class Model(object):
Counter().unset()
def check(self, field, val, attr):
+ if val == 'undefined':
+ self.error(error)
if attr.match == 'not':
if not val:
self.error(field + ' not exists')