Skip to content

Permit passing custom derives to ActiveModelEx #3173

Description

@machineonamission

Motivation

I'm trying to get the dioxus Store derive to work on the same struct as a sea_orm::model derive so i can use the same struct for reactive data stores and also database insert queries.

Proposed Solutions

PR #2933 already permits derives to pass to Model and ModelEx, via either normal derive syntax or model_attrs. I think the best solution here is to expand this system to all other auto-generated structs, eg active_model_ex_attrs. extra derives on the entire struct will pass to all autogenerated structs, and there will also be the attrs thing for finer grain control

Additional Information

I was planning on writing this myself and PRing the fix, but I also felt it would be better to submit an issue before doing that so yall can see this.

My current barebones proof of concept:

https://github.com/machineonamission/PowerJournal/blob/8479a27a76220d766a15abb8f3939f507da3a4a1/src/views/new_entry.rs

b3827a7

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions