Changes to node_schema

Now we use ObjectId for the user field and media for the picture field
(previously known as thumbnail).
This commit is contained in:
2015-04-13 01:21:57 +02:00
parent 1b85823f9b
commit 39544e96da
3 changed files with 9 additions and 27 deletions

View File

@@ -77,7 +77,7 @@ class TokensAuth(TokenAuth):
token_data = {
'user': user_id,
'token': token,
'expire_time': datetime.now()+timedelta(hours=1)
'expire_time': datetime.now() + timedelta(hours=1)
}
post_internal('tokens', token_data)
else:
@@ -101,7 +101,7 @@ class BasicsAuth(BasicAuth):
return True
class MyTokenAuth(BasicsAuth):
class CustomTokenAuth(BasicsAuth):
"""Switch between Basic and Token auth"""
def __init__(self):
self.token_auth = TokensAuth()
@@ -140,4 +140,4 @@ def post_item(entry, data):
post_internal(entry, data)
app = Eve(validator=ValidateCustomFields, auth=MyTokenAuth)
app = Eve(validator=ValidateCustomFields, auth=CustomTokenAuth)