MCPcopy Create free account
hub / github.com/AutoForgeAI/autoforge / to_dict

Method to_dict

api/database.py:64–78  ·  view source on GitHub ↗

Convert feature to dictionary for JSON serialization.

(self)

Source from the content-addressed store, hash-verified

62 dependencies = Column(JSON, nullable=True, default=None)
63
64 def to_dict(self) -> dict:
65 """Convert feature to dictionary for JSON serialization."""
66 return {
67 "id": self.id,
68 "priority": self.priority,
69 "category": self.category,
70 "name": self.name,
71 "description": self.description,
72 "steps": self.steps,
73 # Handle legacy NULL values gracefully - treat as False
74 "passes": self.passes if self.passes is not None else False,
75 "in_progress": self.in_progress if self.in_progress is not None else False,
76 # Dependencies: NULL/empty treated as empty list for backwards compat
77 "dependencies": self.dependencies if self.dependencies else [],
78 }
79
80 def get_dependencies_safe(self) -> list[int]:
81 """Safely extract dependencies, handling NULL and malformed data."""

Callers 15

feature_createFunction · 0.95
get_ready_featuresMethod · 0.45
get_all_completeMethod · 0.45
run_loopMethod · 0.45
feature_get_by_idFunction · 0.45
feature_mark_failingFunction · 0.45
feature_mark_in_progressFunction · 0.45
feature_claim_and_getFunction · 0.45
feature_add_dependencyFunction · 0.45
feature_get_readyFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected