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.
Crud Enhancement
Added
Detailed
Using
EndpointCreator
andcrud_router
with Custom Soft Delete ColumnsWhen initializing
crud_router
or creating a customEndpointCreator
, you can pass the names of your custom soft delete columns through theFastCRUD
initialization. This informs FastCRUD which columns to check and update for soft deletion operations.Here's an example of using
crud_router
with custom soft delete columns:This setup ensures that the soft delete functionality within your application utilizes the
archived
andarchived_at
columns for marking records as deleted, rather than the defaultis_deleted
anddeleted_at
fields.Updating Multiple Records
To update multiple records, you can set the
allow_multiple=True
parameter in theupdate
method. This allows FastCRUD to apply the update to all records matching the given filters.Deleting Multiple Records
Similarly, you can delete multiple records by using the
allow_multiple=True
parameter in thedelete
ordb_delete
method, depending on whether you're performing a soft or hard delete.Advanced Filters
FastCRUD supports advanced filtering options, allowing you to query records using operators such as greater than (
__gt
), less than (__lt
), and their inclusive counterparts (__gte
,__lte
). These filters can be used in any method that retrieves or operates on records, includingget
,get_multi
,exists
,count
,update
, anddelete
.Using Advanced Filters
The following examples demonstrate how to use advanced filters for querying and manipulating data:
Fetching Records with Advanced Filters
Counting Records