-
Notifications
You must be signed in to change notification settings - Fork 6
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
WIP: 1155 implement project backend #1158
Draft
longshuicy
wants to merge
35
commits into
main
Choose a base branch
from
1155-implement-project-backend
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
b5b6762
release updates
longshuicy d655342
Merge branch 'main' into release/v2.0-beta-3
longshuicy 4d136e8
1147 clowder 2 helm chart clean up (#1148)
longshuicy 91ad4e7
turn off default extractors
longshuicy b3395df
initial commit new model
tcnichol 1f73ead
adding db, out, in, etc
tcnichol d4c3904
save and get methods
tcnichol 1c83600
get method
tcnichol a89ebbb
add users to project
tcnichol a15adad
adding to do
tcnichol f5e69b3
add a remove project member
tcnichol 3b2cba9
routes for deleting and adding, removing members
tcnichol 250f22a
"project" not "group"
tcnichol 4dc5b94
methods for adding and removing datasets from projects
tcnichol 9252bef
remove license
tcnichol 6291cc0
adding and removing folders and files
tcnichol a679d7c
only add if a file, folder, dataset id not in the project already
tcnichol 9f2c8ac
beginning project tests
tcnichol 7a8b3d2
add test add dataset to project
tcnichol 0bd2f4b
formatting
tcnichol 5c508e2
adding routes to main
tcnichol 91e14cb
get project works
tcnichol daf3ed0
fixing add dataset to project
tcnichol 333f7fb
default value empty lists not none
tcnichol 8faab21
fixing the folder part
tcnichol d4d8a7e
fixing filex
tcnichol cf1b537
add pydantic id not string
tcnichol 67f5f40
file not folder
tcnichol 379b605
formatting
tcnichol dfcdbde
Merge branch 'main' into release/v2.0-beta-3
longshuicy 1a3df5a
Merge remote-tracking branch 'origin/release/v2.0-beta-3' into 1155-i…
tcnichol 9fed4de
test project needs a creator
tcnichol 4e9476e
ran pre commit
tcnichol 7575fee
codegen
tcnichol 36887c8
codegen
tcnichol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ class Settings(BaseSettings): | |
API_V2_STR: str = "/api/v2" | ||
admin_email: str = "[email protected]" | ||
frontend_url: str = "http://localhost:3000" | ||
version: str = "2.0.0-beta.2" | ||
version: str = "2.0.0-beta.3" | ||
|
||
# Unique secret for hashing API keys. Generate with `openssl rand -hex 32` | ||
local_auth_secret = "clowder_secret_key" | ||
|
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from datetime import datetime | ||
from enum import Enum, auto | ||
from typing import List, Optional | ||
|
||
import pymongo | ||
from app.models.authorization import AuthorizationDB, RoleType | ||
from app.models.groups import GroupOut | ||
from app.models.users import UserOut | ||
from beanie import Document, PydanticObjectId, View | ||
from pydantic import BaseModel, Field | ||
|
||
|
||
class Member(BaseModel): | ||
user: UserOut | ||
editor: bool = False | ||
|
||
|
||
class ProjectBase(BaseModel): | ||
id: PydanticObjectId = Field(default_factory=PydanticObjectId, alias="_id") | ||
name: str | ||
description: Optional[str] = None | ||
created: datetime = Field(default_factory=datetime.utcnow) | ||
modified: datetime = Field(default_factory=datetime.utcnow) | ||
dataset_ids: Optional[List[PydanticObjectId]] = [] | ||
folder_ids: Optional[List[PydanticObjectId]] = [] | ||
file_ids: Optional[List[PydanticObjectId]] = [] | ||
creator: UserOut | ||
users: List[Member] = [] | ||
|
||
|
||
class ProjectDB(Document, ProjectBase): | ||
class Settings: | ||
name = "projects" | ||
|
||
|
||
class ProjectIn(ProjectBase): | ||
pass | ||
|
||
|
||
class ProjectOut(ProjectDB): | ||
class Config: | ||
fields = {"id": "id"} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you might've accidentally committed the pycharm setting