Verified Commit 299484d7 authored by Peter Stanko's avatar Peter Stanko
Browse files

Schema update - added course and project id for the submission

parent 9527d1e7
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -132,9 +132,11 @@ class DataFactory(object):
        role.description = desc or f"{name.capitalize()}'s role"
        role.description = desc or f"{name.capitalize()}'s role"
        return role
        return role


    def create_project(self, course, name, codename, config=None) -> Project:
    def create_project(self, course, name=None, codename=None, config=None) -> Project:
        config = config or {}
        config = config or {}
        desc = name + "'s description"
        desc = name + "'s description"
        name = name or codename
        codename = codename or name
        project = self.__create_entity(Project, course=course, name=name,
        project = self.__create_entity(Project, course=course, name=name,
                                       codename=codename, description=desc)
                                       codename=codename, description=desc)
        project.set_config(**config)
        project.set_config(**config)
+2 −1
Original line number Original line Diff line number Diff line
@@ -39,7 +39,8 @@ class Config(object):
class DevelopmentConfig(Config):
class DevelopmentConfig(Config):
    """Development configuration
    """Development configuration
    """
    """
    SQLALCHEMY_DATABASE_URI = f"sqlite:///{paths.ROOT_DIR}/devel.db"
    #SQLALCHEMY_DATABASE_URI = f"sqlite:///{paths.ROOT_DIR}/devel.db"
    SQLALCHEMY_DATABASE_URI = f"postgresql://postgres:postgres@localhost:5432/postgres"
    SQLALCHEMY_TRACK_MODIFICATIONS = True
    SQLALCHEMY_TRACK_MODIFICATIONS = True
    PORTAL_ENV = 'dev'
    PORTAL_ENV = 'dev'
    PORTAL_ADMIN_USER_PASSWORD = '789789'
    PORTAL_ADMIN_USER_PASSWORD = '789789'
+3 −1
Original line number Original line Diff line number Diff line
@@ -53,7 +53,9 @@ class NestedCollection:
            'Course': ('id', 'codename'),
            'Course': ('id', 'codename'),
            'User': ('id', 'username', 'uco'),
            'User': ('id', 'username', 'uco'),
            'Component': ('id', 'name', 'type'),
            'Component': ('id', 'name', 'type'),
            'Submission': ('id', 'state', 'user.id', 'user.username'),
            'Submission': ('id', 'state', 'user.id', 'user.username',
                           'project.id', 'project.codename',
                           'project.course.id', 'project.course.codename'),
            'ReviewItem': ('id', 'review.id', 'line', 'content', 'file', 'user.id'),
            'ReviewItem': ('id', 'review.id', 'line', 'content', 'file', 'user.id'),
            }
            }