-
Notifications
You must be signed in to change notification settings - Fork 0
Fix/unused params #180
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
Fix/unused params #180
Changes from 12 commits
38294b2
6f356ca
2c2006b
5c7f3d0
b8d54fd
ff05710
48d3099
4c8dce4
7bc24af
87fe6cc
5f87529
743c5e9
6203f45
73d74b7
5655daa
0b8c68b
8a7d7bd
3a03159
8b8765c
dd6af0e
a36f4ba
310b7ae
76b4a3d
dd432ea
f5d7985
601aff5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,7 +10,7 @@ class Data(Base): | |||||||||
| id: Mapped[str] = mapped_column( | ||||||||||
| String, primary_key=True, default=lambda: str(uuid.uuid4()).replace("-", "") | ||||||||||
| ) | ||||||||||
| name: Mapped[str] = mapped_column(String, nullable=False) | ||||||||||
| # name: Mapped[str] = mapped_column(String, nullable=False) | ||||||||||
| native_file_name: Mapped[str] = mapped_column(String, nullable=False) | ||||||||||
| viewable_file_name: Mapped[str] = mapped_column(String, nullable=False) | ||||||||||
| geode_object: Mapped[str] = mapped_column(String, nullable=False) | ||||||||||
|
|
@@ -21,7 +21,6 @@ class Data(Base): | |||||||||
|
|
||||||||||
| @staticmethod | ||||||||||
| def create( | ||||||||||
| name: str, | ||||||||||
| geode_object: str, | ||||||||||
| input_file: str | None = None, | ||||||||||
| additional_files: list[str] | None = None, | ||||||||||
|
|
@@ -30,7 +29,6 @@ def create( | |||||||||
| additional_files = additional_files if additional_files is not None else [] | ||||||||||
|
|
||||||||||
| data_entry = Data( | ||||||||||
| name=name, | ||||||||||
| geode_object=geode_object, | ||||||||||
| input_file=input_file, | ||||||||||
| additional_files=additional_files, | ||||||||||
|
|
@@ -42,3 +40,7 @@ def create( | |||||||||
| database.session.add(data_entry) | ||||||||||
| database.session.flush() | ||||||||||
| return data_entry | ||||||||||
|
|
||||||||||
| @classmethod | ||||||||||
| def get(cls, data_id: str) -> "Data | None": | ||||||||||
|
||||||||||
| @classmethod | |
| def get(cls, data_id: str) -> "Data | None": | |
| @staticmethod | |
| def get(data_id: str) -> "Data | None": |
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.
Les 2 fonctionnent, mais si on choisit d'utiliser @staticmethod, c'est un peu différent : fonction ne dépendant pas de la classe et il faut ré adapter les appels à la méthode get en précisant le model Data en paramètre
Je vais faire un commit avec les changements nécessaires
@BotellaA
Uh oh!
There was an error while loading. Please reload this page.