Skip to content

Commit 2b9fd8f

Browse files
committed
Move builds.models.Version attribute docs next to attributes
This uses Sphinx-style #: doc-comments, to retain a semblance of the current behaviour.
1 parent da8ec4c commit 2b9fd8f

File tree

1 file changed

+13
-23
lines changed

1 file changed

+13
-23
lines changed

readthedocs/builds/models.py

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -32,40 +32,30 @@
3232

3333

3434
class Version(models.Model):
35-
36-
"""
37-
Attributes
38-
----------
39-
40-
``identifier``
41-
The identifier is the ID for the revision this is version is for. This
42-
might be the revision number (e.g. in SVN), or the commit hash (e.g. in
43-
Git). If the this version is pointing to a branch, then ``identifier``
44-
will contain the branch name.
45-
46-
``verbose_name``
47-
This is the actual name that we got for the commit stored in
48-
``identifier``. This might be the tag or branch name like ``"v1.0.4"``.
49-
However this might also hold special version names like ``"latest"``
50-
and ``"stable"``.
51-
52-
``slug``
53-
The slug is the slugified version of ``verbose_name`` that can be used
54-
in the URL to identify this version in a project. It's also used in the
55-
filesystem to determine how the paths for this version are called. It
56-
must not be used for any other identifying purposes.
57-
"""
5835
project = models.ForeignKey(Project, verbose_name=_('Project'),
5936
related_name='versions')
6037
type = models.CharField(
6138
_('Type'), max_length=20,
6239
choices=VERSION_TYPES, default='unknown',
6340
)
6441
# used by the vcs backend
42+
43+
#: The identifier is the ID for the revision this is version is for. This
44+
#: might be the revision number (e.g. in SVN), or the commit hash (e.g. in
45+
#: Git). If the this version is pointing to a branch, then ``identifier``
46+
#: will contain the branch name.
6547
identifier = models.CharField(_('Identifier'), max_length=255)
6648

49+
#: This is the actual name that we got for the commit stored in
50+
#: ``identifier``. This might be the tag or branch name like ``"v1.0.4"``.
51+
#: However this might also hold special version names like ``"latest"``
52+
#: and ``"stable"``.
6753
verbose_name = models.CharField(_('Verbose Name'), max_length=255)
6854

55+
#: The slug is the slugified version of ``verbose_name`` that can be used
56+
#: in the URL to identify this version in a project. It's also used in the
57+
#: filesystem to determine how the paths for this version are called. It
58+
#: must not be used for any other identifying purposes.
6959
slug = VersionSlugField(_('Slug'), max_length=255,
7060
populate_from='verbose_name')
7161

0 commit comments

Comments
 (0)