MCPcopy Create free account
hub / github.com/Houseofmvps/codesight / relation_target

Function relation_target

plugins/ast/python/src/lib.rs:595–601  ·  view source on GitHub ↗

Resolve a relationship/foreign-key target to a model name (`"User"`, `User`, `app.User`).

(expression: &Expression)

Source from the content-addressed store, hash-verified

593
594/// Resolve a relationship/foreign-key target to a model name (`"User"`, `User`, `app.User`).
595fn 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.
604fn orm_from_bases(bases: &[String]) -> &'static str {

Callers

nothing calls this directly

Calls 1

dottedFunction · 0.85

Tested by

no test coverage detected