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

Function dotted

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

Render a dotted name expression: `models.Model` -> "models.Model", `Base` -> "Base".

(expression: &Expression)

Source from the content-addressed store, hash-verified

582
583/// Render a dotted name expression: `models.Model` -> "models.Model", `Base` -> "Base".
584fn dotted(expression: &Expression) -> Option<String> {
585 match expression {
586 Expression::Name(NameExpression { id, .. }) => Some(id.to_string()),
587 Expression::Attribute(AttributeExpression { value, attr, .. }) => {
588 Some(format!("{}.{}", dotted(value)?, attr.as_str()))
589 }
590 _ => None,
591 }
592}
593
594/// Resolve a relationship/foreign-key target to a model name (`"User"`, `User`, `app.User`).
595fn relation_target(expression: &Expression) -> Option<String> {

Callers 1

relation_targetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected