You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following the examples, I create a DerivePartialModel , in the query I do into_partial_model .., but then when retrieving related records find_related,
```error[E0599]: no method named find_related found for struct `PartialUser` in the current scope
--> src/services/user.rs:120:40
|
120 | let sites: Vecsite::Model = user.find_related(Site).all(db).await?;
| ^^^^^^^^^^^^ method not found in `PartialUser`
|
::: src/entities/users.rs:25:1
|
25 | pub struct PartialUser {
| ---------------------- method `find_related` not found for this struct
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following traits define an item `find_related`, perhaps you need to implement one of them:
candidate #1: `sea_orm::Related`
candidate #2: `sea_orm::ModelTrait``
How to preserve find_related behavior for PartialUser???
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Following the examples, I create a DerivePartialModel , in the query I do into_partial_model .., but then when retrieving related records find_related,
```error[E0599]: no method named
find_related
found for struct `PartialUser` in the current scope--> src/services/user.rs:120:40
|
120 | let sites: Vecsite::Model = user.find_related(Site).all(db).await?;
| ^^^^^^^^^^^^ method not found in `PartialUser`
|
::: src/entities/users.rs:25:1
|
25 | pub struct PartialUser {
| ---------------------- method `find_related` not found for this struct
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following traits define an item `find_related`, perhaps you need to implement one of them:
candidate #1: `sea_orm::Related`
candidate #2: `sea_orm::ModelTrait``
Beta Was this translation helpful? Give feedback.
All reactions