Commit 97ffeb49 by Raphael Lullis

moving Function class from its own module to datatypes.

parent 4323b999
...@@ -176,6 +176,15 @@ class File(ParseType): ...@@ -176,6 +176,15 @@ class File(ParseType):
_absolute_url = property(lambda self: self._api_url) _absolute_url = property(lambda self: self._api_url)
class Function(ParseBase):
ENDPOINT_ROOT = '/'.join((API_ROOT, 'functions'))
def __init__(self, name):
self.name = name
def __call__(self, **kwargs):
return self.POST('/' + self.name, **kwargs)
class ParseResource(ParseBase, Pointer): class ParseResource(ParseBase, Pointer):
......
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from __init__ import ParseBase, API_ROOT
class Function(ParseBase):
ENDPOINT_ROOT = '/'.join((API_ROOT, 'functions'))
def __init__(self, name):
self.name = name
def __call__(self, **kwargs):
return self.POST('/' + self.name, **kwargs)
...@@ -14,8 +14,7 @@ import datetime ...@@ -14,8 +14,7 @@ import datetime
from core import ResourceRequestNotFound from core import ResourceRequestNotFound
from connection import register from connection import register
from datatypes import GeoPoint, Object from datatypes import GeoPoint, Object, Function
from function import Function
from user import User from user import User
import query import query
......
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