Resolve a relationship/foreign-key target to a model name (`"User"`, `User`, `app.User`).
(expression: &Expression)
| 593 | |
| 594 | /// Resolve a relationship/foreign-key target to a model name (`"User"`, `User`, `app.User`). |
| 595 | fn relation_target(expression: &Expression) -> Option<String> { |
| 596 | match expression { |
| 597 | Expression::StringLiteral(StringLiteral { value, .. }) => Some(value.to_string()), |
| 598 | Expression::Name(_) | Expression::Attribute(_) => dotted(expression), |
| 599 | _ => None, |
| 600 | } |
| 601 | } |
| 602 | |
| 603 | /// Map a base class to its ORM when the field constructors didn't already reveal it. |
| 604 | fn orm_from_bases(bases: &[String]) -> &'static str { |