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

[Concept] Drop reduntant model param #120

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion fastcrud/endpoint/crud_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ async def add_routes_to_router(self, ...):
endpoint_creator_class = endpoint_creator or EndpointCreator
endpoint_creator_instance = endpoint_creator_class(
session=session,
model=model,
crud=crud,
create_schema=create_schema,
update_schema=update_schema,
Expand Down
10 changes: 2 additions & 8 deletions fastcrud/endpoint/endpoint_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ def get_current_user(token: str = Depends(oauth2_scheme)):
def __init__(
self,
session: Callable,
model: ModelType,
create_schema: Type[CreateSchemaType],
update_schema: Type[UpdateSchemaType],
crud: Optional[FastCRUD] = None,
Expand All @@ -228,13 +227,8 @@ def __init__(
}
self.primary_key_names = [pk.name for pk in self._primary_keys]
self.session = session
self.crud = crud or FastCRUD(
model=model,
is_deleted_column=is_deleted_column,
deleted_at_column=deleted_at_column,
updated_at_column=updated_at_column,
)
self.model = model
self.crud = crud
self.model = self.crud.model
self.create_schema = create_schema
self.update_schema = update_schema
self.delete_schema = delete_schema
Expand Down
Loading