Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Queries regarding UpdateSchemaInternalType & DeleteSchemaType #146

Open
jd-solanki opened this issue Aug 8, 2024 · 2 comments
Open

Queries regarding UpdateSchemaInternalType & DeleteSchemaType #146

jd-solanki opened this issue Aug 8, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@jd-solanki
Copy link

Describe the bug or question
Hi 👋🏻

First of all great library. I wanted to create something like this and it already exist 😅

I already have similar approach in my previous project but as you also provide great filtering & sorting out of the box I would like to give it a try.

Question: I was migrating from my own CRUD to FastCRUD and realized there's two new schemas UpdateSchemaInternalType & DeleteSchemaType. I wanted to know why those two exist?

  • UpdateSchemaInternalType: I searched the docs & also checked the source but schema isn't used anywher, Am I right? If yes, Should we remove it from passing it for static typing?
  • DeleteSchemaType: Most of the time this is not required and also in source code I can see it's just inheriting the BaseModel so should we also remove it? Moreover, I'm not aware of whole code strcuture but I noticed there's conditional addition of delete endpoint based on this schema I guess.

To Reproduce
n/a

Description
above

Screenshots
n/a

Additional context
How's your plan for improving types for filtering because after reading docs it looks like FilterConfig is not type safe 🤔

@igorbenav
Copy link
Owner

igorbenav commented Aug 11, 2024

Hey, @jd-solanki, nice to know you like it!

Some of it is because of how FastCRUD evolved, it started inside of fastapi boilerplate, back when it was still a CRUDBase, and the idea of an internal update schema came from this:

class UserUpdateInternal(UserUpdate):
    updated_at: datetime

Theoretically, if you passed an UpdateInternalType, the updated_at column should be modified.

The point of the DeleteSchema is the same, but it kind of evolved from if passing a DeleteSchema to if has an is_deleted attribute.

So basically, you may open a PR or discussion about removing this things and we can discuss it.

@igorbenav
Copy link
Owner

How's your plan for improving types for filtering because after reading docs it looks like FilterConfig is not type safe 🤔

About this, we are basically fixing things as they come (specially if they are more urgent). Since at the moment more is coming up than we can fix, not a lot of future planning going on.

You can always open PRs fixing stuff though, we'll be really happy

@igorbenav igorbenav added the enhancement New feature or request label Dec 23, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants