Models¶
Django Version Manager has custom models to enhance your version management. However, you need to know that these models are application-unaware, which means they do not really know about your application’s name (machine-readable or human-readable).
Version¶
Version is a model containing the following information about your version:
Field | Field Type | Nullable | Default | Description |
---|---|---|---|---|
major | PositiveIntegerField | False | - | Major version of your application. |
minor | PositiveIntegerField | False | - | Minor version of your application. |
patch | PositiveIntegerField | False | - | Patch version of your application. |
status | CharField(16) | False | - | Status of your application. |
release_date | DateTimeField | False | - | Release date of your application. |
- The field status can only take the values below:
- prealpha
- alpha
- beta
- stable
Instead of memorizing these, you can use django_version_manager.status.Status class. Status class extends enum.Enum, which means you have to extract the value. See a Version object creation example as following:
1 2 3 4 | Version.objects.create(
...
status=Status.PREALPHA.value
)
|
The standard querysets based on Version model is ordered due to their release_date property in a reversed manner. So, if you use filter or all queries on Version model, the first instance will have the latest release date.
Changelog¶
Changelog helps you write metadata about a version of your application. It is directly linked to a Version instance in a one-to-one relationship.
Field | Field Type | Nullable | Default | Description |
---|---|---|---|---|
version | OneToOneField | False | - | Version instance. |
log | TextField | False | - | A log of your version. |