Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Would be good to integrate two approaches to storing messages in database (Message and REoptjlMessageOutputs models), i.e. having just one model and handling messages from API and Julia consistently. #393

Open
hdunham opened this issue Dec 27, 2022 · 1 comment

Comments

@hdunham
Copy link
Collaborator

hdunham commented Dec 27, 2022

No description provided.

@hdunham
Copy link
Collaborator Author

hdunham commented Dec 27, 2022

What is currently being done:

in models.py:

  • Api messages are stored as individual instances of the Message model
  • Julia messages are stored all together in REoptjlMessageOutputs, which has an array for errors and an array for warnings

In save() in validators.py:

  • Message.create(meta=self.models["APIMeta"], message_type=msg_type, message=msg).save()

In process_results():

  • REoptjlMessageOutputs.create(meta=meta, **results["Messages"]).save()

In results view:

  • r["messages"][meta.Message.all().message_type] = msg.message
  • Does some processing of the values saved in REoptjlMessageOutputs and adds to r["messages"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant