# Path: corr-db/corrdb/common/core.py
# def setup_app(name, config='config'):


import datetime
import json
import hashlib
import time
from ..core import db
from hurry.filesize import size
        from ..models import ProfileModel
        from ..models import ProfileModel
        from ..models import ProjectModel
        from ..models import ApplicationModel
        from ..models import FileModel
        from ..models import EnvironmentModel
        from ..models import CommentModel

# TODO: Issue with connected_at and datetime in general that makes it not stable in mongodb.
# TODO: Add the filemodel to the quota check.

class UserModel(db.Document):
    """CoRR backend user model.
    The model holding the user information.

    Attributes:
        created_at: A string value of the creation timestamp.
        connected_at: A string value of when the user connected last time.
        email: A string value of the user email.
        api_token: A string value of the api token access to the backend.
        session: A string value of the user web session token.
        possible_group: A list of user possible groups.
        group: A string value of the user current group with unknown as default.
        extend: A dictionary of to add other fields to the user model.
    """
    created_at = db.StringField(default=str(datetime.datetime.utcnow()))

# Path: corr-db/corrdb/common/core.py
# def setup_app(name, config='config'):


# Path: corr-db/corrdb/common/models/user_model.py
import datetime
import json
import hashlib
import time
from ..core import db
from hurry.filesize import size
        from ..models import ProfileModel
        from ..models import ProfileModel
        from ..models import ProjectModel
        from ..models import ApplicationModel
        from ..models import FileModel
        from ..models import EnvironmentModel
        from ..models import CommentModel


# TODO: Issue with connected_at and datetime in general that makes it not stable in mongodb.
# TODO: Add the filemodel to the quota check.

class UserModel(db.Document):
    """CoRR backend user model.
    The model holding the user information.

    Attributes:
        created_at: A string value of the creation timestamp.
        connected_at: A string value of when the user connected last time.
        email: A string value of the user email.
        api_token: A string value of the api token access to the backend.
        session: A string value of the user web session token.
        possible_group: A list of user possible groups.
        group: A string value of the user current group with unknown as default.
        extend: A dictionary of to add other fields to the user model.
    """
    created_at = db.StringField(default=str(datetime.datetime.utcnow()))

    connected_at = db.StringField(default=str(datetime.datetime.utcnow()))