-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Progress porting to pydantic 2 * isort * Tests over BaseRTU * Test over File.construct_url * Test over User.construct_auth_type. * Test over Space.construct_url() * Test project.construct_url * Notebook model unit tests. * isort * Remove unused import * Another round of dependency updates * Test suite passing without warnings * lint * Remove bump-pydantic, no longer needed * Better changelog * Merge changelog * Move to new changelog section * clean up DeltaCallback class (not Pydantic anymore) --------- Co-authored-by: Kafonek <[email protected]>
- Loading branch information
James Robinson
and
Kafonek
authored
Nov 6, 2023
1 parent
48e0591
commit 583d25c
Showing
30 changed files
with
750 additions
and
493 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
import os | ||
from typing import Optional | ||
|
||
from pydantic import validator | ||
from pydantic import model_validator | ||
|
||
from origami.models.api.base import ResourceBase | ||
|
||
|
||
class Space(ResourceBase): | ||
name: str | ||
description: Optional[str] | ||
description: Optional[str] = None | ||
url: Optional[str] = None | ||
|
||
@validator("url", always=True) | ||
def construct_url(cls, v, values): | ||
@model_validator(mode="after") | ||
def construct_url(self): | ||
noteable_url = os.environ.get("PUBLIC_NOTEABLE_URL", "https://app.noteable.io") | ||
return f"{noteable_url}/s/{values['id']}" | ||
self.url = f"{noteable_url}/s/{self.id}" | ||
|
||
return self |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.