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

.save() should handle INSERT and UPDATE depending on situation. #596

Closed
IVIyg0t opened this issue Feb 18, 2022 · 0 comments
Closed

.save() should handle INSERT and UPDATE depending on situation. #596

IVIyg0t opened this issue Feb 18, 2022 · 0 comments
Labels
bug An existing feature is not working as intended

Comments

@IVIyg0t
Copy link

IVIyg0t commented Feb 18, 2022

Describe the bug
Model.save() should handle both INSERT and UPDATE situations.

To Reproduce
Steps to reproduce the behavior:

from models.Post import Post

# Create an empty model
post = Post()

# Populate fields
post.title = "Some Title"
post.content = "Some Content"

# Save post (should INSERT)
post.save()

Expected behavior
.save() should create a new record if it doesn't exist, otherwise update.

Desktop (please complete the following information):

  • OS: Mac OSX M1Max

What database are you using?

  • Type: Postgres
  • Version 13
  • Masonite ORM: 1.3.0 (latest)
@IVIyg0t IVIyg0t added the bug An existing feature is not working as intended label Feb 18, 2022
@IVIyg0t IVIyg0t closed this as completed Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An existing feature is not working as intended
Projects
None yet
Development

No branches or pull requests

1 participant