Move builds.models.Version attribute docs next to attributes
This uses Sphinx-style #: doc-comments, to retain a semblance of the
current behaviour.
@@ -32,29 +32,6 @@ log = logging.getLogger(__name__)
class Version(models.Model):
-
- """
- Attributes
- ----------
-
- ``identifier``
- 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.
-
- ``verbose_name``
- 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"``.
-
- ``slug``
- 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.
- """
project = models.ForeignKey(Project, verbose_name=_('Project'),
related_name='versions')
type = models.CharField(
@@ -62,10 +39,23 @@ class Version(models.Model):
choices=VERSION_TYPES, default='unknown',
)
# used by the vcs backend
+
+ #: 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.
identifier = models.CharField(_('Identifier'), max_length=255)
+ #: 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"``.
verbose_name = models.CharField(_('Verbose Name'), max_length=255)
+ #: 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.
slug = VersionSlugField(_('Slug'), max_length=255,
populate_from='verbose_name')
