Django ORM
Models of the MCPServer app: the search index of The Smarter Project’s repositories.
RepositoryIndex records, for each repository of
SMARTER_PROJECT_REPOSITORIES, the commit that
is indexed, and RepositoryFile holds the text of each of its files. The index is
built by smarter.apps.mcpserver.indexer.index_repository(), and replaced whenever the
repository’s branch moves to a new commit.
Note
Experimental. The MCPServer was designed and coded by Claude Code (Anthropic’s Claude Opus 5.5), with Lawrence McDaniel as co-author. It is experimental, and will be documented.
- class smarter.apps.mcpserver.models.RepositoryFile(*args, **kwargs)[source]
Bases:
TimestampedModelOne text file of an indexed repository.
- Parameters:
id (Unknown) – Primary key: ID
created_at (Unknown) – Created at
updated_at (Unknown) – Updated at
path (Unknown) – Path. The file’s path in the repository.
kind (Unknown) – Kind
title (Unknown) – Title. A document’s first heading.
content (Unknown) – Content
size (Unknown) – Size. Bytes.
line_count (Unknown) – Line count
Relationship fields:
- Parameters:
index (Unknown) – Index (related name:
files)
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- exception NotUpdated
Bases:
ObjectNotUpdated,DatabaseError
- created_at
-
Created at
Timestamp indicating when the model instance was created.
This field is automatically set to the current date and time when the instance is first created. It is indexed in the database for efficient querying.
- Type:
Type
- get_kind_display(*, field=<django.db.models.CharField: kind>)
Shows the label of the
kind. Seeget_FOO_display()for more information.
- id
-
Primary key: ID
- Type:
Type
- line_count
-
Line count
- Type:
Type
- objects = <django.db.models.Manager object>
- size
-
Size. Bytes.
- Type:
Type
- updated_at
-
Updated at
Timestamp indicating when the model instance was last updated.
This field is automatically updated to the current date and time whenever the instance is saved. It is indexed in the database for efficient querying.
- Type:
Type
- class smarter.apps.mcpserver.models.RepositoryFileKind(*values)[source]
Bases:
TextChoicesWhat a file of a repository is.
- CODE = 'code'
Source code and configuration.
- DOCUMENTATION = 'documentation'
Prose, e.g. reStructuredText and Markdown.
- class smarter.apps.mcpserver.models.RepositoryIndex(*args, **kwargs)[source]
Bases:
TimestampedModelThe index of one of The Smarter Project’s repositories.
- Parameters:
id (Unknown) – Primary key: ID
created_at (Unknown) – Created at
updated_at (Unknown) – Updated at
repository (Unknown) – Repository. The repository’s name, e.g. smarter-cli.
commit_sha (Unknown) – Commit sha. The indexed commit.
status (Unknown) – Status
indexed_at (Unknown) – Indexed at. When the indexed commit was indexed.
file_count (Unknown) – File count
total_bytes (Unknown) – Total bytes
error (Unknown) – Error. Why the last attempt to index the repository failed.
Reverse relationships:
- Parameters:
files (Unknown) – All files of this repository index (related name of
index)
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- exception NotUpdated
Bases:
ObjectNotUpdated,DatabaseError
- created_at
-
Created at
Timestamp indicating when the model instance was created.
This field is automatically set to the current date and time when the instance is first created. It is indexed in the database for efficient querying.
- Type:
Type
- file_count
-
File count
- Type:
Type
- files
Reverse
ForeignKeyfromRepositoryFileAll files of this repository index (related name of
index)- Type:
Type
- get_status_display(*, field=<django.db.models.CharField: status>)
Shows the label of the
status. Seeget_FOO_display()for more information.
- id
-
Primary key: ID
- Type:
Type
- indexed_at
-
Indexed at. When the indexed commit was indexed.
- Type:
Type
- objects = <django.db.models.Manager object>
- total_bytes
-
Total bytes
- Type:
Type
- updated_at
-
Updated at
Timestamp indicating when the model instance was last updated.
This field is automatically updated to the current date and time whenever the instance is saved. It is indexed in the database for efficient querying.
- Type:
Type
- class smarter.apps.mcpserver.models.RepositoryIndexStatus(*values)[source]
Bases:
TextChoicesThe status of a repository’s index.
- FAILED = 'failed'
The repository could not be indexed, and has no index.
- PENDING = 'pending'
The repository has not been indexed yet.
- READY = 'ready'
The repository is indexed.
The last attempt to refresh it may have failed: see
error.