Commit 6fc03b73 by Dan Krause

Merge pull request #101 from dankrause/master

Add the ability to drop whole classes
parents 6c57fa86 746b34e6
......@@ -57,9 +57,12 @@ def master_key_required(func):
raise core.ParseError(message)
func(obj, *args, **kw)
return ret
# Using this as "default=" argument solve the problem with Datetime object not being JSON serializable
def date_handler(obj):
return obj.isoformat() if hasattr(obj, 'isoformat') else obj
class ParseBase(object):
ENDPOINT_ROOT = API_ROOT
......@@ -141,6 +144,11 @@ class ParseBase(object):
def DELETE(cls, uri, **kw):
return cls.execute(uri, 'DELETE', **kw)
@classmethod
def drop(cls):
return cls.POST("%s/schemas/%s" % (API_ROOT, cls.__name__),
_method="DELETE", _ClientVersion="browser")
class ParseBatcher(ParseBase):
"""Batch together create, update or delete operations"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment