Werkzeug==2.2.2
Flask-SQLAlchemy
Flask-Migrate
-psycopg2-binary
\ No newline at end of file
+psycopg2-binary==2.9.10
+marshmallow-sqlalchemy
+flask-marshmallow
\ No newline at end of file
Werkzeug==2.2.2
validators==0.20.0
Flask-Migrate
+ marshmallow-sqlalchemy
+ flask-marshmallow
setenv = cd = {toxinidir}/tests
commands =
+# ==================================================================================
+#
+# Copyright (c) 2024 Samsung Electronics Co., Ltd. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# ==================================================================================
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
+# ==================================================================================
+#
+# Copyright (c) 2024 Samsung Electronics Co., Ltd. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# ==================================================================================
from . import db
class FeatureGroup(db.Model):
db_org = db.Column(db.String(128), nullable=False)
measurement = db.Column(db.String(1000), nullable=False)
enable_dme = db.Column(db.Boolean, nullable=False)
- measured_obj_class = db.Column(db.String(20000), nullable=False)
- dme_port = db.Column(db.String(128), nullable=False)
- source_name = db.Column(db.String(20000), nullable=False)
+ measured_obj_class = db.Column(db.String(20000), nullable=True)
+ dme_port = db.Column(db.String(128), nullable=True)
+ source_name = db.Column(db.String(20000), nullable=True)
def __repr__(self):
return f'<featuregroup {self.featuregroup_name}>'
\ No newline at end of file
+# ==================================================================================
+#
+# Copyright (c) 2024 Samsung Electronics Co., Ltd. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# ==================================================================================
+
from . import db
from datetime import datetime
from sqlalchemy.sql import func
model_url = db.Column(db.String(1000), nullable=False)
notification_url = db.Column(db.String(1000), nullable=False)
deletion_in_progress = db.Column(db.Boolean, nullable=False)
- is_mme = db.Column(db.Boolean, nullable=False)
- model_name = db.Column(db.String(128), nullable=False)
- model_info = db.Column(db.String(1000), nullable=False)
+ is_mme = db.Column(db.Boolean, nullable=True)
+ model_name = db.Column(db.String(128), nullable=True)
+ model_info = db.Column(db.String(1000), nullable=True)
def __repr__(self):
return f'<Trainingjob {self.trainingjob_name}>'
\ No newline at end of file
--- /dev/null
+from flask_marshmallow import Marshmallow
+
+ma = Marshmallow()
+
+from trainingmgr.schemas.trainingjob_schema import TrainingJobSchema
+from trainingmgr.schemas.featuregroup_schema import FeatureGroupSchema
+
+__all_ = ['TrainingJobSchema', 'FeatureGroupSchema']
\ No newline at end of file
--- /dev/null
+# ==================================================================================
+#
+# Copyright (c) 2024 Samsung Electronics Co., Ltd. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# ==================================================================================
+
+from trainingmgr.schemas import ma
+from trainingmgr.models import FeatureGroup
+
+class FeatureGroupSchema(ma.SQLAlchemyAutoSchema):
+ class Meta:
+ model = FeatureGroup
+ include_relationships = True
+ load_instance = True
--- /dev/null
+# ==================================================================================
+#
+# Copyright (c) 2024 Samsung Electronics Co., Ltd. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# ==================================================================================
+
+from trainingmgr.schemas import ma
+from trainingmgr.models import TrainingJob
+
+class TrainingJobSchema(ma.SQLAlchemyAutoSchema):
+ class Meta:
+ model = TrainingJob
+ include_relationships = True
+ load_instance = True
\ No newline at end of file
get_field_of_given_version,get_all_jobs_latest_status_version, get_info_of_latest_version, \
get_feature_groups_db, get_feature_group_by_name_db, delete_feature_group_by_name, delete_trainingjob_version, change_field_value_by_version
from trainingmgr.models import db, TrainingJob, FeatureGroup
+from trainingmgr.schemas import ma, TrainingJobSchema , FeatureGroupSchema
APP = Flask(__name__)
TRAININGMGR_CONFIG_OBJ = None