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


import datetime
import json
from ..core import db
from bson import ObjectId

class VersionModel(db.Document):
    """CoRR backend version model.
    The model holding the environment version.

    Attributes:
        created_at: A string value of the creation timestamp.
        possible_system: A list of possible versioning systems.
        system: A string value of the current versioning system with unknown as default.
        baseline: A string value of version base line  and in most systems it's branches.
        marker: A string value of the version hash and in most systems it's the commit hash.
        extend: A dictionary of to add other fields to the version model.
    """
    created_at = db.StringField(default=str(datetime.datetime.utcnow()))
    possible_system = ["git", "mercurial", "subversion", "cvs", "bazaar", "arch", "monotone", "aegis", "fastcst", "opencm", "vesta", "codeville", "darcs", "bitkeeper", "perforce", "clearcase" , "unknown"]

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


# Path: corr-db/corrdb/common/models/version_model.py
import datetime
import json
from ..core import db
from bson import ObjectId


class VersionModel(db.Document):
    """CoRR backend version model.
    The model holding the environment version.

    Attributes:
        created_at: A string value of the creation timestamp.
        possible_system: A list of possible versioning systems.
        system: A string value of the current versioning system with unknown as default.
        baseline: A string value of version base line  and in most systems it's branches.
        marker: A string value of the version hash and in most systems it's the commit hash.
        extend: A dictionary of to add other fields to the version model.
    """
    created_at = db.StringField(default=str(datetime.datetime.utcnow()))
    possible_system = ["git", "mercurial", "subversion", "cvs", "bazaar", "arch", "monotone", "aegis", "fastcst", "opencm", "vesta", "codeville", "darcs", "bitkeeper", "perforce", "clearcase" , "unknown"]

    system = db.StringField(default="unknown", choices=possible_system)