Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Writer api #18

Merged
merged 15 commits into from
May 16, 2023
Merged

Writer api #18

merged 15 commits into from
May 16, 2023

Conversation

piyusql
Copy link
Contributor

@piyusql piyusql commented Apr 18, 2023

No description provided.

piyusql added 6 commits April 5, 2023 08:53
other than dict types are not allowed

Signed-off-by: Piyus Kumar <[email protected]>
Added PUT method to update single row object
this will always lookup using pk
and can update non restricted columns.

References #15

Signed-off-by: Piyus Kumar <[email protected]>
@vmwclabot
Copy link

@Piyusgupta, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

@vmwclabot
Copy link

@piyusql, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

@vmwclabot
Copy link

@piyusql, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

preyunk added 2 commits May 5, 2023 11:06
This change includes a new urls which writes (create or update) the django model
based on the parameters passed such as db_name or pk. If a primary key is included in
the url then bridgeql will try to update the model, else it will create it.

Added test cases.

Signed-off-by: Priyank Singh <[email protected]>
While updating a model if primary key used to get the model is invalid,
then bridgeql raises an InvalidPKException.

Added test cases.

Signed-off-by: Priyank Singh <[email protected]>
@vmwclabot
Copy link

@piyusql, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

@preyunk preyunk marked this pull request as ready for review May 5, 2023 06:14
@preyunk preyunk marked this pull request as draft May 8, 2023 11:13
Inorder to support patch method, we need to retrieve payload
directly from request body since there is no equivalent
`request.POST` for patch method. However this introduces a constraint
that the client should always pass the request body in json format
with content type `applicaton/json`.
Added a better way of handling exception

Fixed test cases

Signed-off-by: Priyank Singh <[email protected]>
@vmwclabot
Copy link

@piyusql, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

@vmwclabot
Copy link

@piyusql, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

@piyusql piyusql marked this pull request as ready for review May 10, 2023 17:19
use separate auth for reader and writer, `BRIDGEQL_AUTHENTICATION_DECORATOR` now accepts,
a dictionary with attributes reader and writer containing their respective auth decorator import path.

Added test cases to verify auth decorators and update model when field is not present in the model.

Signed-off-by: Priyank Singh <[email protected]>
@vmwclabot
Copy link

@piyusql, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

Copy link
Contributor Author

@piyusql piyusql left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, few things to address before merge.

setattr(self.instance, key, val)
# Perform validation
self.instance.full_clean()
self.instance.validate_unique()
except (ValidationError, AttributeError) as e:
raise InvalidRequest(str(e))
self.instance.save()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this up inside try/except and change AttributeError -> IntegrityError

@piyusql piyusql requested a review from preyunk May 12, 2023 15:11
@vmwclabot
Copy link

@piyusql, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

URLs are now of the pattern create/, read/, update/. New url of delete would also be added
which would delete the resource based on the primary key.

Minor fixes, resolved reviews, updated test cases and README

Signed-off-by: Priyank Singh <[email protected]>
@vmwclabot
Copy link

@piyusql, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

Signed-off-by: Priyank Singh <[email protected]>
@vmwclabot
Copy link

@piyusql, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

@preyunk preyunk merged commit 4b98811 into main May 16, 2023
@piyusql piyusql deleted the writer-api branch May 24, 2023 14:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants