Ignore objects with no get_full_tree method
Fixed signatures of dynamic resources

Commit e181b2 changed the parameter names in `shiva.http.Resource` and they
were not updated in the dynamic resources.
Merge pull request #115 from tooxie/signatures

Fixed signatures of dynamic resources
Added User model
Added UserResource resource
Removed  field from User
Added `password` field to User

FIXME: Password is stored in plain text.
Explicit assignations and simpler signature
Changed destination path for converted files

The converter won't pollute the directory where files are originally stored any
more. Now it creates a sub directory named after the file extension and stores
the new files there.
#
#
# diff --git a/shiva/converter.py b/shiva/converter.py
# index c01956b..f5bc4dd 100644
# --- a/shiva/converter.py
# +++ b/shiva/converter.py
# @@ -74,7 +74,13 @@ class Converter(object):
#
#          """
#
# -        return os.path.dirname(self.track.path)
# +        file_path = os.path.dirname(self.track.path)
# +        path = os.path.join(file_path, self.mimetype.extension)
# +
# +        if not os.path.exists(path):
# +            os.mkdir(path)
# +
# +        return path
#
#      def get_dest_filename(self):
#          filename = os.path.basename(self.track.path)
Handling the case of filenames starting with a dot
Checking ALLOW_DELETE in a decorator

If the check is in the delete() method, when a resource overwrites the method
the check is lost. This way, we can freely overload any method and the check
will still be performed.
#
#
# diff --git a/shiva/decorators.py b/shiva/decorators.py
# index a647e16..67a0aff 100644
# --- a/shiva/decorators.py
# +++ b/shiva/decorators.py
# @@ -1,6 +1,29 @@
# +# -*- coding: utf-8 -*-
#  from functools import wraps
#  from flask import g, request, make_response
#  from flask import current_app as app
# +from flask.ext import restful
# +
# +
# +def allow_method(func=None):
# +    """Checks if the method is globally allowed, raising a 405 if not.
# +    """
# +
# +    def wrapped(func):
# +        @wraps(func)
# +        def decorated(*args, **kwargs):
# +            allow_delete = app.config.get('ALLOW_DELETE', False)
# +            if func.func_name == 'delete' and not allow_delete:
# +                restful.abort(405)
# +
# +            return func(*args, **kwargs)
# +
# +        return decorated
# +
# +    if func:
# +        return wrapped(func)
# +
# +    return wrapped
#
#
#  def allow_origins(func=None, custom_origins=None):
# diff --git a/shiva/http.py b/shiva/http.py
# index 7fed87f..166f675 100644
# --- a/shiva/http.py
# +++ b/shiva/http.py
# @@ -4,14 +4,16 @@ from math import ceil
#  from flask import current_app as app, Response, request, g
#  from flask.ext import restful
#
# -from shiva.decorators import allow_origins
# +from shiva.decorators import allow_origins, allow_method
#
#
#  class Resource(restful.Resource):
#      def __new__(cls, *args, **kwargs):
# +        cls.method_decorators.append(allow_method)
# +
#          if app.config.get('CORS_ENABLED') is True:
#              # Applies to all inherited resources
# -            cls.method_decorators = [allow_origins]
# +            cls.method_decorators.append(allow_origins)
#
#          return super(Resource, cls).__new__(cls, *args, **kwargs)
#
# @@ -135,9 +137,6 @@ class Resource(restful.Resource):
#          if not id:
#              return restful.abort(405)
#
# -        if not app.config.get('ALLOW_DELETE', False):
# -            return restful.abort(405)
# -
#          item = self._by_id(id)
#
#          g.db.session.delete(item)