Django admin interface for Build and related models.

class readthedocs.builds.admin.BuildAdmin(model, admin_site)
class readthedocs.builds.admin.BuildCommandResultInline(parent_model, admin_site)

alias of readthedocs.builds.models.BuildCommandResult


Models for the builds app.

class readthedocs.builds.models.APIVersion(*args, **kwargs)

Version proxy model for API data deserialization.

This replaces the pattern where API data was deserialized into a mocked :py:cls:`Version` object. This pattern was confusing, as it was not explicit as to what form of object you were working with – API backed or database backed.

This model preserves the Version model methods, allowing for overrides on model field differences. This model pattern will generally only be used on builder instances, where we are interacting solely with API data.

exception DoesNotExist
exception MultipleObjectsReturned
class readthedocs.builds.models.Build(*args, **kwargs)

Build data.

exception DoesNotExist
exception MultipleObjectsReturned

Return if build has a finished state.

class readthedocs.builds.models.BuildCommandResult(*args, **kwargs)

Build command for a Build.

exception DoesNotExist
exception MultipleObjectsReturned

Total command runtime in seconds.

class readthedocs.builds.models.BuildCommandResultMixin

Mixin for common command result methods/properties.

Shared methods between the database model BuildCommandResult and non-model respresentations of build command results from the API


Did the command exit with a failing exit code.

Helper for inverse of successful()


Did the command exit with a successful exit code.

class readthedocs.builds.models.Version(*args, **kwargs)

Version of a Project.

exception DoesNotExist
exception MultipleObjectsReturned

Clean build path for project version.

Ensure build path is clean for project version. Used to ensure stale build checkouts for each project version are removed.


Return the branch name, the tag name or the revision identifier.

The result could be used as ref in a git repo, e.g. for linking to GitHub, Bitbucket or GitLab.


Return version build path if path exists, otherwise None.

get_github_url(docroot, filename, source_suffix=u'.rst', action=u'view')

Return a GitHub URL for a given filename.

  • docroot – Location of documentation in repository
  • filename – Name of file
  • source_suffix – File suffix of documentation format
  • actionview (default) or edit
identifier = None

The identifier is the ID for the revision this is version is for. This might be the revision number (e.g. in SVN), or the commit hash (e.g. in Git). If the this version is pointing to a branch, then identifier will contain the branch name.


Return display friendly identifier.

save(*args, **kwargs)

Add permissions to the Version for all owners on save.

slug = None

The slug is the slugified version of verbose_name that can be used in the URL to identify this version in a project. It’s also used in the filesystem to determine how the paths for this version are called. It must not be used for any other identifying purposes.

verbose_name = None

This is the actual name that we got for the commit stored in identifier. This might be the tag or branch name like "v1.0.4". However this might also hold special version names like "latest" and "stable".

class readthedocs.builds.models.VersionAlias(*args, **kwargs)

Alias for a Version.

exception DoesNotExist
exception MultipleObjectsReturned


URL configuration for builds app.


Views for builds app.

class readthedocs.builds.views.BuildBase

alias of readthedocs.builds.models.Build

class readthedocs.builds.views.BuildDetail(**kwargs)
class readthedocs.builds.views.BuildList(**kwargs)
class readthedocs.builds.views.BuildTriggerMixin