|
@@ -226,8 +226,10 @@ def model_add(model_name, metamodel_name, model_code=None):
|
|
# raises UnknownError
|
|
# raises UnknownError
|
|
# raises PermissionDenied
|
|
# raises PermissionDenied
|
|
# raises CompilationError
|
|
# raises CompilationError
|
|
|
|
+ global mode
|
|
if mode != MODE_MODELLING:
|
|
if mode != MODE_MODELLING:
|
|
raise InvalidMode()
|
|
raise InvalidMode()
|
|
|
|
+
|
|
# Do this before creating the model, as otherwise compilation errors would make us inconsistent
|
|
# Do this before creating the model, as otherwise compilation errors would make us inconsistent
|
|
if model_code is not None:
|
|
if model_code is not None:
|
|
try:
|
|
try:
|
|
@@ -242,6 +244,15 @@ def model_add(model_name, metamodel_name, model_code=None):
|
|
_input(compiled)
|
|
_input(compiled)
|
|
_output("Success")
|
|
_output("Success")
|
|
|
|
|
|
|
|
+def model_delete(model_name):
|
|
|
|
+ """Delete an existing model."""
|
|
|
|
+ global mode
|
|
|
|
+ if mode != MODE_MODELLING:
|
|
|
|
+ raise InvalidMode()
|
|
|
|
+
|
|
|
|
+ _input(["model_delete", model_name])
|
|
|
|
+ _handle_output("Success")
|
|
|
|
+
|
|
def model_modify(model_name):
|
|
def model_modify(model_name):
|
|
"""Modify an existing model."""
|
|
"""Modify an existing model."""
|
|
# return is_write
|
|
# return is_write
|